Skip to content

Commit

Permalink
Merge branch 'main' into hsiwik/tags
Browse files Browse the repository at this point in the history
  • Loading branch information
theseion authored Jun 19, 2024
2 parents cee1875 + c33cb00 commit d2fde45
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions runner/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ func (s *runTestSuite) TestRunTests_Run() {
ShowTime: true,
}, s.out)
s.Require().NoError(err)
s.Len(res.Stats.Success, 5, "verbose and execute all failed")
s.Len(res.Stats.Skipped, 0, "verbose and execute all failed")
s.Equal(res.Stats.TotalFailed(), 0, "verbose and execute all failed")
})

Expand All @@ -285,23 +287,29 @@ func (s *runTestSuite) TestRunTests_Run() {
Include: regexp.MustCompile("0*"),
}, s.out)
s.Require().NoError(err)
s.Len(res.Stats.Success, 5, "do not show time and execute all failed")
s.Len(res.Stats.Skipped, 0, "do not show time and execute all failed")
s.Equal(res.Stats.TotalFailed(), 0, "do not show time and execute all failed")
})

s.Run("execute only test 008 but exclude all", func() {
s.Run("execute only test 8 but exclude all", func() {
res, err := Run(s.cfg, s.ftwTests, RunnerConfig{
Include: regexp.MustCompile("008"),
Include: regexp.MustCompile("-8$"), // test ID is matched in format `<ruleId>-<testId>`
Exclude: regexp.MustCompile("0*"),
}, s.out)
s.Require().NoError(err)
s.Equal(res.Stats.TotalFailed(), 0, "do not show time and execute all failed")
s.Len(res.Stats.Success, 1, "execute only test 008 but exclude all")
s.Len(res.Stats.Skipped, 4, "execute only test 008 but exclude all")
s.Equal(res.Stats.TotalFailed(), 0, "execute only test 008 but exclude all")
})

s.Run("exclude test 010", func() {
s.Run("exclude test 10", func() {
res, err := Run(s.cfg, s.ftwTests, RunnerConfig{
Exclude: regexp.MustCompile("010"),
Exclude: regexp.MustCompile("-10$"), // test ID is matched in format `<ruleId>-<testId>`
}, s.out)
s.Require().NoError(err)
s.Len(res.Stats.Success, 4, "failed to exclude test")
s.Len(res.Stats.Skipped, 1, "failed to exclude test")
s.Equal(res.Stats.TotalFailed(), 0, "failed to exclude test")
})

Expand All @@ -325,11 +333,13 @@ func (s *runTestSuite) TestRunTests_Run() {

s.Run("test exceptions 1", func() {
res, err := Run(s.cfg, s.ftwTests, RunnerConfig{
Include: regexp.MustCompile("1*"),
Exclude: regexp.MustCompile("0*"),
Include: regexp.MustCompile("-1.*"),
Exclude: regexp.MustCompile("-0.*"),
Output: output.Quiet,
}, s.out)
s.Require().NoError(err)
s.Len(res.Stats.Success, 4, "failed to test exceptions")
s.Len(res.Stats.Skipped, 1, "failed to test exceptions")
s.Equal(res.Stats.TotalFailed(), 0, "failed to test exceptions")
})
}
Expand Down

0 comments on commit d2fde45

Please sign in to comment.