From c47f65c1f2daa03fed5e0a4e8ebb037f3d35243b Mon Sep 17 00:00:00 2001 From: jasondborneman Date: Wed, 17 Jan 2024 09:32:29 -0500 Subject: [PATCH] use regex instead of glob for Exclude filter too --- example/weather/services/tester/run_tests.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/example/weather/services/tester/run_tests.go b/example/weather/services/tester/run_tests.go index 2f429ed..2a0dd59 100644 --- a/example/weather/services/tester/run_tests.go +++ b/example/weather/services/tester/run_tests.go @@ -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" @@ -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