Skip to content

Commit 8987ad4

Browse files
devversionjelbourn
authored andcommitted
build: disable watch mode for yarn test all script (#19288)
We cannot run `yarn test all` with ibazel due to Ibazel not supporting the flags we need in order to filter out build/test targets. We temporarily always run in non-watch mode, print a warning until the upstream fix lands: bazelbuild/bazel-watcher#382.
1 parent 35ec5fe commit 8987ad4

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

scripts/run-component-tests.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,22 @@ if (local && (components.length > 1 || all)) {
6262
}
6363

6464
const browserName = firefox ? 'firefox-local' : 'chromium-local';
65-
const bazelBinary = `${watch ? 'ibazel' : 'bazel'}`;
65+
const bazelBinary = `yarn -s ${watch ? 'ibazel' : 'bazel'}`;
6666
const configFlag = viewEngine ? '--config=view-engine' : '';
6767

6868
// If `all` has been specified as component, we run tests for all components
69-
// in the repository. The `--firefox` and `--no-watch` flags can be still specified.
69+
// in the repository. The `--firefox` flag can be still specified.
7070
if (all) {
71+
// `ibazel` doesn't allow us to filter tests and build targets as it only allows
72+
// a subset of Bazel flags to be passed through. We temporarily always use `bazel`
73+
// instead of ibazel until https://github.com/bazelbuild/bazel-watcher/pull/382 lands.
74+
if (watch) {
75+
console.warn(chalk.yellow('Unable to run all component tests in watch mode.'));
76+
console.warn(chalk.yellow('Tests will be run in non-watch mode..'));
77+
}
7178
shelljs.exec(
72-
`${bazelBinary} test //src/... --test_tag_filters=-e2e,browser:${browserName} ` +
73-
`--build_tag_filters=browser:${browserName} --build_tests_only ${configFlag}`);
79+
`yarn -s bazel test --test_tag_filters=-e2e,browser:${browserName} ` +
80+
`--build_tag_filters=browser:${browserName} --build_tests_only ${configFlag} //src/...`);
7481
return;
7582
}
7683

0 commit comments

Comments
 (0)