feat: add support for PHPUnit filtering in test worker#748
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86584335a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| foreach ($event->testSuite()->tests() as $test) { | ||
| if ($test instanceof TestMethod && \str_starts_with($test->className(), self::NAMESPACE_PREFIX)) { | ||
| $classNames[] = $test->className(); |
There was a problem hiding this comment.
Recurse into nested PHPUnit suites
When running the configured acceptance suites (for example the existing composer test:accept* commands use --testsuite), PHPUnit reports a hierarchical suite whose immediate children can be nested/per-class TestSuite objects rather than TestMethod instances. This one-level loop then leaves $selectedTestClasses empty, notify() returns without initializing ContainerFacade/Temporal/RoadRunner after tests/Acceptance/bootstrap.php was removed, and the first acceptance test fails before it can run. Walk the nested suites (or collect tests from the filtered suite recursively) before deciding there are no acceptance tests.
Useful? React with 👍 / 👎.
What was changed
Why?
This PR allows NOT to create task queues for each test (each test = separate task queue) when test a set of tests:
Moved logic from
bootstrap.phpinto PHPUnit extension to make it able to catch the discovered tests easily.Checklist
Closes
How was this tested: