You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
log.Fatal().Err(err).Msg("Error running custom test command")
83
+
}
84
+
} else {
85
+
// Otherwise, use the normal go test approach
86
+
testReport, err=testRunner.RunTests()
87
+
iferr!=nil {
88
+
log.Fatal().Err(err).Msg("Error running tests")
89
+
}
73
90
}
74
91
75
92
// Save the test results in JSON format
@@ -108,6 +125,9 @@ func init() {
108
125
RunTestsCmd.Flags().StringP("project-path", "r", ".", "The path to the Go project. Default is the current directory. Useful for subprojects")
109
126
RunTestsCmd.Flags().String("test-packages-json", "", "JSON-encoded string of test packages")
110
127
RunTestsCmd.Flags().StringSlice("test-packages", nil, "Comma-separated list of test packages to run")
128
+
RunTestsCmd.Flags().StringArray("test-cmd", nil,
129
+
"Optional custom test command (e.g. 'go run e2e_test.go -someflag'), which must produce go test -json output.",
130
+
)
111
131
RunTestsCmd.Flags().Bool("run-all-packages", false, "Run all test packages in the project. This flag overrides --test-packages and --test-packages-json")
112
132
RunTestsCmd.Flags().IntP("run-count", "c", 1, "Number of times to run the tests")
113
133
RunTestsCmd.Flags().Duration("timeout", 0, "Passed on to the 'go test' command as the -timeout flag")
0 commit comments