Skip to content

Commit

Permalink
Run Safari tests serially
Browse files Browse the repository at this point in the history
  • Loading branch information
dlarocque committed Sep 3, 2024
1 parent c9b2ab7 commit bf6c59d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions scripts/ci-test/karmaSafariLauncher.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
const fs = require('fs');
const os = require('os');
const path = require('path');
const rimraf = require("rimraf");
const rimraf = require('rimraf');

var SafariBrowser = function (baseBrowserDecorator) {
baseBrowserDecorator(this);
Expand All @@ -39,14 +39,14 @@ var SafariBrowser = function (baseBrowserDecorator) {
path.join(SAFARI_DATA_DIR, 'Library/Caches'),
path.join(SAFARI_DATA_DIR, 'Library/Cookies'),
path.join(SAFARI_DATA_DIR, 'Library/Safari'),
path.join(SAFARI_DATA_DIR, 'Library/WebKit'),
]
path.join(SAFARI_DATA_DIR, 'Library/WebKit')
];

directoriesToClear.forEach((dir) => {
directoriesToClear.forEach(dir => {
if (fs.existsSync(dir)) {
rimraf.sync(dir);
}
})
});
}

this._start = function (url) {
Expand Down
7 changes: 6 additions & 1 deletion scripts/ci-test/test_changed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ async function runTests(config: TestConfig) {
process.exit(0);
}

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

0 comments on commit bf6c59d

Please sign in to comment.