Skip to content

Commit

Permalink
Upgrade the Go tools to latest ones (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
cardil authored Sep 19, 2023
1 parent 0bb79ff commit 38316f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ function report_go_test() {
logfile="${logfile/.xml/.jsonl}"
echo "Running go test with args: ${go_test_args[*]}"
local gotest_retcode=0
go_run gotest.tools/gotestsum@v1.8.0 \
go_run gotest.tools/gotestsum@v1.10.1 \
--format "${GO_TEST_VERBOSITY:-testname}" \
--junitfile "${xml}" \
--junitfile-testsuite-name relative \
Expand All @@ -510,14 +510,14 @@ function report_go_test() {
echo "Test log (JSONL) written to ${logfile}"

ansilog="${logfile/.jsonl/-ansi.log}"
go_run github.com/haveyoudebuggedit/gotestfmt/v2/cmd/gotestfmt@v2.3.1 \
go_run github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@v2.5.0 \
-input "${logfile}" \
-showteststatus \
-nofail > "$ansilog"
echo "Test log (ANSI) written to ${ansilog}"

htmllog="${logfile/.jsonl/.html}"
go_run github.com/buildkite/terminal-to-html/v3/cmd/terminal-to-html@v3.6.1 \
go_run github.com/buildkite/terminal-to-html/v3/cmd/terminal-to-html@v3.9.1 \
--preview < "$ansilog" > "$htmllog"
echo "Test log (HTML) written to ${htmllog}"

Expand Down Expand Up @@ -793,15 +793,15 @@ function update_licenses() {
local dst=$1
local dir=$2
shift
go_run github.com/google/go-licenses@v1.2.1 \
go_run github.com/google/go-licenses@v1.6.0 \
save "${dir}" --save_path="${dst}" --force || \
{ echo "--- FAIL: go-licenses failed to update licenses"; return 1; }
}

# Run go-licenses to check for forbidden licenses.
function check_licenses() {
# Check that we don't have any forbidden licenses.
go_run github.com/google/go-licenses@v1.2.1 \
go_run github.com/google/go-licenses@v1.6.0 \
check "${REPO_ROOT_DIR}/..." || \
{ echo "--- FAIL: go-licenses failed the license check"; return 1; }
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/presubmit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestMainFunc(t *testing.T) {
contains("Unit tests for knative.dev/hack/schema"),
contains("Unit tests for knative.dev/hack"),
contains("Running go test with args: -short -race -count 1 ./..."),
contains("go run gotest.tools/gotestsum@v1.8.0 --format testname --junitfile"),
contains("go run gotest.tools/gotestsum@v1.10.1 --format testname --junitfile"),
contains("-- -short -race -count 1 ./..."),
contains("UNIT TESTS PASSED"),
},
Expand Down
2 changes: 1 addition & 1 deletion test/unit/update_deps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestUpdateDeps(t *testing.T) {
contains("Removing unwanted vendor files"),
contains("go mod tidy"),
contains("go mod vendor"),
contains("go run github.com/google/go-licenses@v1.2.1 save ./... " +
contains("go run github.com/google/go-licenses@v1.6.0 save ./... " +
"--save_path=third_party/VENDOR-LICENSE --force"),
},
}, {
Expand Down

0 comments on commit 38316f2

Please sign in to comment.