Merge pull request #90153 from microsoft/joh/continous-browser-tests

add browser tests to continous builds
This commit is contained in:
Johannes Rieken 2020-02-07 16:17:56 +01:00 committed by GitHub
commit c5d703aaa7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 3 deletions

View file

@ -41,6 +41,9 @@ steps:
- script: |
./scripts/test.sh --tfs "Unit Tests"
displayName: Run Unit Tests
- script: |
yarn test-browser --browser chromium --browser webkit
displayName: Run Unit Tests (Browsers)
- script: |
./scripts/test-integration.sh --tfs "Integration Tests"
displayName: Run Integration Tests

View file

@ -49,6 +49,9 @@ steps:
- script: |
DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests"
displayName: Run Unit Tests
- script: |
DISPLAY=:10 yarn test-browser --browser chromium
displayName: Run Unit Tests (Browser)
- script: |
DISPLAY=:10 ./scripts/test-integration.sh --tfs "Integration Tests"
displayName: Run Integration Tests

View file

@ -46,6 +46,9 @@ steps:
- powershell: |
.\scripts\test.bat --tfs "Unit Tests"
displayName: Run Unit Tests
- powershell: |
yarn test-browser --browser chromium --browser webkit
displayName: Run Unit Tests (Browser)
- powershell: |
.\scripts\test-integration.bat --tfs "Integration Tests"
displayName: Run Integration Tests

View file

@ -10,6 +10,7 @@
"private": true,
"scripts": {
"test": "mocha",
"test-browser": "node test/unit/browser/index.js",
"preinstall": "node build/npm/preinstall.js",
"postinstall": "node build/npm/postinstall.js",
"compile": "gulp compile --max_old_space_size=4095",

View file

@ -210,12 +210,22 @@ class EchoRunner extends events.EventEmitter {
testModules.then(async modules => {
const browserTypes = Array.isArray(argv.browser) ? argv.browser : [argv.browser];
const promises = browserTypes.map(browserType => runTestsInBrowser(modules, browserType));
const messages = await Promise.all(promises);
// run tests in selected browsers
const browserTypes = Array.isArray(argv.browser)
? argv.browser : [argv.browser];
const promises = browserTypes.map(async browserType => {
try {
return await runTestsInBrowser(modules, browserType);
} catch (err) {
console.error(err);
process.exit(1);
}
});
// aftermath
let didFail = false;
const messages = await Promise.all(promises);
for (let msg of messages) {
if (msg) {
didFail = true;