From 5592fa889e8a4c5c2a48ccfbd388180e23b93c58 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Wed, 15 Jan 2025 10:45:57 +0100 Subject: [PATCH] acceptance: add -buildvcs=false when building on Windows (#2148) I get an error on my local Windows otherwise: error obtaining VCS status: exit status 128 On CI this does not make a difference. --- acceptance/acceptance_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/acceptance/acceptance_test.go b/acceptance/acceptance_test.go index c7f40d11e..fc486e2cc 100644 --- a/acceptance/acceptance_test.go +++ b/acceptance/acceptance_test.go @@ -265,10 +265,23 @@ func BuildCLI(t *testing.T, cwd, coverDir string) string { } start := time.Now() - args := []string{"go", "build", "-mod", "vendor", "-o", execPath} + args := []string{ + "go", "build", + "-mod", "vendor", + "-o", execPath, + } + if coverDir != "" { args = append(args, "-cover") } + + if runtime.GOOS == "windows" { + // Get this error on my local Windows: + // error obtaining VCS status: exit status 128 + // Use -buildvcs=false to disable VCS stamping. + args = append(args, "-buildvcs=false") + } + cmd := exec.Command(args[0], args[1:]...) cmd.Dir = ".." out, err := cmd.CombinedOutput()