From 8ff0a4438395c9b225ba53ae03cc7bf4ad43fb5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=98=8ANitin=20Gurram=F0=9F=98=8A?= Date: Mon, 15 May 2017 10:24:52 +0530 Subject: [PATCH] Fix discovery of VS 15 --- .../TestAgentConfiguration.ps1 | 15 +++++++++++++++ Tasks/DeployVisualStudioTestAgent/task.json | 2 +- Tasks/DeployVisualStudioTestAgent/task.loc.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 b/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 index f8b77fb3ac83..900db3935a07 100644 --- a/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 +++ b/Tasks/DeployVisualStudioTestAgent/TestAgentConfiguration.ps1 @@ -36,6 +36,17 @@ Write-Warning $_ } + $TestWindowPath = $null + $VsPath = $null + if ($TestAgentVersion -eq "15.0") { + $instance = Get-VisualStudio_15_0 + if ($instance) { + $VsPath = [System.IO.Path]::Combine($instance.Path, "Common7", "IDE") + $TestWindowPath = [System.IO.Path]::Combine($VsPath, "CommonExtensions", "Microsoft", "TestWindow") + Write-Verbose "VS path $VsPath; Test window path $TestWindowPath" -Verbose + } + } + # Fix Assembly Redirections # VSTS uses Newton Json 8.0 while the System.Net.Http uses 6.0 # Redirection to Newton Json 8.0 @@ -109,6 +120,10 @@ $Processinfo.EnvironmentVariables.Add("DTA.EnvironmentUri", $EnvironmentUrl); $Processinfo.EnvironmentVariables.Add("DTA.TeamFoundationCollectionUri", $TfsCollection); $Processinfo.EnvironmentVariables.Add("DTA.TestPlatformVersion", $TestAgentVersion); + if ($VsPath) { + $Processinfo.EnvironmentVariables.Add("DTA.VisualStudio.Path", $VsPath); + $Processinfo.EnvironmentVariables.Add("DTA.TestWindow.Path", $TestWindowPath); + } $Processinfo.UseShellExecute = $false $Processinfo.LoadUserProfile = $false $Processinfo.CreateNoWindow = $true diff --git a/Tasks/DeployVisualStudioTestAgent/task.json b/Tasks/DeployVisualStudioTestAgent/task.json index 8e4a2130ce55..6e832a63d7c9 100644 --- a/Tasks/DeployVisualStudioTestAgent/task.json +++ b/Tasks/DeployVisualStudioTestAgent/task.json @@ -13,7 +13,7 @@ "version": { "Major": 2, "Minor": 1, - "Patch": 4 + "Patch": 5 }, "runsOn": [ "Agent" diff --git a/Tasks/DeployVisualStudioTestAgent/task.loc.json b/Tasks/DeployVisualStudioTestAgent/task.loc.json index 628f79effaaa..18b782c0ecbb 100644 --- a/Tasks/DeployVisualStudioTestAgent/task.loc.json +++ b/Tasks/DeployVisualStudioTestAgent/task.loc.json @@ -13,7 +13,7 @@ "version": { "Major": 2, "Minor": 1, - "Patch": 4 + "Patch": 5 }, "runsOn": [ "Agent"