Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧹 Upgrade the Go tools to latest ones #312

Merged
merged 1 commit into from
Sep 19, 2023
Merged
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
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