diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-23 23:24:42 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-23 23:24:42 +0300 |
| commit | 713e81daef9b01f24c4120c5e3e34d242f226797 (patch) | |
| tree | cf760da16df9655900a828de7b8b5afba0e9d10f /integrationtests | |
| parent | d56e16dc85ff3efe7b5865bd27e4804423a6e463 (diff) | |
chore: bump go.mod from go 1.25.0 to go 1.26.0
Update the Go version directive to match the local runtime (go1.26.3).
Also includes go mod tidy cleanup and unrelated test improvements.
Diffstat (limited to 'integrationtests')
| -rw-r--r-- | integrationtests/cli_test.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/integrationtests/cli_test.go b/integrationtests/cli_test.go index 5567ad1..017250e 100644 --- a/integrationtests/cli_test.go +++ b/integrationtests/cli_test.go @@ -6,11 +6,12 @@ package integrationtests import ( "os" "os/exec" + "path/filepath" "strings" "testing" ) -// buildBinary builds the gt binary to a temporary location. +// buildBinary builds the gt binary to a temporary location unique to each test. func buildBinary(t *testing.T) string { t.Helper() @@ -20,18 +21,17 @@ func buildBinary(t *testing.T) string { projectRoot = "/home/paul/git/gt" } - buildCmd := exec.Command("go", "build", "-o", "/tmp/gt-test", "./cmd/gt") + // Use t.TempDir() so each test gets its own binary path; Go cleans up automatically. + tmpDir := t.TempDir() + binaryPath := filepath.Join(tmpDir, "gt-test") + + buildCmd := exec.Command("go", "build", "-o", binaryPath, "./cmd/gt") buildCmd.Dir = projectRoot if err := buildCmd.Run(); err != nil { t.Fatalf("build failed: %v", err) } - t.Cleanup(func() { - // Explicitly ignore error return from os.Remove during cleanup - _ = os.Remove("/tmp/gt-test") - }) - - return "/tmp/gt-test" + return binaryPath } // TestCLIVersion tests that the version command works correctly. |
