diff --git a/Tasks/MSBuildV1/task.json b/Tasks/MSBuildV1/task.json index 9e8b2b590757..ecbd30e87f8b 100644 --- a/Tasks/MSBuildV1/task.json +++ b/Tasks/MSBuildV1/task.json @@ -12,7 +12,7 @@ "author": "Microsoft Corporation", "version": { "Major": 1, - "Minor": 260, + "Minor": 261, "Patch": 0 }, "demands": [ @@ -54,15 +54,16 @@ "defaultValue": "latest", "helpMarkDown": "If the preferred version cannot be found, the latest version found will be used instead. On an macOS agent, xbuild (Mono) will be used if version is lower than 15.0.", "visibleRule": "msbuildLocationMethod = version", - "options": { - "latest": "Latest", - "17.0": "MSBuild 17.0", - "16.0": "MSBuild 16.0", - "15.0": "MSBuild 15.0", - "14.0": "MSBuild 14.0", - "12.0": "MSBuild 12.0", - "4.0": "MSBuild 4.0" - } + "options": { + "latest": "Latest", + "18.0": "MSBuild 18.0", + "17.0": "MSBuild 17.0", + "16.0": "MSBuild 16.0", + "15.0": "MSBuild 15.0", + "14.0": "MSBuild 14.0", + "12.0": "MSBuild 12.0", + "4.0": "MSBuild 4.0" + } }, { "name": "msbuildArchitecture", diff --git a/Tasks/MSBuildV1/task.loc.json b/Tasks/MSBuildV1/task.loc.json index ec706a125f83..7fdb0bf56e15 100644 --- a/Tasks/MSBuildV1/task.loc.json +++ b/Tasks/MSBuildV1/task.loc.json @@ -12,7 +12,7 @@ "author": "Microsoft Corporation", "version": { "Major": 1, - "Minor": 260, + "Minor": 261, "Patch": 0 }, "demands": [ @@ -54,15 +54,16 @@ "defaultValue": "latest", "helpMarkDown": "ms-resource:loc.input.help.msbuildVersion", "visibleRule": "msbuildLocationMethod = version", - "options": { - "latest": "Latest", - "17.0": "MSBuild 17.0", - "16.0": "MSBuild 16.0", - "15.0": "MSBuild 15.0", - "14.0": "MSBuild 14.0", - "12.0": "MSBuild 12.0", - "4.0": "MSBuild 4.0" - } + "options": { + "latest": "Latest", + "18.0": "MSBuild 18.0", + "17.0": "MSBuild 17.0", + "16.0": "MSBuild 16.0", + "15.0": "MSBuild 15.0", + "14.0": "MSBuild 14.0", + "12.0": "MSBuild 12.0", + "4.0": "MSBuild 4.0" + } }, { "name": "msbuildArchitecture", diff --git a/Tasks/SqlAzureDacpacDeploymentV1/FindSqlPackagePath.ps1 b/Tasks/SqlAzureDacpacDeploymentV1/FindSqlPackagePath.ps1 index 7d1464b1e239..ac06f10958bd 100644 --- a/Tasks/SqlAzureDacpacDeploymentV1/FindSqlPackagePath.ps1 +++ b/Tasks/SqlAzureDacpacDeploymentV1/FindSqlPackagePath.ps1 @@ -441,7 +441,7 @@ function Get-VisualStudio_15_0 { # may be something like 15.2. Write-Verbose "Getting latest Visual Studio 15 setup instance." $output = New-Object System.Text.StringBuilder - Invoke-VstsTool -FileName "$PSScriptRoot\vswhere.exe" -Arguments "-version [15.0,18.0) -latest -format json" -RequireExitCodeZero 2>&1 | + Invoke-VstsTool -FileName "$PSScriptRoot\vswhere.exe" -Arguments "-version [15.0,19.0) -latest -format json" -RequireExitCodeZero 2>&1 | ForEach-Object { if ($_ -is [System.Management.Automation.ErrorRecord]) { Write-Verbose "STDERR: $($_.Exception.Message)" @@ -460,7 +460,7 @@ function Get-VisualStudio_15_0 { # the same scheme. It appears to follow the 15..* versioning scheme. Write-Verbose "Getting latest BuildTools 15 setup instance." $output = New-Object System.Text.StringBuilder - Invoke-VstsTool -FileName "$PSScriptRoot\vswhere.exe" -Arguments "-version [15.0,18.0) -products Microsoft.VisualStudio.Product.BuildTools -latest -format json" -RequireExitCodeZero 2>&1 | + Invoke-VstsTool -FileName "$PSScriptRoot\vswhere.exe" -Arguments "-version [15.0,19.0) -products Microsoft.VisualStudio.Product.BuildTools -latest -format json" -RequireExitCodeZero 2>&1 | ForEach-Object { if ($_ -is [System.Management.Automation.ErrorRecord]) { Write-Verbose "STDERR: $($_.Exception.Message)" diff --git a/Tasks/VSBuildV1/Get-VSPath.ps1 b/Tasks/VSBuildV1/Get-VSPath.ps1 index 3606b6512d55..4c4f851b370c 100644 --- a/Tasks/VSBuildV1/Get-VSPath.ps1 +++ b/Tasks/VSBuildV1/Get-VSPath.ps1 @@ -4,12 +4,12 @@ function Get-VSPath { [Parameter(Mandatory = $true)] [string]$Version) - $Versions = @('10.0', '11.0', '12.0','14.0','15.0', '16.0', '17.0') + $Versions = @('10.0', '11.0', '12.0','14.0','15.0', '16.0', '17.0', '18.0') Trace-VstsEnteringInvocation $MyInvocation try { if ( !($Version -in $Versions )) { - Write-Warning "Please enter one of the versions 10.0, 11.0, 12.0, 14.0, 15.0, 16.0, 17.0" + Write-Warning "Please enter one of the versions 10.0, 11.0, 12.0, 14.0, 15.0, 16.0, 17.0, 18.0" } else { $VersionNumber = [int]$Version.Remove(2) # Search for more than 15.0 Willow instance. diff --git a/Tasks/VSBuildV1/Select-VSVersion.ps1 b/Tasks/VSBuildV1/Select-VSVersion.ps1 index 29b4cf0b1199..26bafa0338cb 100644 --- a/Tasks/VSBuildV1/Select-VSVersion.ps1 +++ b/Tasks/VSBuildV1/Select-VSVersion.ps1 @@ -5,7 +5,7 @@ function Select-VSVersion { Trace-VstsEnteringInvocation $MyInvocation try { $specificVersion = $PreferredVersion -and $PreferredVersion -ne 'latest' - $versions = '17.0', '16.0', '15.0', '14.0', '12.0', '11.0', '10.0' | Where-Object { $_ -ne $PreferredVersion } + $versions = '18.0', '17.0', '16.0', '15.0', '14.0', '12.0', '11.0', '10.0' | Where-Object { $_ -ne $PreferredVersion } # Look for a specific version of Visual Studio. if ($specificVersion) { diff --git a/Tasks/VSBuildV1/Tests/MapsVSVersions.ps1 b/Tasks/VSBuildV1/Tests/MapsVSVersions.ps1 index 7199bb93cfa6..bfd533b61c94 100644 --- a/Tasks/VSBuildV1/Tests/MapsVSVersions.ps1 +++ b/Tasks/VSBuildV1/Tests/MapsVSVersions.ps1 @@ -10,6 +10,7 @@ Register-Mock Invoke-BuildTools Register-Mock EmitTelemetry $mappings = @( @{ VSVersion = '' ; MSBuildVersion = '14.0' } + @{ VSVersion = '18.0' ; MSBuildVersion = '18.0' } @{ VSVersion = '17.0' ; MSBuildVersion = '17.0' } @{ VSVersion = '16.0' ; MSBuildVersion = '16.0' } @{ VSVersion = '15.0' ; MSBuildVersion = '15.0' } diff --git a/Tasks/VSBuildV1/Tests/Select-VSVersion.FallsBackFrom18.ps1 b/Tasks/VSBuildV1/Tests/Select-VSVersion.FallsBackFrom18.ps1 new file mode 100644 index 000000000000..841bd403264f --- /dev/null +++ b/Tasks/VSBuildV1/Tests/Select-VSVersion.FallsBackFrom18.ps1 @@ -0,0 +1,16 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +. $PSScriptRoot\..\Select-VSVersion.ps1 +Register-Mock Write-Warning +Register-Mock Get-VSPath { "Some resolved location" } -- -Version '17.0' + +# Act. +$actual = Select-VSVersion -PreferredVersion '18.0' + +# Assert. +Assert-WasCalled Write-Warning +Assert-WasCalled Get-VSPath -Times 2 +Assert-AreEqual -Expected '17.0' -Actual $actual diff --git a/Tasks/VSBuildV1/Tests/Select-VSVersion.FallsForwardFrom17.ps1 b/Tasks/VSBuildV1/Tests/Select-VSVersion.FallsForwardFrom17.ps1 new file mode 100644 index 000000000000..1b6f8c59add6 --- /dev/null +++ b/Tasks/VSBuildV1/Tests/Select-VSVersion.FallsForwardFrom17.ps1 @@ -0,0 +1,16 @@ +[CmdletBinding()] +param() + +# Arrange. +. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 +. $PSScriptRoot\..\Select-VSVersion.ps1 +Register-Mock Write-Warning +Register-Mock Get-VSPath { "Some resolved location" } -- -Version '18.0' + +# Act. +$actual = Select-VSVersion -PreferredVersion '17.0' + +# Assert. +Assert-WasCalled Write-Warning +Assert-WasCalled Get-VSPath -Times 2 +Assert-AreEqual -Expected '18.0' -Actual $actual diff --git a/Tasks/VSBuildV1/Tests/Select-VSVersion.FindsLatest.ps1 b/Tasks/VSBuildV1/Tests/Select-VSVersion.FindsLatest.ps1 index d40c713081d9..b1ee951e36dc 100644 --- a/Tasks/VSBuildV1/Tests/Select-VSVersion.FindsLatest.ps1 +++ b/Tasks/VSBuildV1/Tests/Select-VSVersion.FindsLatest.ps1 @@ -5,7 +5,7 @@ param() . $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1 . $PSScriptRoot\..\Select-VSVersion.ps1 $preferredVersions = '', 'latest' -$knownVersions = '10.0', '11.0', '12.0', '14.0', '15.0', '16.0', '17.0' # Registered in ascending order to validate latest is searched first. +$knownVersions = '10.0', '11.0', '12.0', '14.0', '15.0', '16.0', '17.0', '18.0' # Registered in ascending order to validate latest is searched first. foreach ($preferredVersion in $preferredVersions) { Unregister-Mock Get-VSPath foreach ($knownVersion in $knownVersions) { diff --git a/Tasks/VSBuildV1/VSBuild.ps1 b/Tasks/VSBuildV1/VSBuild.ps1 index b531b914fda4..5638672f6a8d 100644 --- a/Tasks/VSBuildV1/VSBuild.ps1 +++ b/Tasks/VSBuildV1/VSBuild.ps1 @@ -73,6 +73,7 @@ try { $msBuildVersion = $null; switch ("$vsVersion") { '' { $msBuildVersion = '14.0' ; break } # VS wasn't found. Attempt to find MSBuild 14.0 or lower. + '18.0' { $msBuildVersion = '18.0' ; break } '17.0' { $msBuildVersion = '17.0' ; break } '16.0' { $msBuildVersion = '16.0' ; break } '15.0' { $msBuildVersion = '15.0' ; break } diff --git a/Tasks/VSBuildV1/task.json b/Tasks/VSBuildV1/task.json index bd9994417572..da08fb1de9ab 100644 --- a/Tasks/VSBuildV1/task.json +++ b/Tasks/VSBuildV1/task.json @@ -12,7 +12,7 @@ "author": "Microsoft Corporation", "version": { "Major": 1, - "Minor": 263, + "Minor": 264, "Patch": 0 }, "demands": [ diff --git a/Tasks/VsTestV2/inputparser.ts b/Tasks/VsTestV2/inputparser.ts index 1b80cef02b77..c7ee6ae53e8d 100644 --- a/Tasks/VsTestV2/inputparser.ts +++ b/Tasks/VsTestV2/inputparser.ts @@ -243,7 +243,8 @@ function getTestPlatformSettings(inputDataContract : idc.InputDataContract) : id ci.publishEvent({ subFeature: 'ToolsInstallerInstallationSuccessful' }); - } else if ((vsTestVersion !== '17.0') + } else if ((vsTestVersion !== '18.0') + && (vsTestVersion !== '17.0') && (vsTestVersion !== '16.0') && (vsTestVersion !== '15.0') && (vsTestVersion !== '14.0') @@ -531,11 +532,17 @@ function getTestPlatformPath(inputDataContract : idc.InputDataContract) { if (vsTestVersion.toLowerCase() === 'latest') { tl.debug('Searching for latest Visual Studio.'); - let vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); + let vstestconsolePath = getVSTestConsolePath('18.0', '19.0'); if (vstestconsolePath) { return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); } - vstestconsolePath = getVSTestConsolePath('16.0', '17.0'); + + vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); + if (vstestconsolePath) { + return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); + } + + vstestconsolePath = getVSTestConsolePath('16.0', '17.0'); if (vstestconsolePath) { return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); } @@ -553,6 +560,14 @@ function getTestPlatformPath(inputDataContract : idc.InputDataContract) { const vsVersion: number = parseFloat(vsTestVersion); + if (vsVersion === 18.0) { + const vstestconsolePath = getVSTestConsolePath('18.0', '19.0'); + if (vstestconsolePath) { + return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); + } + throw (new Error(tl.loc('VstestNotFound', utils.Helper.getVSVersion(vsVersion)))); + } + if (vsVersion === 17.0) { const vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); if (vstestconsolePath) { diff --git a/Tasks/VsTestV2/task.json b/Tasks/VsTestV2/task.json index 2e8b3a6eaf26..9993fdb2c35e 100644 --- a/Tasks/VsTestV2/task.json +++ b/Tasks/VsTestV2/task.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 261, + "Minor": 262, "Patch": 0 }, "demands": [ @@ -214,14 +214,15 @@ "helpMarkDown": "The version of Visual Studio test to use. If latest is specified it chooses latest Visual Studio version starting from VS2022 followed by VS2019, VS2017 and VS2015 depending on what is installed. Visual Studio 2013 is not supported. To run tests without needing Visual Studio on the agent, use the ‘Installed by tools installer’ option. Be sure to include the ‘Visual Studio Test Platform Installer’ task to acquire the test platform from nuget.", "visibleRule": "vstestLocationMethod = version", "groupName": "executionOptions", - "options": { - "latest": "Latest", - "17.0": "Visual Studio 2022", - "16.0": "Visual Studio 2019", - "15.0": "Visual Studio 2017", - "14.0": "Visual Studio 2015", - "toolsInstaller": "Installed by Tools Installer" - }, + "options": { + "latest": "Latest", + "18.0": "Visual Studio 2026", + "17.0": "Visual Studio 2022", + "16.0": "Visual Studio 2019", + "15.0": "Visual Studio 2017", + "14.0": "Visual Studio 2015", + "toolsInstaller": "Installed by Tools Installer" + }, "properties": { "EditableOptions": "True" } diff --git a/Tasks/VsTestV2/task.loc.json b/Tasks/VsTestV2/task.loc.json index 06b8de2e70e3..9979341a6b89 100644 --- a/Tasks/VsTestV2/task.loc.json +++ b/Tasks/VsTestV2/task.loc.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 2, - "Minor": 261, + "Minor": 262, "Patch": 0 }, "demands": [ @@ -214,14 +214,15 @@ "helpMarkDown": "ms-resource:loc.input.help.vsTestVersion", "visibleRule": "vstestLocationMethod = version", "groupName": "executionOptions", - "options": { - "latest": "Latest", - "17.0": "Visual Studio 2022", - "16.0": "Visual Studio 2019", - "15.0": "Visual Studio 2017", - "14.0": "Visual Studio 2015", - "toolsInstaller": "Installed by Tools Installer" - }, + "options": { + "latest": "Latest", + "18.0": "Visual Studio 2026", + "17.0": "Visual Studio 2022", + "16.0": "Visual Studio 2019", + "15.0": "Visual Studio 2017", + "14.0": "Visual Studio 2015", + "toolsInstaller": "Installed by Tools Installer" + }, "properties": { "EditableOptions": "True" } diff --git a/Tasks/VsTestV2/taskinputparser.ts b/Tasks/VsTestV2/taskinputparser.ts index 297993dd5098..09b81df3c565 100644 --- a/Tasks/VsTestV2/taskinputparser.ts +++ b/Tasks/VsTestV2/taskinputparser.ts @@ -162,7 +162,8 @@ function initTestConfigurations(testConfiguration: models.TestConfigurations) { testConfiguration.vsTestLocation = testConfiguration.toolsInstallerConfig.vsTestConsolePathFromPackageLocation; testConfiguration.toolsInstallerConfig.isToolsInstallerInUse = true; - } else if ((testConfiguration.vsTestVersion !== '17.0') + } else if ((testConfiguration.vsTestVersion !== '18.0') + && (testConfiguration.vsTestVersion !== '17.0') && (testConfiguration.vsTestVersion !== '16.0') && (testConfiguration.vsTestVersion !== '15.0') && (testConfiguration.vsTestVersion !== '14.0') diff --git a/Tasks/VsTestV2/versionfinder.ts b/Tasks/VsTestV2/versionfinder.ts index 6a6b14b1c385..a06e84467972 100644 --- a/Tasks/VsTestV2/versionfinder.ts +++ b/Tasks/VsTestV2/versionfinder.ts @@ -91,12 +91,18 @@ function locateTestWindow(testConfig: models.TestConfigurations): string { // latest tl.debug('Searching for latest Visual Studio'); - let vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); + let vstestconsolePath = getVSTestConsolePath('18.0', '19.0'); + if (vstestconsolePath) { + testConfig.vsTestVersion = "18.0"; + return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); + } + vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); if (vstestconsolePath) { testConfig.vsTestVersion = "17.0"; return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); } - vstestconsolePath = getVSTestConsolePath('16.0', '17.0'); + + vstestconsolePath = getVSTestConsolePath('16.0', '17.0'); if (vstestconsolePath) { testConfig.vsTestVersion = "16.0"; return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); @@ -117,6 +123,14 @@ function locateTestWindow(testConfig: models.TestConfigurations): string { const vsVersion: number = parseFloat(testConfig.vsTestVersion); + if (vsVersion === 18.0) { //Visual Studio 2026 + const vstestconsolePath = getVSTestConsolePath('18.0', '19.0'); + if (vstestconsolePath) { + return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); + } + throw (new Error(tl.loc('VstestNotFound', utils.Helper.getVSVersion(vsVersion)))); + } + if (vsVersion === 17.0) { //Visual Studio 2022 const vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); if (vstestconsolePath) { diff --git a/Tasks/VsTestV3/inputparser.ts b/Tasks/VsTestV3/inputparser.ts index 588fcf9f07df..0312435f650e 100644 --- a/Tasks/VsTestV3/inputparser.ts +++ b/Tasks/VsTestV3/inputparser.ts @@ -245,7 +245,8 @@ function getTestPlatformSettings(inputDataContract : idc.InputDataContract) : id ci.publishEvent({ subFeature: 'ToolsInstallerInstallationSuccessful' }); - } else if ((vsTestVersion !== '17.0') + } else if ((vsTestVersion !== '18.0') + && (vsTestVersion !== '17.0') && (vsTestVersion !== '16.0') && (vsTestVersion !== '15.0') && (vsTestVersion !== '14.0') @@ -533,11 +534,18 @@ function getTestPlatformPath(inputDataContract : idc.InputDataContract) { if (vsTestVersion.toLowerCase() === 'latest') { tl.debug('Searching for latest Visual Studio.'); - let vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); + + let vstestconsolePath = getVSTestConsolePath('18.0', '19.0'); if (vstestconsolePath) { return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); } - vstestconsolePath = getVSTestConsolePath('16.0', '17.0'); + + vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); + if (vstestconsolePath) { + return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); + } + + vstestconsolePath = getVSTestConsolePath('16.0', '17.0'); if (vstestconsolePath) { return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); } @@ -555,6 +563,14 @@ function getTestPlatformPath(inputDataContract : idc.InputDataContract) { const vsVersion: number = parseFloat(vsTestVersion); + if (vsVersion === 18.0) { + const vstestconsolePath = getVSTestConsolePath('18.0', '19.0'); + if (vstestconsolePath) { + return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); + } + throw (new Error(tl.loc('VstestNotFound', utils.Helper.getVSVersion(vsVersion)))); + } + if (vsVersion === 17.0) { const vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); if (vstestconsolePath) { diff --git a/Tasks/VsTestV3/task.json b/Tasks/VsTestV3/task.json index f95e925e3cf0..b9f83ab4b394 100644 --- a/Tasks/VsTestV3/task.json +++ b/Tasks/VsTestV3/task.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 261, + "Minor": 262, "Patch": 0 }, "demands": [ @@ -224,14 +224,15 @@ "helpMarkDown": "The version of Visual Studio test to use. If latest is specified it chooses latest Visual Studio version starting from VS2022 followed by VS2019, VS2017 and VS2015 depending on what is installed. Visual Studio 2013 is not supported. To run tests without needing Visual Studio on the agent, use the ‘Installed by tools installer’ option. Be sure to include the ‘Visual Studio Test Platform Installer’ task to acquire the test platform from nuget.", "visibleRule": "vstestLocationMethod = version", "groupName": "executionOptions", - "options": { - "latest": "Latest", - "17.0": "Visual Studio 2022", - "16.0": "Visual Studio 2019", - "15.0": "Visual Studio 2017", - "14.0": "Visual Studio 2015", - "toolsInstaller": "Installed by Tools Installer" - }, + "options": { + "latest": "Latest", + "18.0": "Visual Studio 2026", + "17.0": "Visual Studio 2022", + "16.0": "Visual Studio 2019", + "15.0": "Visual Studio 2017", + "14.0": "Visual Studio 2015", + "toolsInstaller": "Installed by Tools Installer" + }, "properties": { "EditableOptions": "True" } diff --git a/Tasks/VsTestV3/task.loc.json b/Tasks/VsTestV3/task.loc.json index 32a69beb8375..36742670b8db 100644 --- a/Tasks/VsTestV3/task.loc.json +++ b/Tasks/VsTestV3/task.loc.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 261, + "Minor": 262, "Patch": 0 }, "demands": [ @@ -224,14 +224,15 @@ "helpMarkDown": "ms-resource:loc.input.help.vsTestVersion", "visibleRule": "vstestLocationMethod = version", "groupName": "executionOptions", - "options": { - "latest": "Latest", - "17.0": "Visual Studio 2022", - "16.0": "Visual Studio 2019", - "15.0": "Visual Studio 2017", - "14.0": "Visual Studio 2015", - "toolsInstaller": "Installed by Tools Installer" - }, + "options": { + "latest": "Latest", + "18.0": "Visual Studio 2026", + "17.0": "Visual Studio 2022", + "16.0": "Visual Studio 2019", + "15.0": "Visual Studio 2017", + "14.0": "Visual Studio 2015", + "toolsInstaller": "Installed by Tools Installer" + }, "properties": { "EditableOptions": "True" } diff --git a/Tasks/VsTestV3/taskinputparser.ts b/Tasks/VsTestV3/taskinputparser.ts index 7517693ad59e..a869b2c766e8 100644 --- a/Tasks/VsTestV3/taskinputparser.ts +++ b/Tasks/VsTestV3/taskinputparser.ts @@ -162,7 +162,8 @@ function initTestConfigurations(testConfiguration: models.TestConfigurations) { testConfiguration.vsTestLocation = testConfiguration.toolsInstallerConfig.vsTestConsolePathFromPackageLocation; testConfiguration.toolsInstallerConfig.isToolsInstallerInUse = true; - } else if ((testConfiguration.vsTestVersion !== '17.0') + } else if ((testConfiguration.vsTestVersion !== '18.0') + && (testConfiguration.vsTestVersion !== '17.0') && (testConfiguration.vsTestVersion !== '16.0') && (testConfiguration.vsTestVersion !== '15.0') && (testConfiguration.vsTestVersion !== '14.0') diff --git a/Tasks/VsTestV3/versionfinder.ts b/Tasks/VsTestV3/versionfinder.ts index 6a6b14b1c385..02abcea4be80 100644 --- a/Tasks/VsTestV3/versionfinder.ts +++ b/Tasks/VsTestV3/versionfinder.ts @@ -91,12 +91,19 @@ function locateTestWindow(testConfig: models.TestConfigurations): string { // latest tl.debug('Searching for latest Visual Studio'); - let vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); + let vstestconsolePath = getVSTestConsolePath('18.0', '19.0'); + if (vstestconsolePath) { + testConfig.vsTestVersion = "18.0"; + return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); + } + + vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); if (vstestconsolePath) { testConfig.vsTestVersion = "17.0"; return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); } - vstestconsolePath = getVSTestConsolePath('16.0', '17.0'); + + vstestconsolePath = getVSTestConsolePath('16.0', '17.0'); if (vstestconsolePath) { testConfig.vsTestVersion = "16.0"; return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); @@ -116,8 +123,16 @@ function locateTestWindow(testConfig: models.TestConfigurations): string { } const vsVersion: number = parseFloat(testConfig.vsTestVersion); + + if (vsVersion === 18.0) { // Visual Studio 2026 + const vstestconsolePath = getVSTestConsolePath('18.0', '19.0'); + if (vstestconsolePath) { + return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); + } + throw (new Error(tl.loc('VstestNotFound', utils.Helper.getVSVersion(vsVersion)))); + } - if (vsVersion === 17.0) { //Visual Studio 2022 + if (vsVersion === 17.0) { // Visual Studio 2022 const vstestconsolePath = getVSTestConsolePath('17.0', '18.0'); if (vstestconsolePath) { return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform');