Skip to content

fix(nx): exclude abstract test base classes from Nx integration test suite#381

Merged
rhoerr merged 1 commit into
mage-os:mainfrom
thebraziliandeveloper:fix/nx-abstract-test-class-warnings
May 27, 2026
Merged

fix(nx): exclude abstract test base classes from Nx integration test suite#381
rhoerr merged 1 commit into
mage-os:mainfrom
thebraziliandeveloper:fix/nx-abstract-test-class-warnings

Conversation

@thebraziliandeveloper
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #375, porting the same fix to the Nx integration test setup.

PHPUnit 12 emits a runner warning for every abstract class whose filename ends in Test.php, causing exit code 2 which Nx treats as failure even when all real tests pass. This was surfaced while working on mage-os/mageos-magento2#213.

At setup time, find discovers all Abstract*Test.php / *AbstractTest.php files in the testsuite directory and awk injects <exclude> entries into phpunit.xml.dist for the Magento Integration Tests Real Suite. The patched file is saved into the project cache so all matrix runners pick it up without repeating the work.

Test plan

  • Trigger the Nx integration test workflow against a PR that affects modules with no abstract test files — confirm exit 0
  • Trigger against a PR affecting modules whose testsuite directory contains abstract test base classes — confirm exit 0 and no PHPUnit runner warnings in the output

…setup time

PHPUnit 12 emits a runner warning for every abstract class whose filename
ends in Test.php, causing exit code 2 which Nx treats as failure even when
all real tests pass.

At setup time, use find to discover all Abstract*Test.php / *AbstractTest.php
files in the testsuite directory and inject <exclude> entries into
phpunit.xml.dist for the Magento Integration Tests Real Suite. This mirrors
the find-based filter added to the full-suite workflow in mage-os#375.

The patched phpunit.xml.dist is included in the project cache so all
matrix runners pick it up without repeating the work.
Copy link
Copy Markdown
Contributor

@rhoerr rhoerr left a comment

Choose a reason for hiding this comment

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

LGTM

@rhoerr rhoerr merged commit 76da81b into mage-os:main May 27, 2026
1 check passed
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.

2 participants