未验证 提交 c5d703aa 编写于 作者: J Johannes Rieken 提交者: GitHub

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

add browser tests to continous builds
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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",
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册