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 <alexandre3ylf@gmail.com>
pull/32658/head
Alexandre Rodrigues 13 hours ago
parent 3ff4bec535
commit 391bbc502e

@ -32,5 +32,7 @@ jobs:
run: go mod tidy -diff run: go mod tidy -diff
- name: Run unit tests - name: Run unit tests
run: make test-coverage run: make test-coverage
- name: Test ignore rules with the race detector
run: go test -race ./pkg/ignore
- name: Test build - name: Test build
run: make build run: make build

@ -136,6 +136,7 @@ func parseString(str string) (*Rules, error) {
} }
func TestIgnoreRootPatternConcurrent(t *testing.T) { func TestIgnoreRootPatternConcurrent(t *testing.T) {
// Run with -race to detect concurrent writes even when matching results agree.
rules, err := parseString("/root.txt") rules, err := parseString("/root.txt")
require.NoError(t, err) require.NoError(t, err)
var workers sync.WaitGroup var workers sync.WaitGroup

Loading…
Cancel
Save