Skip to content

Commit

Permalink
use regex instead of glob for Exclude filter too
Browse files Browse the repository at this point in the history
  • Loading branch information
jasondborneman committed Jan 17, 2024
1 parent 14685f4 commit c47f65c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions example/weather/services/tester/run_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"sync"
"time"

"github.com/gobwas/glob"
"goa.design/clue/log"

gentester "goa.design/clue/example/weather/services/tester/gen/tester"
Expand Down Expand Up @@ -183,14 +182,11 @@ func (svc *Service) runTests(ctx context.Context, p *gentester.TesterPayload, te
for testName, test := range testMap {
wildcardMatch := false
for _, excludeTest := range p.Exclude {
var g glob.Glob
g, err := glob.Compile(excludeTest)
wildcardMatchThisTest, _, err := match(excludeTest, testName)
if err != nil {
_ = logError(ctx, err)
err = fmt.Errorf("wildcard glob [%s] did not compile: %v", excludeTest, err)
return nil, gentester.MakeWildcardCompileError(err)
}
wildcardMatch = wildcardMatch || g.Match(testName)
wildcardMatch = wildcardMatch || wildcardMatchThisTest
}
if !wildcardMatch {
testsToRun[testName] = test
Expand Down

0 comments on commit c47f65c

Please sign in to comment.