Skip to content

Commit eb25308

Browse files
authored
fix: pin tools to fixed versions and fix govulncheck errors (#2718)
Tests are currently failing at HEAD. One reason is because our tests run all tools using `@latest` in all_test.go. This makes our test suite fragile because any upstream breaking change can cause failures without warning. Instead, pin each tool to a specific version and update them intentionally on a regular cadence. This will ensure more reproducible and predictable test outcomes. Another reason is because of errors detected by `govulncheck`, which are fixed by upgrading to go1.25.3.
1 parent b748028 commit eb25308

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

all_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ func hasValidHeader(path string, r io.Reader) (bool, error) {
160160
}
161161

162162
func TestGolangCILint(t *testing.T) {
163-
rungo(t, "run", "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest", "run")
163+
rungo(t, "run", "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.5.0", "run")
164164
}
165165

166166
func TestGoImports(t *testing.T) {
167-
cmd := exec.Command("go", "run", "golang.org/x/tools/cmd/goimports@latest", "-d", ".")
167+
cmd := exec.Command("go", "run", "golang.org/x/tools/cmd/goimports@v0.38.0", "-d", ".")
168168
var out bytes.Buffer
169169
cmd.Stdout = &out
170170
cmd.Stderr = &out
@@ -182,7 +182,7 @@ func TestGoModTidy(t *testing.T) {
182182
}
183183

184184
func TestGovulncheck(t *testing.T) {
185-
rungo(t, "run", "golang.org/x/vuln/cmd/govulncheck@latest", "./...")
185+
rungo(t, "run", "golang.org/x/vuln/cmd/govulncheck@v1.1.4", "./...")
186186
}
187187

188188
func TestGodocLint(t *testing.T) {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/googleapis/librarian
22

3-
go 1.25.0
3+
go 1.25.3
44

55
require (
66
cloud.google.com/go/artifactregistry v1.17.2

testdata/e2e-test.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
# Start with a Go base image
16-
FROM golang:1.25.0 AS builder
16+
FROM golang:1.25.3 AS builder
1717

1818
WORKDIR /app
1919

0 commit comments

Comments
 (0)