Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning message #4107

Merged
merged 2 commits into from
Apr 24, 2017
Merged
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 @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want add "AreUITests" as property in test configuration?

{
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