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
go test -timeout 5m -json -cover -covermode=count -coverprofile=unit-test-coverage.out ./... 2>&1| tee /tmp/gotest.log | gotestloghelper -ci
3
+
go list ./... | grep -v 'example_test_package'| xargs go test -timeout 5m -json -cover -covermode=count -coverprofile=unit-test-coverage.out 2>&1| tee /tmp/gotest.log | gotestloghelper -ci
4
+
5
+
.PHONY: test
6
+
test:
7
+
go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
8
+
set -euo pipefail
9
+
go list ./... | grep -v 'example_test_package'| xargs go test -json -cover -coverprofile unit-test-coverage.out -v 2>&1| tee /tmp/gotest.log | gotestfmt
@@ -45,10 +46,9 @@ var AggregateResultsCmd = &cobra.Command{
45
46
}
46
47
47
48
funcinit() {
48
-
AggregateResultsCmd.Flags().String("results-path", "", "Path to the folder containing JSON test result files")
49
-
AggregateResultsCmd.Flags().String("output-results", "./results.json", "Path to output the aggregated or filtered test results in JSON format")
50
-
AggregateResultsCmd.Flags().String("output-logs", "", "Path to output the filtered test logs in JSON format")
51
-
AggregateResultsCmd.Flags().Float64("threshold", 0.8, "Threshold for considering a test as failed (used with --filter-failed)")
52
-
AggregateResultsCmd.Flags().Float64("min-pass-ratio", 0.001, "Minimum pass ratio for considering a test as flaky (used with --filter-failed)")
53
-
AggregateResultsCmd.Flags().Bool("filter-failed", false, "If true, filter and output only failed tests based on the threshold")
49
+
AggregateResultsCmd.Flags().StringVarP(&resultsFolderPath, "results-path", "p", "", "Path to the folder containing JSON test result files")
50
+
AggregateResultsCmd.Flags().StringVarP(&outputResultsPath, "output-results", "o", "./results.json", "Path to output the aggregated or filtered test results in JSON format")
51
+
AggregateResultsCmd.Flags().StringVarP(&outputLogsPath, "output-logs", "l", "", "Path to output the filtered test logs in JSON format")
52
+
AggregateResultsCmd.Flags().Float64VarP(&maxPassRatio, "max-pass-ratio", "m", 1.0, "The maximum (non-inclusive) pass ratio threshold for a test to be considered a failure. Any tests below this pass rate will be considered flaky.")
53
+
AggregateResultsCmd.Flags().BoolVarP(&filterFailed, "filter-failed", "f", false, "If true, filter and output only failed tests based on the max-pass-ratio threshold")
log.Fatalf("Error writing test results to file: %v", err)
85
84
}
86
85
fmt.Printf("All test results saved to %s\n", outputPath)
@@ -104,10 +103,9 @@ func init() {
104
103
RunTestsCmd.Flags().Bool("race", false, "Enable the race detector")
105
104
RunTestsCmd.Flags().Bool("fail-fast", false, "Stop on the first test failure")
106
105
RunTestsCmd.Flags().String("output-json", "", "Path to output the test results in JSON format")
107
-
RunTestsCmd.Flags().Float64("threshold", 0.8, "Threshold for considering a test as flaky")
108
106
RunTestsCmd.Flags().StringSlice("skip-tests", nil, "Comma-separated list of test names to skip from running")
109
107
RunTestsCmd.Flags().Bool("print-failed-tests", true, "Print failed test results to the console")
110
-
RunTestsCmd.Flags().Float64("min-pass-ratio", 0.001, "Minimum pass ratio for considering a test as flaky. Used to distinguish between tests that are truly flaky (with inconsistent results) and those that are consistently failing.")
108
+
RunTestsCmd.Flags().Float64("max-pass-ratio", 1.0, "The maximum (non-inclusive) pass ratio threshold for a test to be considered a failure. Any tests below this pass rate will be considered flaky.")
0 commit comments