Skip to content

feat: add support for PHPUnit filtering in test worker#748

Open
xepozz wants to merge 2 commits into
masterfrom
feature/test-filter-scoping
Open

feat: add support for PHPUnit filtering in test worker#748
xepozz wants to merge 2 commits into
masterfrom
feature/test-filter-scoping

Conversation

@xepozz
Copy link
Copy Markdown
Collaborator

@xepozz xepozz commented May 14, 2026

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:

  • PHPUnit discovers which tests it will run
  • we listen it and run RR with specific classes
  • RR worker filters only needed classes and creates only needed tasks queue

Moved logic from bootstrap.php into PHPUnit extension to make it able to catch the discovered tests easily.

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

@xepozz xepozz requested review from a team, roxblnfk and wolfy-j as code owners May 14, 2026 16:04
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +45 to +47
foreach ($event->testSuite()->tests() as $test) {
if ($test instanceof TestMethod && \str_starts_with($test->className(), self::NAMESPACE_PREFIX)) {
$classNames[] = $test->className();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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.

1 participant