fix(composer): make test:all a real gate — the guard made it incapable of failing - #2330
Merged
rubenvdlinde merged 1 commit intoAug 4, 2026
Merged
Conversation
The 'if [ -f vendor/bin/phpunit ]' guard turned a missing vendor install into an exit-0 green, so check:strict/check:full could print ALL CHECKS PASSED without ever running a test. Composer already prepends vendor/bin to PATH, so the guard protected nothing it should protect. test:unit and test:all now invoke phpunit directly (15964 tests, green). test:integration/test:db/test:service genuinely need a booted Nextcloud server tree, so they keep a self-documenting guard that names the reason instead of a generic 'skipping...'.
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| composer | ✅ | ✅ 173/173 | |||
| npm | ✅ | ✅ 713/713 | |||
| PHPUnit | ✅ | ||||
| Newman | ✅ | ||||
| Playwright | ✅ |
Quality workflow — 2026-08-04 09:19 UTC
Download the full PDF report from the workflow artifacts.
Contributor
Author
|
Merging with Verified at job level, not from the rollup: 0 failures, 0 cancelled, on a run from today. (A |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every
test:*script was wrapped in a guard that makes the script incapable of failing when phpunit is absent:The guard is the defect, not a fix for one. Composer already prepends
vendor/bintoPATHwhen it runs a script, so a plain./vendor/bin/phpunitresolves whenever phpunit is installed. All the guard adds is: "you forgotcomposer install" becomes a silent green.The amplifier is
check:strict/check:full:A
test:allthat always exits 0 makesALL CHECKS PASSEDa claim about five tools and a no-op.Measured, verbatim
Old form, no
vendor/bin/phpunitpresent:New form, same conditions:
State of the suite before this change
Green. Measured on
origin/developmentin a bare PHP 8.4.22 container (no Nextcloud),OPENREGISTER_TEST_NC_ROOT=/var/www/html:15 964 tests were reachable and passing the whole time — the guard was not hiding failures here, it was standing between CI and a working gate.
Changes
test:unitandtest:allnow invoke phpunit directly. Flags and the--testsuite=variants are preserved exactly.test:integration,test:dbandtest:servicegenuinely need a booted Nextcloud server tree — outside one they error wholesale (Database Tests566/566 errors,Service Tests1448/1454 errors, bothTypeError: Cannot assign null to property …Mapper). Forcing those to hard-fail would just be a differently-shaped lie, so they keep a guard — but a self-documenting one that names the actual reason and the actual missing file, in the shapeopencatalogi/composer.jsonalready uses:None of those three is in
check:strict, so no aggregate gate is weakened by it.Proof the gate can now fail
tests/Unit/BackgroundJob/CacheWarmupJobTest.php:222flipped toassertTrue(false), thencomposer test:all:Reverted, re-run:
EXIT=0,Tests: 15964. The assertion has been shown to be capable of both verdicts, and the count is non-zero — a suite that collects zero tests and exits 0 would be the worse outcome, so it is asserted explicitly here.Separate finding, deliberately NOT changed
phpunit.xmlsetsdefaultTestSuite="Unit Tests".test:allpasses no--testsuite, sotest:allruns only the Unit suite — it is a misnomer, not a full run. That is why its count is identical totest:unit's. Making it genuinely run all four suites would redden CI on ~2 030 environment-dependent tests, so it is left alone and flagged here for a separate decision.Risk
Low. The suite is green, so CI does not change colour. What changes is that it can now change colour.