Skip to content

Commit

Permalink
oops, others should not run everything
Browse files Browse the repository at this point in the history
  • Loading branch information
dnr committed Oct 25, 2024
1 parent 16039b9 commit 218a1bd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions tests/testcore/functional_test_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ var (
"TestAdvancedVisibilitySuite",
"TestClientMiscTestSuite",
}

FixedMatchingBehaviorNone = &matchingBehaviorOptions{}
)

// WithFxOptionsForService returns an Option which, when passed as an argument to setupSuite, will append the given list
Expand Down Expand Up @@ -522,7 +524,9 @@ func (s *FunctionalTestBase) GetNamespaceID(namespace string) string {
}

func (s *FunctionalTestBase) RunTestWithMatchingBehavior(subtest func()) {
if s.fixedMatchingBehavior != nil {
if s.fixedMatchingBehavior == FixedMatchingBehaviorNone {
s.T().Skipf("%s runs in a MB subtest", s.T().Name())
} else if s.fixedMatchingBehavior != nil {
s.runOneTestWithMatchingBehavior(subtest, s.fixedMatchingBehavior)
} else {
for _, mbo := range AllMatchingBehaviorOptions() {
Expand Down Expand Up @@ -578,7 +582,7 @@ func (s *FunctionalTestBase) SetFixedMatchingBehavior(mbo *matchingBehaviorOptio
}

func (s *FunctionalTestBase) SkipIfFixedMatchingBehavior() {
if s.fixedMatchingBehavior != nil {
if s.fixedMatchingBehavior != nil && s.fixedMatchingBehavior != FixedMatchingBehaviorNone {
s.T().Skipf("%s runs in 'Others' subtest", s.T().Name())
}
}
Expand Down
4 changes: 3 additions & 1 deletion tests/versioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ func TestVersioningSuite(t *testing.T) {
t.Run("Others", func(t *testing.T) {
// This sub-test runs all tests that do _not_ use RunTestWithMatchingBehavior.
t.Parallel()
suite.Run(t, new(VersioningIntegSuite))
s := new(VersioningIntegSuite)
s.SetFixedMatchingBehavior(testcore.FixedMatchingBehaviorNone)
suite.Run(t, s)
})
}

Expand Down

0 comments on commit 218a1bd

Please sign in to comment.