-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
In CI, verify that PHPunit is actually running #50442
Conversation
f3ba127
to
a78aaff
Compare
Flaky tests detected in bbbb38f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4919659420
|
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.
This seems to work well.
The only thing I would say is that perhaps it makes sense for it to be included in the same step as the tests themselves. This doesn't seem like it will be a very common occurrence and so having a step feels like it might be superfluous in virtually all cases.
The main reason I did it is just so the script didn't have to be duplicated in both tests, though we could put it in a bash script. IMO, having an extra step doesn't really hurt even if it's superfluous :P |
What?
This PR adds a check to the unit test workflow which makes sure that PHPunit is executing correctly.
Why?
In #50411, we found that all PHPUnit suites on trunk were not running at all. However, this did not fail the test suite, which meant the issue was undetected for more than a week.
How?
In the PHPUnit github workflow, add a grep call which extracts the number of completed tests from a phpunit log file, and makes sure that at least 500 tests are passing. (This is about half of the current test suite, which seems reasonable when we mostly want to make sure we're
There are a few different scenarios for test output:
The grep command looks for a match for
OK (1120 tests
, and then extracts the number from that and checks that it's more than 500. There is no match in the first two conditions, only in the third.Testing Instructions
I tested this script in a bash script locally, but I'll also introduce revertable commits which cause an issue in CI so we can verify.
Testing Instructions for Keyboard
Screenshots or screencast