Skip to content

Commit 9042e91

Browse files
authored
fix(test): stop the positional path overriding the curated unit-only suite (#221)
`composer test:unit-only` ran `phpunit tests -c tests/phpunit-unit-only.xml`. A positional path OVERRIDES the configured testsuite entirely, so the curated directory list in that config was decorative — the script swept all of tests/ regardless, which is precisely what the curation exists to prevent. Measured today: with `tests` 572 tests, 7 errors without it 565 tests, 0 errors The 7 are unit/Repair. They need Doctrine\DBAL\ParameterType, which only resolves through the Nextcloud server's 3rdparty autoload — exactly the dependency a suite named "no Nextcloud bootstrap" exists to avoid. Dropping the argument makes the config govern, which is what its comment always claimed. unit/Repair is not lost: the main phpunit.xml suite sweeps all of tests/ and is what CI executes in-container, where doctrine resolves. The config's comment now says the list only governs when nothing is passed positionally, and records that unit/Repair is absent ON PURPOSE — otherwise the next person to notice the gap re-adds it and reintroduces the errors.
1 parent 4f7f1c7 commit 9042e91

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"cs:fix": "./vendor/bin/php-cs-fixer fix",
2727
"psalm": "./vendor/bin/psalm --threads=1 --no-cache",
2828
"test:unit": "./vendor/bin/phpunit -c phpunit.xml --colors=always --fail-on-warning --fail-on-risky",
29-
"test:unit-only": "./vendor/bin/phpunit tests -c tests/phpunit-unit-only.xml --colors=always",
29+
"test:unit-only": "./vendor/bin/phpunit -c tests/phpunit-unit-only.xml --colors=always",
3030
"openapi": "./vendor/bin/generate-spec",
3131
"rector": "./vendor/bin/rector && composer cs:fix",
3232
"check:strict": "E=0; for CMD in lint cs:check psalm; do echo; echo \"=== $CMD ===\"; composer $CMD || E=1; done; echo; if [ $E -eq 0 ]; then echo \"ALL CHECKS PASSED\"; else echo \"SOME CHECKS FAILED (see above)\"; fi; exit $E"

‎tests/phpunit-unit-only.xml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@
1414
unit/Service (root-level InstallerService*/Installer* files),
1515
unit/Sections, and unit/Settings were fully green but had been left
1616
out of this curated list.
17+
18+
⚠️ THIS LIST ONLY GOVERNS IF NOTHING IS PASSED POSITIONALLY.
19+
`composer test:unit-only` used to run `phpunit tests -c <this file>`,
20+
and a positional path OVERRIDES the configured testsuite entirely —
21+
so the curation was decorative and the script swept all of tests/
22+
anyway. Measured 2026-08-24: 572 tests / 7 errors with the argument,
23+
565 / 0 without it. The 7 were unit/Repair, which needs
24+
Doctrine\DBAL\ParameterType from the server's 3rdparty autoload —
25+
exactly the dependency this suite exists to avoid.
26+
27+
unit/Repair is therefore absent ON PURPOSE, not by oversight. It runs
28+
in the main phpunit.xml suite, which sweeps all of tests/ and is what
29+
CI executes in-container where doctrine resolves.
1730
-->
1831
<directory suffix="Test.php">unit/Service</directory>
1932
<directory suffix="Test.php">unit/Controller</directory>

0 commit comments

Comments
 (0)