Skip to content

Commit 2b814d2

Browse files
Merge pull request #4832 from Microsoft/users/praga/hotfixVsTest
VsTest task hotfix for vstest console changes
2 parents 7a90575 + 73bdab0 commit 2b814d2

File tree

6 files changed

+13
-2
lines changed

6 files changed

+13
-2
lines changed

Tasks/VsTest/distributedtest.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ export class DistributedTest {
6565
utils.Helper.addToProcessEnvVars(envVars, 'DTA.MiniMatchSourceFilter', 'true');
6666
utils.Helper.addToProcessEnvVars(envVars, 'DTA.LocalTestDropPath', this.dtaTestConfig.testDropLocation);
6767
utils.Helper.addToProcessEnvVars(envVars, 'DTA.EnableConsoleLogs', 'true');
68+
utils.Helper.addToProcessEnvVars(envVars, 'DTA.UseVsTestConsole', this.dtaTestConfig.useVsTestConsole);
69+
utils.Helper.addToProcessEnvVars(envVars, 'DTA.TestPlatformVersion', this.dtaTestConfig.vsTestVersion);
6870
if (this.dtaTestConfig.pathtoCustomTestAdapters) {
6971
const testAdapters = tl.findMatch(this.dtaTestConfig.pathtoCustomTestAdapters, '**\\*TestAdapter.dll');
7072
if (!testAdapters || (testAdapters && testAdapters.length === 0)) {

Tasks/VsTest/models.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export interface DtaTestConfigurations extends TestConfigurations {
4141
customSlicingenabled: boolean;
4242
dtaEnvironment: DtaEnvironment;
4343
numberOfAgentsInPhase: number;
44+
useVsTestConsole: string;
4445
}
4546

4647
export interface DtaEnvironment {

Tasks/VsTest/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"version": {
1818
"Major": 2,
1919
"Minor": 0,
20-
"Patch": 61
20+
"Patch": 62
2121
},
2222
"demands": [
2323
"vstest"

Tasks/VsTest/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"version": {
1818
"Major": 2,
1919
"Minor": 0,
20-
"Patch": 61
20+
"Patch": 62
2121
},
2222
"demands": [
2323
"vstest"

Tasks/VsTest/taskinputparser.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const uuid = require('node-uuid');
1111
export function getDistributedTestConfigurations() {
1212
const dtaConfiguration = {} as models.DtaTestConfigurations;
1313
initTestConfigurations(dtaConfiguration);
14+
dtaConfiguration.useVsTestConsole = 'false';
1415

1516
if (dtaConfiguration.vsTestLocationMethod === utils.Constants.vsTestVersionString && dtaConfiguration.vsTestVersion === '12.0') {
1617
throw (tl.loc('vs2013NotSupportedInDta'));
@@ -33,6 +34,11 @@ export function getDistributedTestConfigurations() {
3334
}
3435
tl._writeLine(tl.loc('dtaNumberOfAgents', dtaConfiguration.numberOfAgentsInPhase));
3536

37+
const useVsTestConsole = tl.getVariable('UseVsTestConsole');
38+
if (useVsTestConsole) {
39+
dtaConfiguration.useVsTestConsole = useVsTestConsole;
40+
}
41+
3642
dtaConfiguration.dtaEnvironment = initDtaEnvironment();
3743
return dtaConfiguration;
3844
}

Tasks/VsTest/versionfinder.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ function locateTestWindow(testConfig: models.TestConfigurations): string {
7878
tl.debug('Searching for latest Visual Studio');
7979
const vstestconsole15Path = getVSTestConsole15Path();
8080
if (vstestconsole15Path) {
81+
testConfig.vsTestVersion = "15.0";
8182
return vstestconsole15Path;
8283
}
8384

8485
// fallback
8586
tl.debug('Unable to find an instance of Visual Studio 2017..');
8687
tl.debug('Searching for Visual Studio 2015..');
88+
testConfig.vsTestVersion = "14.0";
8789
return getVSTestLocation(14);
8890
}
8991

0 commit comments

Comments
 (0)