Skip to content
Open
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
13 changes: 7 additions & 6 deletions tasks/gotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,18 +325,19 @@ def test(

test_run_arg = f"-run {test_run_name}" if test_run_name else ""

stdlib_build_cmd = 'go build {verbose} -mod={go_mod} -tags "{go_build_tags}" -gcflags="{gcflags}" '
stdlib_build_cmd += '-ldflags="{ldflags}" {build_cpus} {race_opt} {trimpath_opt} std cmd'
# build flags are used both for building the stdlib and to run the tests
gobuild_flags = '-mod={go_mod} -tags "{go_build_tags}" -gcflags="{gcflags}" -ldflags="{ldflags}" {build_cpus} {race_opt} {trimpath_opt}'

stdlib_build_cmd = f'go build {verbose} {gobuild_flags} std cmd'
rerun_coverage_fix = '--raw-command {cov_test_path}' if coverage else ""
gotestsum_flags = (
'{junit_file_flag} {json_flag} --format {gotestsum_format} {rerun_fails} --packages="{packages}" '
+ rerun_coverage_fix
)
gobuild_flags = (
'-mod={go_mod} -tags "{go_build_tags}" -gcflags="{gcflags}" -ldflags="{ldflags}" {build_cpus} {race_opt}'
)
govet_flags = '-vet=off'
gotest_flags = '{verbose} {test_cpus} -timeout {timeout}s -short {covermode_opt} {test_run_arg} {nocache} {extra_args} {trimpath_opt}'
gotest_flags = (
'{verbose} {test_cpus} -timeout {timeout}s -short {covermode_opt} {test_run_arg} {nocache} {extra_args}'
)
cmd = f'gotestsum {gotestsum_flags} -- {gobuild_flags} {govet_flags} {gotest_flags}'
args = {
"go_mod": go_mod,
Expand Down