Merge pull request #90153 from microsoft/joh/continous-browser-tests
add browser tests to continous builds
This commit is contained in:
commit
c5d703aaa7
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue