...
dev test
has a--stress
flag for running tests understress
and--race
for running tests with the race detector enabled.Next to the
test.log
file produced by your test, you can find atest.xml
file. This file contains specific information on each test run and its status, as well as timing information.The
-v
argument todev test
will result in more verbose logging as well as more detailed information written to thetest.xml
. You can make this the default behavior on your machine by addingtest --test_env=GO_TEST_WRAP_TESTV=1
to your.bazelrc.user
file.As with
dev build
,dev test
allows you to pass additional arguments directly to Bazel by putting them after--
: for example,dev test pkg/sql/types -- --verbose_failures --sandbox_debug
.To get test results printed as tests are being run add
-v -- --test_output streamed
to the test command. Note that this reduces test parallelism.To attach a debugger to a hung
dev test
process tack-- -c dbg
to the end of your command and it will disable stripping which breaks dlv (https://github.com/bazelbuild/intellij/issues/2313).For more tips on debugging test failures, see “How to ensure your tests can run in the Bazel sandbox”
...