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.
This commit is contained in:
Denis Bilenko 2025-01-15 10:45:57 +01:00 committed by GitHub
parent 25f8ee8d66
commit 5592fa889e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 1 deletions

View File

@ -265,10 +265,23 @@ func BuildCLI(t *testing.T, cwd, coverDir string) string {
} }
start := time.Now() start := time.Now()
args := []string{"go", "build", "-mod", "vendor", "-o", execPath} args := []string{
"go", "build",
"-mod", "vendor",
"-o", execPath,
}
if coverDir != "" { if coverDir != "" {
args = append(args, "-cover") 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 := exec.Command(args[0], args[1:]...)
cmd.Dir = ".." cmd.Dir = ".."
out, err := cmd.CombinedOutput() out, err := cmd.CombinedOutput()