Skip to content

Commit

Permalink
fixup! Pass go test flags to integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pchila committed Jul 24, 2023
1 parent d416f4b commit bf1213a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/testing/define/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,15 @@ func DetermineBatches(dir string, testFlags string, buildTags ...string) ([]Batc
if !filepath.IsAbs(dir) && !strings.HasPrefix(dir, "./") {
dir = "./" + dir
}
flags := strings.SplitN(testFlags, " ", -1)

// run 'go test' and collect the JSON output to be parsed
// #nosec G204 -- test function code, it will be okay
cmdArgs := []string{"test", "-v", "--tags", strings.Join(buildTags, ","), "-json"}
cmdArgs = append(cmdArgs, flags...)
if testFlags != "" {
flags := strings.Split(testFlags, " ")
cmdArgs = append(cmdArgs, flags...)
}

cmdArgs = append(cmdArgs, dir)
testCmd := exec.Command("go", cmdArgs...)
output, err := testCmd.Output()
Expand Down

0 comments on commit bf1213a

Please sign in to comment.