Skip to content

Commit 84a9b87

Browse files
committed
👷 Drop --browser flag, rely on BS_BROWSER env var from matrix
1 parent 17b291f commit 84a9b87

2 files changed

Lines changed: 10 additions & 25 deletions

File tree

‎.gitlab-ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ unit-bs:
311311
junit: test-report/unit-bs/*.xml
312312
script:
313313
- yarn
314-
- node scripts/test/ci-bs.ts test:unit --browser $BS_BROWSER
314+
- node scripts/test/ci-bs.ts test:unit
315315
after_script:
316316
- node ./scripts/test/export-test-result.ts unit-bs
317317

‎scripts/test/ci-bs.ts‎

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { parseArgs } from 'node:util'
21
import { printLog, runMain } from '../lib/executionUtils.ts'
32
import { command } from '../lib/command.ts'
43
import { fetchPR, getLastCommonCommit, LOCAL_BRANCH } from '../lib/gitUtils.ts'
@@ -17,20 +16,9 @@ const RELEVANT_FILE_PATTERNS = [
1716
]
1817

1918
runMain(async () => {
20-
const {
21-
values: { browser },
22-
positionals,
23-
} = parseArgs({
24-
args: process.argv.slice(2),
25-
options: {
26-
browser: { type: 'string' },
27-
},
28-
allowPositionals: true,
29-
})
30-
31-
const testCommand = positionals[0]
19+
const testCommand = process.argv[2]
3220
if (!testCommand) {
33-
throw new Error('Usage: ci-bs.ts <test:unit> [--browser <id>]')
21+
throw new Error('Usage: ci-bs.ts <test:unit>')
3422
}
3523

3624
const pr = await fetchPR(LOCAL_BRANCH!)
@@ -42,16 +30,13 @@ runMain(async () => {
4230
return
4331
}
4432

45-
const environment: Record<string, string> = {
46-
BS_USERNAME: getBrowserStackUsername(),
47-
BS_ACCESS_KEY: getBrowserStackAccessKey(),
48-
}
49-
50-
if (browser) {
51-
environment.BS_BROWSER = browser
52-
}
53-
54-
command`yarn ${testCommand}:bs`.withEnvironment(environment).withLogs().run()
33+
command`yarn ${testCommand}:bs`
34+
.withEnvironment({
35+
BS_USERNAME: getBrowserStackUsername(),
36+
BS_ACCESS_KEY: getBrowserStackAccessKey(),
37+
})
38+
.withLogs()
39+
.run()
5540
})
5641

5742
function hasRelevantChanges(baseCommit: string): boolean {

0 commit comments

Comments
 (0)