@@ -531,6 +531,39 @@ func TestFailedOutputs(t *testing.T) {
531531 }
532532}
533533
534+ func TestSkippedTests (t * testing.T ) {
535+ t .Parallel ()
536+
537+ runner := Runner {
538+ ProjectPath : "./" ,
539+ Verbose : true ,
540+ RunCount : 1 ,
541+ SelectedTestPackages : []string {flakyTestPackagePath },
542+ SelectTests : []string {"TestSkipped" }, // Known skipping test
543+ CollectRawOutput : true ,
544+ }
545+
546+ testReport , err := runner .RunTests ()
547+ require .NoError (t , err , "running tests should not produce an unexpected error" )
548+
549+ require .Equal (t , 1 , testReport .TestRunCount , "unexpected number of test runs" )
550+
551+ var testSkipResult * reports.TestResult
552+ for i := range testReport .Results {
553+ if testReport .Results [i ].TestName == "TestSkipped" {
554+ testSkipResult = & testReport .Results [i ]
555+ break
556+ }
557+ }
558+ require .NotNil (t , testSkipResult , "expected 'TestSkipped' result not found in report" )
559+
560+ // Check that the test was properly marked as skipped
561+ require .True (t , testSkipResult .Skipped , "test 'TestSkipped' should be marked as skipped" )
562+ require .Equal (t , 0 , testSkipResult .Failures , "test 'TestSkipped' should have no failures" )
563+ require .Equal (t , 0 , testSkipResult .Successes , "test 'TestSkipped' should have no successes" )
564+ require .Equal (t , 1 , testSkipResult .Skips , "test 'TestSkipped' should have exactly one skip recorded" )
565+ }
566+
534567func TestOmitOutputsOnSuccess (t * testing.T ) {
535568 t .Parallel ()
536569
0 commit comments