Skip to content

Commit 1e4204c

Browse files
authored
DX-377 Refactor Flakeguard: Separate runner, executor, and parser concerns (#1776)
* wip refactoring * fix * Enhance command execution in Flakeguard: capture stdout and stderr separately, improve error handling, and log absolute paths for temporary files. * Use configs * Refactor panic and race attribution functions in Flakeguard: update regex patterns for improved accuracy, change function names to exported versions, and enhance error handling for better clarity in failure cases. * Add more tests * Add integration tests for the runner package in Flakeguard * fix go test * simplify makefile * Add unit tests for the runner package in Flakeguard: implement mock executors and parsers, and cover various scenarios including success, failure, and rerun cases. * more refactoring * refactor cmd/run.go * Handle command-line-arguments when go test <file> is used * cleanup comments * Add unit test for parser to verify handling of parent failures in subtests
1 parent fba09e6 commit 1e4204c

File tree

13 files changed

+3546
-2891
lines changed

13 files changed

+3546
-2891
lines changed

tools/flakeguard/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.PHONY: test_unit
22
test_unit:
3-
go list ./... | grep -v 'example_test_package' | xargs go test -timeout 5m -json -cover -covermode=count -coverprofile=unit-test-coverage.out 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci
3+
go test ./... -timeout 5m -json -cover -covermode=count -coverprofile=unit-test-coverage.out 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci
44

55
.PHONY: test
66
test:
77
go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
88
set -euo pipefail
9-
go list ./... | grep -v 'example_test_package' | xargs go test -json -cover -coverprofile unit-test-coverage.out -v 2>&1 | tee /tmp/gotest.log | gotestfmt
9+
go test ./... -json -cover -coverprofile unit-test-coverage.out -v 2>&1 | tee /tmp/gotest.log | gotestfmt
1010

1111
.PHONY: test-package
1212
test-package:
@@ -16,7 +16,7 @@ test-package:
1616

1717
.PHONY: test-race
1818
test-race:
19-
go list ./... | grep -v 'example_test_package' | xargs go test -count=1 -race
19+
go test ./... -count=1 -race
2020

2121
.PHONY: bench
2222
bench:

0 commit comments

Comments
 (0)