Skip to content

Commit 903839a

Browse files
committed
docs: add bazel jasmine_node_test debug information
1 parent 3185ce8 commit 903839a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/process/bazel.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,27 @@ Since the requirement is quite lax on Linux but quite strict on windows, what en
4242
happening is that lack of `require.resolve` calls go unnoticed until someone tries to run
4343
things on Windows, at which point it breaks.
4444

45+
## Debugging jasmine_node_test
46+
47+
On Linux, Bazel tests will run under a sandbox for isolation.
48+
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+
50+
Then you will find the intermediate test files in `bazel-out/k8-fastbuild/bin`, followed by the test target path.
51+
52+
Tests that are sharded, via the `shard_count` attribute, can fail if you reduce the number of tests or focus only a few.
53+
This will cause some shards to execute 0 tests, which makes the exit with an error code.
54+
55+
56+
Tests that are marked as flaky, via the `flaky` attribute, will repeat when they fail.
57+
This will cause any focused test to be repeated multiple time, since the presence of focused tests
58+
causes jasmine to exit with a non-zero exit code.
59+
60+
While testing, you can remove the `shard_count` attribute to prevent sharding and the `flaky`
61+
attribute to prevent repetition.
62+
63+
NB: For a few tests, sandbox is required as otherwise the rules_nodejs linker symlinks will conflict
64+
with the yarn workspace symlinks in node_modules.
65+
4566
## Issues
4667

4768
1. Yarn workspaces is not compatible with Bazel-managed deps

0 commit comments

Comments
 (0)