Ultimate-Multisite / Ultimate-Multisite/ultimate-multisite
fix(ci): PHPUnit batching silently omits most tests on PHP 8.2, 8.4 and 8.5
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 214
- Forks
- 86
- Avg merge
- 5h 29m
- Merged PRs (30d)
- 60
Description
Confirmed CI false-green: PHPUnit 9 ignores most filenames in each batch
Priority: high. The PHP 8.2, 8.4, and 8.5 matrix jobs silently omit most test files while reporting success. This is test-discovery omission, not PHPUnit's explicit skipped-test status.
Evidence
Observed on PR #1838, head a20cb1cea4cf48092d132907d823bb4b248483c6, Unit & Integration Tests run:
https://github.com/Ultimate-Multisite/ultimate-multisite/actions/runs/34410684512
Each completed non-coverage job contains nine PHPUnit summaries with test counts 7, 2, 5, 9, 15, 4, 62, 7, 2, totaling 113 tests / 224 assertions, taking only about 12–13 seconds in its actual PHPUnit step.
- PHP 8.2 job: 102664312071
- PHP 8.4 job: 102664312004
- PHP 8.5 job: 102664312006
The workflow .github/workflows/tests.yml:110-116 executes:
find tests -name '*_Test.php' -type f -print0 | xargs -0 -r -n 50 vendor/bin/phpunit
The installed PHPUnit is 9.6.34. Its CLI parser (vendor/phpunit/phpunit/src/TextUI/CliArguments/Builder.php:235) assigns $argument = $options[1][0]: only the first positional test path is selected. Passing 50 independent filenames does not create a 50-file suite. The comment claiming every file runs is false.
PHP 8.3 instead runs configured full-suite PHPUnit with Xdebug coverage (tests.yml:118-123), explaining much of the timing asymmetry. Do not reduce its coverage to conceal the discrepancy. At inspection time it was still in the coverage test step, so no final PHP 8.3 counts are claimed here.
Implementation scope
- Fix non-coverage test batching in
.github/workflows/tests.ymlusing supported PHPUnit 9 suite discovery: one file per invocation as a minimal correctness fix, or explicit XML suites for bounded multi-file batches if overhead makes that necessary. - Preserve configured includes/excludes, test suffixes, failure exit propagation, and the original memory-bound execution intent. Inspect
phpunit.xml.distbefore choosing discovery rules; do not assume the current find glob equals configured discovery. - Add an execution/discovery accounting guard so silently running a small fraction of the intended suite cannot go green again. Keep it proportional rather than adding a new CI framework.
- Include new tests in the expected set; specifically ensure a test file in a non-first batch position is actually executed.
- Scope coverage optimization separately; do not weaken assertions or ignore newly exposed failures. Check pipeline failure propagation for existing shell defaults rather than assuming it is broken.
Verification
Use at least two small test files whose second file intentionally fails in a disposable fixture to prove the runner cannot ignore non-first entries. Then verify expected versus executed file/test counts against normal PHPUnit discovery on the repository, and run the repaired matrix for PHP 8.2–8.5. Keep memory bounded and ensure any batch failure fails the job. No edits to vendor parser are needed.
Deduplication: checked open PHPUnit issues and PR #1806's file list. Existing bootstrap/deprecation and quality-baseline work does not fix this workflow command. Earlier batching PR #1792 introduced the intended memory workaround; inspect its history for context rather than treating the current small green runs as full compatibility evidence.
aidevops.sh v3.32.317 plugin for OpenCode v1.18.30 with gpt-6-astra spent 8h 7m and 637,995 tokens on this with the user in an interactive session.
CI Repair Feedback (from PR #1842)
The previous worker's PR #1842 had terminal failed CI checks. A head-bound
finalizer is routing this issue for redispatch. The next worker should address these failures.
Terminal failed checks
- PHP 8.4: failure — check URL — primary failing-check evidence
- PHP 8.5: failure — check URL — primary failing-check evidence
- PHP 8.2: failure — check URL — primary failing-check evidence
Worker guidance
- Recover the previous PR branch/commits and continue that work; do not restart from scratch.
- Read every terminal check URL above and preserve the accumulated evidence.
- Rebase the recovered work onto current
origin/main, then fix the code rather than weakening CI. - Run every listed local check and create the replacement PR from the recovered branch.
Routed by deterministic merge pass (pulse-merge.sh).
In-place repair fallback
- Reason: the bounded PR-branch repair session exhausted its retry budget
- Retry: re-run the deterministic merge pass after restoring access to branch
feature/auto-20260909-173645-gh1839; keep PR #1842 open until that retry is impossible.
In-place repair attempt outcomes
- Attempt 1: result=
launch_failed; failure_reason=worktree_failed; next_action=retry_launch - Attempt 2: result=
launch_failed; failure_reason=worktree_failed; next_action=retry_launch
CI Repair Feedback (from PR #1843)
The previous worker's PR #1843 had terminal failed CI checks. A head-bound
finalizer is routing this issue for redispatch. The next worker should address these failures.
Terminal failed checks
- PHP 8.5: failure — check URL — primary failing-check evidence
- PHP 8.4: failure — check URL — primary failing-check evidence
- PHP 8.2: failure — check URL — primary failing-check evidence
Worker guidance
- Recover the previous PR branch/commits and continue that work; do not restart from scratch.
- Read every terminal check URL above and preserve the accumulated evidence.
- Rebase the recovered work onto current
origin/main, then fix the code rather than weakening CI. - Run every listed local check and create the replacement PR from the recovered branch.
Routed by deterministic merge pass (pulse-merge.sh).
In-place repair fallback
- Reason: the bounded PR-branch repair session exhausted its retry budget
- Retry: re-run the deterministic merge pass after restoring access to branch
feature/auto-20260909-173645-gh1839; keep PR #1843 open until that retry is impossible.
In-place repair attempt outcomes
- Attempt 1: result=
process_exit; failure_reason=headless_outcome_missing; next_action=inspect_terminal_outcome - Attempt 2: result=
process_exit; failure_reason=headless_outcome_missing; next_action=inspect_terminal_outcome
CI Repair Feedback (from PR #1844)
The previous worker's PR #1844 had terminal failed CI checks. A head-bound
finalizer is routing this issue for redispatch. The next worker should address these failures.
Terminal failed checks
- PHP 8.4: failure — check URL — primary failing-check evidence
- PHP 8.2: failure — check URL — primary failing-check evidence
- PHP 8.5: failure — check URL — primary failing-check evidence
Worker guidance
- Recover the previous PR branch/commits and continue that work; do not restart from scratch.
- Read every terminal check URL above and preserve the accumulated evidence.
- Rebase the recovered work onto current
origin/main, then fix the code rather than weakening CI. - Run every listed local check and create the replacement PR from the recovered branch.
Routed by deterministic merge pass (pulse-merge.sh).
In-place repair fallback
- Reason: the bounded PR-branch repair session exhausted its retry budget
- Retry: re-run the deterministic merge pass after restoring access to branch
feature/auto-20260909-173645-gh1839; keep PR #1844 open until that retry is impossible.
In-place repair attempt outcomes
- Attempt 1: result=
process_exit; failure_reason=headless_outcome_missing; next_action=inspect_terminal_outcome - Attempt 2: result=
process_exit; failure_reason=headless_outcome_missing; next_action=inspect_terminal_outcome
CI Repair Feedback (from PR #1845)
The previous worker's PR #1845 had terminal failed CI checks. A head-bound
finalizer is routing this issue for redispatch. The next worker should address these failures.
Terminal failed checks
- PHP 8.4: failure — check URL — primary failing-check evidence
- PHP 8.2: failure — check URL — primary failing-check evidence
Worker guidance
- Recover the previous PR branch/commits and continue that work; do not restart from scratch.
- Read every terminal check URL above and preserve the accumulated evidence.
- Rebase the recovered work onto current
origin/main, then fix the code rather than weakening CI. - Run every listed local check and create the replacement PR from the recovered branch.
Routed by deterministic merge pass (pulse-merge.sh).
In-place repair fallback
- Reason: the bounded PR-branch repair session exhausted its retry budget
- Retry: re-run the deterministic merge pass after restoring access to branch
feature/auto-20260909-173645-gh1839; keep PR #1845 open until that retry is impossible.
In-place repair attempt outcomes
- Attempt 1: result=
process_exit; failure_reason=headless_outcome_missing; next_action=inspect_terminal_outcome - Attempt 2: result=
process_exit; failure_reason=headless_outcome_missing; next_action=inspect_terminal_outcome
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with .github/workflows/tests.yml:110-123 and inspect phpunit.xml.dist plus the recovered PR branches and terminal checks for PRs #1842–#1845. Verify PHPUnit 9 discovery with two disposable test files, including a failing non-first entry, then compare expected and executed counts and run the PHP 8.2–8.5 matrix. Done means bounded batches execute the configured suite, propagate failures, and preserve coverage behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, php
- Domain
- ci-cd, devops, testing-qa
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100