Skip to content

Commit 40ad0fc

Browse files
devversionjelbourn
authored andcommitted
build: allow inspecting test nodejs process w/ bazel (#16525)
Adds a new `debug` configuration for Bazel that can be used to open the Chrome Devtools Debugger in order to debug a bazel test that runs with NodeJS. This is similar to what `angular/angular` provides. *Note*: This does not make debugging for web test suites easier. For web test suites we need to find a better solution. I have something in mind where developers can run `bazel run` instead of `bazel test` to open the karma test suite in non-capture mode (allowing easy debugging)
1 parent cf11ed2 commit 40ad0fc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.bazelrc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,24 @@ build:remote --host_platform=//tools:rbe_platform
8787
build:remote --platforms=//tools:rbe_platform
8888
build:remote --extra_toolchains=@rbe_default//config:cc-toolchain
8989

90-
# Setup Build Event Service
90+
# Setup Build Event Service
9191
build:remote --bes_backend=buildeventservice.googleapis.com
9292
build:remote --bes_timeout=30s
9393
build:remote --bes_results_url="https://source.cloud.google.com/results/invocations/"
9494

9595
# Set remote caching settings
9696
build:remote --remote_accept_cached=true
9797

98+
################################
99+
# --config=debug #
100+
################################
101+
102+
# Enable debugging tests with --config=debug
103+
test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results
104+
98105
################################
99106
# Local Environment Setup #
107+
# Needs to be last statement #
100108
################################
101109
# Load any settings which are specific to the current user. Needs to be *last* statement
102110
# in this config, as the user configuration should be able to overwrite flags from this file.

0 commit comments

Comments
 (0)