-
Notifications
You must be signed in to change notification settings - Fork 207
test: use gotestsum to retry only the failing test #1990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a798520
e189544
c93bfce
559772a
8f0950d
e934524
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,7 @@ test-deps: | |
| $(MAKE) -C ../demo plugin-build-ci | ||
|
|
||
| test: test-deps | ||
| gotestsum -f $(FORMAT) -- -ldflags=-extldflags=-Wl,-ld_classic $(test_params) -race $(test_target) | ||
| gotestsum $(gotestsum_params) --packages=$(test_target) -f $(FORMAT) -- -ldflags=-extldflags=-Wl,-ld_classic $(test_params) -race $(test_target) | ||
|
|
||
|
Comment on lines
+14
to
15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Avoid passing the package list twice & quote optional params
- gotestsum $(gotestsum_params) --packages=$(test_target) -f $(FORMAT) -- -ldflags=-extldflags=-Wl,-ld_classic $(test_params) -race $(test_target)
+ gotestsum "$(gotestsum_params)" --packages="$(test_target)" -f "$(FORMAT)" -- -ldflags=-extldflags=-Wl,-ld_classic $(test_params) -race🤖 Prompt for AI Agents |
||
| update-snapshot: | ||
| go test -update -race $(test_target) | ||
|
|
@@ -44,3 +44,9 @@ update-test-config: | |
|
|
||
| bump-deps: | ||
| ./bump-deps.sh | ||
|
|
||
| integration-tests: | ||
| $(MAKE) test test_params="-run '^Test[^(Flaky)]' --timeout=10m" test_target="./..." | ||
|
|
||
|
Comment on lines
+48
to
+50
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regex does not exclude “Flaky” tests – it matches only one extra rune
Go test (RE2) lacks negative look-ahead, so a common workaround is: - $(MAKE) test test_params="-run '^Test[^(Flaky)]' --timeout=10m" test_target="./..."
+ # run all tests whose name does **not** start with TestFlaky
+ $(MAKE) test test_params="-run '^Test([^F]|F[^l]|Fl[^a]|Fla[^k]|Flak[^y])' --timeout=10m" test_target="./..."Alternatively, move flaky tests into a separate package or use build tags for 🤖 Prompt for AI Agents |
||
| integration-tests-flaky: | ||
| $(MAKE) test gotestsum_params="--rerun-fails=5" test_params="-run '^TestFlaky' --timeout=10m -p 1 --parallel 10" test_target="./..." | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing spaces break YAML-lint & block merges
YAML-lint is already flagging these lines:
Remove the blanks to keep the pipeline green.
📝 Committable suggestion
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 142-142: trailing spaces
(trailing-spaces)
🤖 Prompt for AI Agents