Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion build_defs/go.build_defs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def go_test(name:str, srcs:list, resources:list=None, data:list|dict=None, deps:
)
cmds, tools = _go_binary_cmds(static=static, definitions=definitions, gcov=cgo)

test_cmd = f'$TEST {flags} 2>&1 | tee $TMP_DIR/test.results'
test_cmd = f'$TEST {flags} 2>&1 | $TOOLS_JUNIT_REPORT | tee $RESULTS_FILE'
worker_cmd = f'$(worker {worker})' if worker else ""
if worker_cmd:
test_cmd = f'{worker_cmd} && {test_cmd} '
Expand Down Expand Up @@ -646,6 +646,9 @@ def go_test(name:str, srcs:list, resources:list=None, data:list|dict=None, deps:
debug_tools = debug_tools,
cmd = cmds,
test_cmd = test_cmd,
test_tools = {
"junit_report": "//third_party/go:junit_report",
},
debug_cmd = debug_cmd,
visibility = visibility,
test_sandbox = sandbox,
Expand Down
15 changes: 15 additions & 0 deletions third_party/go/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ go_module(
visibility = ["PUBLIC"],
)

go_mod_download(
name = "junit_report_download",
module = "github.com/marcuscaisey/go-junit-report/v2",
version = "f9f65c7e2eb4a7e4a98b4cc8757772ae1092d211",
)

go_module(
name = "junit_report",
binary = True,
download = ":junit_report_download",
licences = ["MIT"],
module = "github.com/jstemmer/go-junit-report/v2",
visibility = ["PUBLIC"],
)

go_module(
name = "spew",
install = ["spew"],
Expand Down