How to decorate bazel test output to include github actions groups?

16 Views Asked by At

I want to configure bazel test run in CI in such a way that it will employ Github Actions Group Workflow commands to group failed tests logs.

I basically want to add ::group:://path/to/my:test at the start of the test logs and ::endgroup:: at the end.

How can I achieve that?

I tried searching docs and even bazel help test, but could not find anything that smells like it might lead to success. Any ideas?

1

There are 1 best solutions below

0
unkulunkulu On

One possible solution is to write a shell script like

#!/bin/bash

echo "::group::bazel test $TEST_TARGET"

"$@"
ERR=$?

echo "::endgroup::"

exit $ERR

And pass path to it via --run_under bazel test option.

This will include the required commands inside test log