Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 <b>not</b> 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. <br><br> Hosted Windows agents from the VS 2015 and 2017 pools can be used to run UI tests.<br> [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",
Expand Down
1 change: 1 addition & 0 deletions Tasks/VsTestV3/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}
Expand Down
21 changes: 17 additions & 4 deletions Tasks/VsTestV3/inputparser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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');
}
Expand All @@ -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');
Expand Down
5 changes: 3 additions & 2 deletions Tasks/VsTestV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 3,
"Minor": 266,
"Minor": 267,
"Patch": 0
},
"demands": [
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion Tasks/VsTestV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 3,
"Minor": 266,
"Minor": 267,
"Patch": 0
},
"demands": [
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion Tasks/VsTestV3/taskinputparser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
16 changes: 15 additions & 1 deletion Tasks/VsTestV3/versionfinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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) {
Expand Down