Skip to content

Commit bf6c59d

Browse files
committed
Run Safari tests serially
1 parent c9b2ab7 commit bf6c59d

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

scripts/ci-test/karmaSafariLauncher.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
const fs = require('fs');
2020
const os = require('os');
2121
const path = require('path');
22-
const rimraf = require("rimraf");
22+
const rimraf = require('rimraf');
2323

2424
var SafariBrowser = function (baseBrowserDecorator) {
2525
baseBrowserDecorator(this);
@@ -39,14 +39,14 @@ var SafariBrowser = function (baseBrowserDecorator) {
3939
path.join(SAFARI_DATA_DIR, 'Library/Caches'),
4040
path.join(SAFARI_DATA_DIR, 'Library/Cookies'),
4141
path.join(SAFARI_DATA_DIR, 'Library/Safari'),
42-
path.join(SAFARI_DATA_DIR, 'Library/WebKit'),
43-
]
42+
path.join(SAFARI_DATA_DIR, 'Library/WebKit')
43+
];
4444

45-
directoriesToClear.forEach((dir) => {
45+
directoriesToClear.forEach(dir => {
4646
if (fs.existsSync(dir)) {
4747
rimraf.sync(dir);
4848
}
49-
})
49+
});
5050
}
5151

5252
this._start = function (url) {

scripts/ci-test/test_changed.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ async function runTests(config: TestConfig) {
5959
process.exit(0);
6060
}
6161

62-
const lernaCmd = ['lerna', 'run', '--concurrency', '4'];
62+
const lernaCmd = ['lerna', 'run'];
63+
// Since the tests run in Safari are not headless, they share some global state when
64+
// run concurrently, so we should run them serially.
65+
if (process.env?.BROWSERS?.includes('Safari')) {
66+
lernaCmd.push('--concurrency', '1');
67+
}
6368
console.log(chalk`{blue Running tests in:}`);
6469
for (const task of testTasks) {
6570
if (task.reason === TestReason.Changed) {

0 commit comments

Comments
 (0)