From 391bbc502e0630498f9f7c7b9d7413a1bb42f155 Mon Sep 17 00:00:00 2001 From: Alexandre Rodrigues Date: Sat, 3 Oct 2026 01:09:08 -0300 Subject: [PATCH] test(ignore): run race regression check in CI Run the ignore package with the race detector in the build-test workflow. Document that the concurrent root-pattern test needs -race because matching assertions can pass despite concurrent writes. Signed-off-by: Alexandre Rodrigues --- .github/workflows/build-test.yml | 2 ++ pkg/ignore/rules_test.go | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 9503674ed..b2bf21776 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -32,5 +32,7 @@ jobs: run: go mod tidy -diff - name: Run unit tests run: make test-coverage + - name: Test ignore rules with the race detector + run: go test -race ./pkg/ignore - name: Test build run: make build diff --git a/pkg/ignore/rules_test.go b/pkg/ignore/rules_test.go index 6b091f6da..310daca43 100644 --- a/pkg/ignore/rules_test.go +++ b/pkg/ignore/rules_test.go @@ -136,6 +136,7 @@ func parseString(str string) (*Rules, error) { } func TestIgnoreRootPatternConcurrent(t *testing.T) { + // Run with -race to detect concurrent writes even when matching results agree. rules, err := parseString("/root.txt") require.NoError(t, err) var workers sync.WaitGroup