-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Expand file tree
/
Copy pathrun-browserstack-tests.js
More file actions
executable file
·52 lines (45 loc) · 1.44 KB
/
run-browserstack-tests.js
File metadata and controls
executable file
·52 lines (45 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* eslint-disable no-console */
const chalk = require('chalk');
async function run(command, args = []) {
const { execa } = await import('execa');
console.log(chalk.dim('$ ' + command + ' ' + args.join(' ')));
return execa(command, args, { stdout: 'inherit', stderr: 'inherit' });
}
(async function () {
await run('ember', ['browserstack:connect']);
try {
try {
// Calling testem directly here instead of `ember test` so that
// we do not have to do a double build (by the time this is run
// we have already ran `ember build`).
const testemArgs = [
'ci',
'-f',
'testem.browserstack.js',
'--host',
'127.0.0.1',
'--port',
'7774',
];
// Absorb flaky single-launcher BrowserStack failures so they
// don't fail otherwise-green CI.
try {
await run('testem', testemArgs);
} catch (e) {
console.log(chalk.yellow(`testem ci failed (${e.shortMessage}); retrying once.`));
await run('testem', testemArgs);
}
console.log('success');
process.exit(0); // eslint-disable-line n/no-process-exit
} finally {
if (process.env.GITHUB_RUN_ID) {
await run('ember', ['browserstack:results']);
}
await run('ember', ['browserstack:disconnect']);
}
} catch (error) {
console.log('error');
console.log(error);
process.exit(1); // eslint-disable-line n/no-process-exit
}
})();