Skip to content

Commit 9377eaf

Browse files
committed
gotestsum
1 parent 5a767a8 commit 9377eaf

File tree

8 files changed

+45
-22
lines changed

8 files changed

+45
-22
lines changed

Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,7 @@ GOTAGSLIST := sqlite_unlock_notify sqlite_omit_load_extension
4343
# e.g. make GOTAGSCUSTOM=msgtrace
4444
GOTAGSLIST += ${GOTAGSCUSTOM}
4545

46-
# If available, use gotestsum instead of 'go test'.
47-
ifeq (, $(shell which gotestsum))
48-
export GOTESTCOMMAND=go test
49-
else
50-
export GOTESTCOMMAND=gotestsum --format pkgname --jsonfile testresults.json --
51-
endif
46+
GOTESTCOMMAND := go tool -modfile=tool.mod gotestsum --format pkgname --jsonfile testresults.json --
5247

5348
ifeq ($(OS_TYPE), darwin)
5449
# M1 Mac--homebrew install location in /opt/homebrew

scripts/buildtools/install_buildtools.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,3 @@ if [[ "${BUILDTOOLS_INSTALL}" != "ALL" ]]; then
8888
fi
8989

9090
install_go_module github.com/algorand/go-swagger github.com/algorand/go-swagger/cmd/swagger
91-
install_go_module gotest.tools/gotestsum

scripts/buildtools/versions

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
github.com/algorand/go-swagger v0.0.0-20251018003531-2ea7c750dcac
2-
gotest.tools/gotestsum v1.13.0

scripts/travis/test.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ if [ -z "${SKIP_GO_INSTALLATION}" ]; then
1515
eval "$(~/gimme "${GOLANG_VERSION}")"
1616
fi
1717

18-
# If this command fails the Makefile will select 'go test' instead.
19-
"${SCRIPTPATH}/../buildtools/install_buildtools.sh" -o "gotest.tools/gotestsum" || true
20-
2118
if [ "${OS}-${ARCH}" = "linux-arm" ] || [ "${OS}-${ARCH}" = "windows-amd64" ]; then
2219
# for arm, no tests need to be invoked.
2320
# for now, disable tests on windows.

test/scripts/e2e_client_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,9 @@ def main():
514514
def finish_test_results(jsonfile, jsonpath, junitpath):
515515
# This only runs in CI, since TEST_RESULTS env var controls the
516516
# block that opens the jsonfile, and registers this atexit. So we
517-
# assume jsonfile is open, and gotestsum available.
517+
# assume jsonfile is open.
518518
jsonfile.close()
519-
xrun(["gotestsum", "--junitfile", junitpath, "--raw-command", "cat", jsonpath])
519+
xrun(["go", "tool", "-modfile=tool.mod", "gotestsum", "--junitfile", junitpath, "--raw-command", "cat", jsonpath])
520520

521521

522522
if __name__ == '__main__':

test/scripts/e2e_go_tests.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@ set -o pipefail
88
export GOPATH=$(go env GOPATH)
99

1010
# Needed for now because circleci doesn't use makefile yet
11-
if [ -z "$(which gotestsum)" ]; then
12-
GOTESTCOMMAND=${GOTESTCOMMAND:="go test"}
13-
else
14-
TEST_RESULTS=${TEST_RESULTS:="$(pwd)"}
15-
GOTESTCOMMAND=${GOTESTCOMMAND:="gotestsum --format testname --junitfile ${TEST_RESULTS}/results.xml --jsonfile ${TEST_RESULTS}/testresults.json --"}
16-
fi
17-
18-
echo "GOTESTCOMMAND will be: ${GOTESTCOMMAND}"
11+
TEST_RESULTS=${TEST_RESULTS:="$(pwd)"}
12+
GOTESTCOMMAND=${GOTESTCOMMAND:="go tool -modfile=${REPO_ROOT}/tool.mod gotestsum --format testname --junitfile ${TEST_RESULTS}/results.xml --jsonfile ${TEST_RESULTS}/testresults.json --"}
1913

2014
# If one or more -t <pattern> are specified, use GOTESTCOMMAND -run <pattern> for each
2115

tool.mod

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,24 @@ module github.com/algorand/go-algorand/tools
22

33
go 1.25.3
44

5-
tool golang.org/x/tools/cmd/stringer
5+
tool (
6+
golang.org/x/tools/cmd/stringer
7+
gotest.tools/gotestsum
8+
)
69

710
require (
11+
github.com/bitfield/gotestdox v0.2.2 // indirect
12+
github.com/dnephin/pflag v1.0.7 // indirect
13+
github.com/fatih/color v1.18.0 // indirect
14+
github.com/fsnotify/fsnotify v1.9.0 // indirect
15+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
16+
github.com/mattn/go-colorable v0.1.13 // indirect
17+
github.com/mattn/go-isatty v0.0.20 // indirect
818
golang.org/x/mod v0.29.0 // indirect
919
golang.org/x/sync v0.17.0 // indirect
20+
golang.org/x/sys v0.37.0 // indirect
21+
golang.org/x/term v0.35.0 // indirect
22+
golang.org/x/text v0.17.0 // indirect
1023
golang.org/x/tools v0.38.0 // indirect
24+
gotest.tools/gotestsum v1.13.0 // indirect
1125
)

tool.sum

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
1+
github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CDsnE=
2+
github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY=
3+
github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk=
4+
github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE=
5+
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
6+
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
7+
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
8+
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
9+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
10+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
11+
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
12+
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
13+
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
14+
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
15+
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
116
golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA=
217
golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w=
318
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
419
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
20+
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
21+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
22+
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
23+
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
24+
golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ=
25+
golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA=
26+
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
27+
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
528
golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ=
629
golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs=
30+
gotest.tools/gotestsum v1.13.0 h1:+Lh454O9mu9AMG1APV4o0y7oDYKyik/3kBOiCqiEpRo=
31+
gotest.tools/gotestsum v1.13.0/go.mod h1:7f0NS5hFb0dWr4NtcsAsF0y1kzjEFfAil0HiBQJE03Q=

0 commit comments

Comments
 (0)