Skip to content

Commit

Permalink
Merge pull request #4107 from Microsoft/users/kavipriya/warningfix
Browse files Browse the repository at this point in the history
Warning message
  • Loading branch information
kaadhina authored Apr 24, 2017
2 parents 65d3fb4 + 1daba54 commit 0149f24
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,6 @@
"loc.messages.testAssemblyFilterInput": "Test assembly filter : %s",
"loc.messages.vsVersionSelected": "VisualStudio version selected for test execution : %s",
"loc.messages.runTestsLocally": "Run the tests locally using %s....",
"loc.messages.vstestLocationSpecified": "%s, specified location : %s"
"loc.messages.vstestLocationSpecified": "%s, specified location : %s",
"loc.messages.uitestsparallel": "Running UI tests in parallel on the same machine can lead to errors. Consider disabling the ‘run in parallel’ option or run UI tests using a separate task. To learn more, see https://aka.ms/paralleltestexecution "
}
3 changes: 2 additions & 1 deletion Tasks/VsTest/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@
"testAssemblyFilterInput": "Test assembly filter : %s",
"vsVersionSelected": "VisualStudio version selected for test execution : %s",
"runTestsLocally": "Run the tests locally using %s....",
"vstestLocationSpecified": "%s, specified location : %s"
"vstestLocationSpecified": "%s, specified location : %s",
"uitestsparallel": "Running UI tests in parallel on the same machine can lead to errors. Consider disabling the ‘run in parallel’ option or run UI tests using a separate task. To learn more, see https://aka.ms/paralleltestexecution "

}
}
3 changes: 2 additions & 1 deletion Tasks/VsTest/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@
"testAssemblyFilterInput": "ms-resource:loc.messages.testAssemblyFilterInput",
"vsVersionSelected": "ms-resource:loc.messages.vsVersionSelected",
"runTestsLocally": "ms-resource:loc.messages.runTestsLocally",
"vstestLocationSpecified": "ms-resource:loc.messages.vstestLocationSpecified"
"vstestLocationSpecified": "ms-resource:loc.messages.vstestLocationSpecified",
"uitestsparallel": "ms-resource:loc.messages.uitestsparallel"
}
}
5 changes: 5 additions & 0 deletions Tasks/VsTest/taskinputparser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ function initTestConfigurations(testConfiguration: models.TestConfigurations) {
tl._writeLine(tl.loc('vstestLocationSpecified', 'vstest.console.exe', testConfiguration.vsTestLocation));
}

if(tl.getBoolInput('uiTests') && testConfiguration.runInParallel)
{
tl.warning(tl.loc('uitestsparallel'));
}

// only to facilitate the writing of unit tests
testConfiguration.vs15HelperPath = tl.getVariable('vs15Helper');
if (!testConfiguration.vs15HelperPath) {
Expand Down
27 changes: 27 additions & 0 deletions Tests-Legacy/L0/VsTest/_suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,33 @@ describe('VsTest Suite', function () {
});
})

it('Vstest task with run in parallel and UI tests', (done) => {

let vstestCmd = [sysVstestLocation, '/source/dir/someFile1', '/logger:trx'].join(' ');
setResponseFile('vstestGood.json');

let tr = new trm.TaskRunner('VSTest');
tr.setInput('testSelector', 'testAssemblies');
tr.setInput('testAssemblyVer2', '/source/dir/someFile1');
tr.setInput('vstestLocationMethod', 'version');
tr.setInput('vsTestVersion', '14.0');
tr.setInput('uiTests', 'true');
tr.setInput('runInParallel', 'true');

tr.run()
.then(() => {
assert(tr.resultWasSet, 'task should have set a result');
assert(tr.stderr.length === 0, 'should not have written to stderr. error: ' + tr.stderr);
assert(tr.succeeded, 'task should have succeeded');
assert(tr.ran(vstestCmd), 'should have run vstest');
assert(tr.stdout.search(/Running UI tests in parallel on the same machine can lead to errors. Consider disabling the run in parallel option or run UI tests using a separate task./) >= 0, 'should have given a warning for ui tests and run in parallel selection.');
done();
})
.fail((err) => {
done(err);
});
})

it('Vstest task with run in parallel and vs 2013', (done) => {

let vstestCmd = [sysVstestLocation, '/source/dir/someFile1', '/logger:trx'].join(' ');
Expand Down

0 comments on commit 0149f24

Please sign in to comment.