-
Notifications
You must be signed in to change notification settings - Fork 873
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
Create test-runner command for rerunning tests #6842
Conversation
@@ -405,13 +402,13 @@ prepare-coverage-test: $(GOTESTSUM) $(TEST_OUTPUT_ROOT) | |||
|
|||
unit-test-coverage: prepare-coverage-test | |||
@printf $(COLOR) "Run unit tests with coverage..." | |||
$(GOTESTSUM) --rerun-fails=$(FAILED_TEST_RETRIES) --rerun-fails-max-failures=10 --junitfile $(NEW_REPORT) --packages $(UNIT_TEST_DIRS) -- \ | |||
go run ./cmd/tools/test-runner $(GOTESTSUM) -retries $(FAILED_TEST_RETRIES) --junitfile $(NEW_REPORT) --packages $(UNIT_TEST_DIRS) -- \ |
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.
I think there's a way to pre-build this in our CI setup. I can look into that if anyone thinks using go run
would be an issue.
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.
Anything you build in pre-build-functional-test-coverage
will go into the per-run cache. That won't cover the final binary (I think) but the object files. I wouldn't worry about it, though, the compile+link time should be negligible.
ce17fd1
to
04fca19
Compare
What changed?
Added a test-runner command for rerunning tests and modified the Makefile to use the new command.
Why?
gotestsum is supposed to do this but it is buggy: gotestyourself/gotestsum#423.
If this runner works well we can stop using gotestsum if we choose but I would probably recommend using it since it claims to do exactly what we need.
An alternative would be to either generate test reports using JSON output or using https://github.com/jstemmer/go-junit-report to create junit XML reports.
How did you test it?