Skip to content

Commit f02a726

Browse files
authored
build: fix "test all" script running incorrectly (#19261)
Currently `yarn test all` runs tests for the wrong browsers as we incorrectly filter out the desired browser.
1 parent 448523b commit f02a726

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/run-component-tests.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,16 @@ if (local && (components.length > 1 || all)) {
6161
process.exit(1);
6262
}
6363

64-
const bazelBinary = `yarn -s ${watch ? 'ibazel' : 'bazel'}`;
65-
const testTargetName =
66-
`unit_tests_${local ? 'local' : firefox ? 'firefox-local' : 'chromium-local'}`;
64+
const browserName = firefox ? 'firefox-local' : 'chromium-local';
65+
const bazelBinary = `${watch ? 'ibazel' : 'bazel'}`;
6766
const configFlag = viewEngine ? '--config=view-engine' : '';
6867

6968
// If `all` has been specified as component, we run tests for all components
70-
// in the repository. The `--firefox` flag can be still specified.
69+
// in the repository. The `--firefox` and `--no-watch` flags can be still specified.
7170
if (all) {
7271
shelljs.exec(
73-
`${bazelBinary} test //src/... --test_tag_filters=-e2e,-browser:${testTargetName} ` +
74-
`--build_tag_filters=-browser:${testTargetName} --build_tests_only ${configFlag}`);
72+
`${bazelBinary} test //src/... --test_tag_filters=-e2e,browser:${browserName} ` +
73+
`--build_tag_filters=browser:${browserName} --build_tests_only ${configFlag}`);
7574
return;
7675
}
7776

@@ -87,6 +86,7 @@ if (!components.length) {
8786
process.exit(1);
8887
}
8988

89+
const testTargetName = `unit_tests_${local ? 'local' : browserName}`;
9090
const bazelAction = local ? 'run' : 'test';
9191
const testLabels = components
9292
.map(t => correctTypos(t))

0 commit comments

Comments
 (0)