Skip to content

Commit 328ed65

Browse files
jkremsalan-agius4
authored andcommitted
docs: elaborate on debugging jasmine node tests
The existing instructions don't quite cover a full debugging setup and miss some flags that allow debugging without modification of BUILD files. (cherry picked from commit f8b2203)
1 parent f4db482 commit 328ed65

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/process/bazel.md

+11
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ things on Windows, at which point it breaks.
4646

4747
On Linux, Bazel tests will run under a sandbox for isolation.
4848
You can turn off this sandbox by adding the [`local = True`](https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes-tests) attribute to the rule.
49+
You can also force local execution by passing `--test_output=streamed`.
4950

5051
Then you will find the intermediate test files in `bazel-out/k8-fastbuild/bin`, followed by the test target path.
5152

@@ -58,6 +59,16 @@ causes jasmine to exit with a non-zero exit code.
5859

5960
While testing, you can remove the `shard_count` attribute to prevent sharding and the `flaky`
6061
attribute to prevent repetition.
62+
Setting `--test_output=streamed` will disable sharding and `--flaky_test_attempts=1` will disable
63+
the reruns of tests that have been marked as `flaky`.
64+
65+
The `.bazelrc` includes a config for running tests with remote debugging enabled:
66+
67+
```sh
68+
yarn bazel test --config=debug //packages/angular/cli:angular-cli_test
69+
# Also disable reruns of failing tests that were marked as flaky:
70+
yarn bazel test --config=debug --config=no-sharding //packages/angular/cli:angular-cli_test
71+
```
6172

6273
NB: For a few tests, sandbox is required as otherwise the rules_nodejs linker symlinks will conflict
6374
with the yarn workspace symlinks in node_modules.

0 commit comments

Comments
 (0)