Skip to content

Commit

Permalink
docs: elaborate on debugging jasmine node tests
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
jkrems authored and alan-agius4 committed Sep 9, 2024
1 parent f4db482 commit 328ed65
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/process/bazel.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ things on Windows, at which point it breaks.

On Linux, Bazel tests will run under a sandbox for isolation.
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.
You can also force local execution by passing `--test_output=streamed`.

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

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

While testing, you can remove the `shard_count` attribute to prevent sharding and the `flaky`
attribute to prevent repetition.
Setting `--test_output=streamed` will disable sharding and `--flaky_test_attempts=1` will disable
the reruns of tests that have been marked as `flaky`.

The `.bazelrc` includes a config for running tests with remote debugging enabled:

```sh
yarn bazel test --config=debug //packages/angular/cli:angular-cli_test
# Also disable reruns of failing tests that were marked as flaky:
yarn bazel test --config=debug --config=no-sharding //packages/angular/cli:angular-cli_test
```

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

0 comments on commit 328ed65

Please sign in to comment.