@@ -25,6 +25,7 @@ var RunTestsCmd = &cobra.Command{
2525 outputPath , _ := cmd .Flags ().GetString ("output-json" )
2626 threshold , _ := cmd .Flags ().GetFloat64 ("threshold" )
2727 skipTests , _ := cmd .Flags ().GetStringSlice ("skip-tests" )
28+ printFailedTests , _ := cmd .Flags ().GetBool ("print-failed-tests" )
2829
2930 // Check if project dependencies are correctly set up
3031 if err := checkDependencies (projectPath ); err != nil {
@@ -62,7 +63,7 @@ var RunTestsCmd = &cobra.Command{
6263 failedTests := reports .FilterFailedTests (testResults , threshold )
6364 skippedTests := reports .FilterSkippedTests (testResults )
6465
65- if len (failedTests ) > 0 {
66+ if len (failedTests ) > 0 && printFailedTests {
6667 fmt .Printf ("PassRatio threshold for flaky tests: %.2f\n " , threshold )
6768 fmt .Printf ("%d failed tests:\n " , len (failedTests ))
6869 reports .PrintTests (failedTests , os .Stdout )
@@ -102,6 +103,7 @@ func init() {
102103 RunTestsCmd .Flags ().String ("output-json" , "" , "Path to output the test results in JSON format" )
103104 RunTestsCmd .Flags ().Float64 ("threshold" , 0.8 , "Threshold for considering a test as flaky" )
104105 RunTestsCmd .Flags ().StringSlice ("skip-tests" , nil , "Comma-separated list of test names to skip from running" )
106+ RunTestsCmd .Flags ().Bool ("print-failed-tests" , true , "Print failed test results to the console" )
105107}
106108
107109func checkDependencies (projectPath string ) error {
0 commit comments