diff --git a/Tasks/VsTestV3/Strings/resources.resjson/en-US/resources.resjson b/Tasks/VsTestV3/Strings/resources.resjson/en-US/resources.resjson index 03fd1e4c3113..2d7a2c48147e 100644 --- a/Tasks/VsTestV3/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/VsTestV3/Strings/resources.resjson/en-US/resources.resjson @@ -36,7 +36,7 @@ "loc.input.help.uiTests": "To run UI tests, ensure that the agent is set to run in interactive mode. Setting up an agent to run interactively must be done before queueing the build / release. Checking this box does not configure the agent in interactive mode automatically. This option in the task is to only serve as a reminder to configure agent appropriately to avoid failures.

Hosted Windows agents from the VS 2015 and 2017 pools can be used to run UI tests.
[More information](https://aka.ms/uitestmoreinfo).", "loc.input.label.vstestLocationMethod": "Select test platform using", "loc.input.label.vsTestVersion": "Test platform version", - "loc.input.help.vsTestVersion": "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.", + "loc.input.help.vsTestVersion": "The version of Visual Studio test to use. If latest is specified it chooses latest Visual Studio version starting from VS2026 followed by VS2022, 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.", "loc.input.label.vstestLocation": "Path to vstest.console.exe", "loc.input.help.vstestLocation": "Optionally supply the path to VSTest.", "loc.input.label.runSettingsFile": "Settings file", diff --git a/Tasks/VsTestV3/helpers.ts b/Tasks/VsTestV3/helpers.ts index 2a0774a1f172..f5d753bb6552 100644 --- a/Tasks/VsTestV3/helpers.ts +++ b/Tasks/VsTestV3/helpers.ts @@ -171,6 +171,7 @@ export class Helper { case 15: return '2017'; case 16: return '2019'; case 17: return '2022'; + case 18: return '2026'; default: return 'selected'; } } diff --git a/Tasks/VsTestV3/inputparser.ts b/Tasks/VsTestV3/inputparser.ts index 588fcf9f07df..257434f17259 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,15 @@ 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,7 +560,15 @@ function getTestPlatformPath(inputDataContract : idc.InputDataContract) { const vsVersion: number = parseFloat(vsTestVersion); - if (vsVersion === 17.0) { + 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) { return path.join(vstestconsolePath, 'Common7', 'IDE', 'Extensions', 'TestPlatform'); diff --git a/Tasks/VsTestV3/task.json b/Tasks/VsTestV3/task.json index 966b20b8ef7c..9f627912abef 100644 --- a/Tasks/VsTestV3/task.json +++ b/Tasks/VsTestV3/task.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 266, + "Minor": 267, "Patch": 0 }, "demands": [ @@ -221,11 +221,12 @@ "label": "Test platform version", "defaultValue": "latest", "required": false, - "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.", + "helpMarkDown": "The version of Visual Studio test to use. If latest is specified it chooses latest Visual Studio version starting from VS2026 followed by VS2022, 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", + "18.0": "Visual Studio 2026", "17.0": "Visual Studio 2022", "16.0": "Visual Studio 2019", "15.0": "Visual Studio 2017", diff --git a/Tasks/VsTestV3/task.loc.json b/Tasks/VsTestV3/task.loc.json index 9cbed9c3c3fd..b3f7fe0f55cd 100644 --- a/Tasks/VsTestV3/task.loc.json +++ b/Tasks/VsTestV3/task.loc.json @@ -17,7 +17,7 @@ "author": "Microsoft Corporation", "version": { "Major": 3, - "Minor": 266, + "Minor": 267, "Patch": 0 }, "demands": [ @@ -226,6 +226,7 @@ "groupName": "executionOptions", "options": { "latest": "Latest", + "18.0": "Visual Studio 2026", "17.0": "Visual Studio 2022", "16.0": "Visual Studio 2019", "15.0": "Visual Studio 2017", diff --git a/Tasks/VsTestV3/taskinputparser.ts b/Tasks/VsTestV3/taskinputparser.ts index 7517693ad59e..52b39c4b8b3a 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..6b4cd29f1a5f 100644 --- a/Tasks/VsTestV3/versionfinder.ts +++ b/Tasks/VsTestV3/versionfinder.ts @@ -91,7 +91,13 @@ 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'); @@ -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) {