Skip to content
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

Merged
merged 6 commits into from
Nov 20, 2024

Conversation

bergundy
Copy link
Member

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?

  • Ran functional tests multiple times locally
  • Added unit tests to the runner

@bergundy bergundy requested a review from a team as a code owner November 19, 2024 00:27
tests/callbacks_test.go Outdated Show resolved Hide resolved
@@ -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) -- \
Copy link
Member Author

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.

Copy link
Member

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.

@bergundy bergundy requested a review from ychebotarev November 19, 2024 18:33
tools/testrunner/testrunner.go Show resolved Hide resolved
tools/testrunner/testrunner.go Show resolved Hide resolved
tools/testrunner/testrunner.go Show resolved Hide resolved
@bergundy bergundy enabled auto-merge (squash) November 20, 2024 01:01
@bergundy bergundy merged commit d88fbc9 into temporalio:main Nov 20, 2024
49 checks passed
@bergundy bergundy deleted the test-runner branch November 20, 2024 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants