fix(quality): make the skipped-unit-suite green self-documenting - #210
Merged
Conversation
nldesign's test:unit / test:all genuinely cannot run in a bare checkout, and that is NOT being changed here - the justification is true. Verified on a clean worktree of origin/development (PHP 8.4.22, vendor/ from the main checkout), phpunit aborts: Interface "OCP\Files\AppData\IAppDataFactory" not found Location: /app/tests/Unit/Controller/SettingsControllerAuditTest.php:40 exit 255 A 255 is an abort during test collection, not a test verdict. The suite type-hints OCP interfaces that only a Nextcloud server checkout provides, so the ../../lib/base.php guard is correct and stays. What was wrong is that the guard's green was indistinguishable from a real one. check / check:full / check:strict printed a bare "ALL CHECKS PASSED" whether or not a single test had run. Changes, adopting the pattern opencatalogi already uses: - the skip message now names the verbatim failure, the file and line, the 255 exit, why the guard exists, and why deleting it does not help; - check / check:full / check:strict now print "ALL CHECKS PASSED - EXCEPT test:all, WHICH DID NOT RUN" plus an explanation whenever the server tree is absent, so the caveat cannot be missed and the guard cannot be "fixed" away by someone who thinks it is noise. Measured (composer 2 container, stub phpunit, both directions): no server tree, phpunit exits 1 -> test:all exit 0, SKIPPED block printed no server tree, static green -> check:strict exit 0, EXCEPT-block printed server tree present, phpunit 1 -> test:all exit 1, check:strict exit 1 server tree present, phpunit 0 -> test:all exit 0 so the guard demonstrably does not weaken a real run: when the suite can run, a failure still propagates through check:strict.
Contributor
Quality Report — ConductionNL/nldesign @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ❌ | ||||
| composer | ✅ | ✅ 100/100 | |||
| npm | ✅ | ✅ 2/2 | |||
| PHPUnit | ✅ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
Quality workflow — 2026-08-04 08:57 UTC
Download the full PDF report from the workflow artifacts.
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.
Summary
nldesign's unit suite genuinely cannot run in a bare checkout, and this PR does not change that. The "requires Nextcloud" justification here is true — I verified it before touching anything. What this PR fixes is that the resulting green was indistinguishable from a real one.
The justification is true — verified
Clean worktree of
origin/development, PHP 8.4.22,vendor/mounted from the main checkout:A 255 is an abort during test collection, not a test verdict. The suite type-hints OCP interfaces that only a Nextcloud server checkout provides. So the
../../lib/base.phpguard is correct and stays. Making this hard-fail would trade a documented skip for a crash that still runs zero tests.What was actually wrong
check,check:fullandcheck:strictprinted a bareALL CHECKS PASSEDwhether or not a single test had run. The skip message named the missing file but not what the green did or did not mean, so the caveat was invisible at exactly the moment someone reads the summary line — and the guard looked like removable noise.Change
Adopts the pattern opencatalogi already uses.
Measured — both directions
Run in a composer 2 container with a stub
phpunitwhose exit code I control, and a../../lib/base.phpI create and delete. The claim written into the message is literally this experiment.test:allcheck:strictSOME CHECKS FAILEDRow 2 is the positive control: when the suite can run, a failure still propagates all the way through
check:strict. The guard does not weaken a real run — it only covers the case where no run is possible.Row 1 is the condition being documented, and is unchanged behaviour by design.
Test count — NOT measured
I could not measure a live test count for this suite and am not going to claim one:
Exception: Not installedfromOC::checkInstalled()— that checkout has no installed instance;Static count only, for scale, explicitly not a measured run: 527
public function test*methods across 58*Test.phpfiles undertests/Unit. The authoritative count comes from the CI PHPUnit job.Scope
composer.jsononly —test:unit,test:all,check,check:full,check:strict.test:coverageandcoverage:checkuntouched. No test files changed.