@@ -22,6 +22,7 @@ var RunTestsCmd = &cobra.Command{
2222 useRace , _ := cmd .Flags ().GetBool ("race" )
2323 outputPath , _ := cmd .Flags ().GetString ("output-json" )
2424 threshold , _ := cmd .Flags ().GetFloat64 ("threshold" )
25+ skipTests , _ := cmd .Flags ().GetStringSlice ("skip-tests" )
2526
2627 var testPackages []string
2728 if testPackagesJson != "" {
@@ -40,6 +41,7 @@ var RunTestsCmd = &cobra.Command{
4041 RunCount : runCount ,
4142 UseRace : useRace ,
4243 FailFast : threshold == 1.0 , // Fail test on first test run if threshold is 1.0
44+ SkipTests : skipTests ,
4345 }
4446
4547 testResults , err := runner .RunTests (testPackages )
@@ -84,12 +86,13 @@ var RunTestsCmd = &cobra.Command{
8486}
8587
8688func init () {
87- RunTestsCmd .Flags ().StringP ("project-path" , "r" , "." , "The path to the Go project. Default is the current directory. Useful for subprojects. " )
89+ RunTestsCmd .Flags ().StringP ("project-path" , "r" , "." , "The path to the Go project. Default is the current directory. Useful for subprojects" )
8890 RunTestsCmd .Flags ().String ("test-packages-json" , "" , "JSON-encoded string of test packages" )
8991 RunTestsCmd .Flags ().StringSlice ("test-packages" , nil , "Comma-separated list of test packages to run" )
9092 RunTestsCmd .Flags ().IntP ("run-count" , "c" , 1 , "Number of times to run the tests" )
9193 RunTestsCmd .Flags ().Bool ("race" , false , "Enable the race detector" )
9294 RunTestsCmd .Flags ().Bool ("fail-fast" , false , "Stop on the first test failure" )
9395 RunTestsCmd .Flags ().String ("output-json" , "" , "Path to output the test results in JSON format" )
9496 RunTestsCmd .Flags ().Float64 ("threshold" , 0.8 , "Threshold for considering a test as flaky" )
97+ RunTestsCmd .Flags ().StringSlice ("skip-tests" , nil , "Comma-separated list of test names to skip from running" )
9598}
0 commit comments