What was measured
phpunit -c phpunit-unit.xml --do-not-fail-on-warning --no-coverage on a clean
checkout of development:
Tests: 1914, Assertions: 5856, Errors: 91, Failures: 3, Warnings: 1
exit 2. Identical on both sides of a git stash, so this is not something a
branch introduced. Found during the cleanup in #841, which does not touch it.
phpunit.xml, the config CI runs, is fine: OK (1914 tests, 6122 assertions),
exit 0.
What the errors are
All 91 are the deliberate refusals in the capability stubs, in two classes:
LogicException: OCA\OpenRegister\Service\Capability\ToolGrantResolver was resolved from
hermiq's ANALYSIS STUB rather than from OpenRegister. The real class ships with
OpenRegister (ADR-099 §5); tests/bootstrap.php maps it from
../openregister/lib/Service/Capability. Refusing rather than answering, because a
stubbed grant grammar would make every authorization test pass against a fake.
and the same shape for ToolGrantSet.
The refusal itself is right, and worth keeping: a stubbed grant grammar would
make every authorization test pass against a fake, which is the failure mode
this codebase keeps hitting. The problem is that tests/bootstrap-unit.php never
maps the capability roots at all, so on that config the refusal is unavoidable
rather than diagnostic.
Why it is worth fixing rather than living with
phpunit-unit.xml is the config a developer reaches for locally, because it
runs without a Nextcloud tree. It being red by construction means a real
regression on it is indistinguishable from the standing 91, so nobody reads it,
so it is not a check.
Two shapes that would both work, in preference order:
- Map the capability roots in
tests/bootstrap-unit.php too, the way
tests/bootstrap.php does, and let the refusal fire only when openregister
really is absent.
- Have that config skip the capability suites explicitly, so it reports a
smaller green rather than a large red. Weaker, because a skip that nobody
revisits is its own kind of hollow green, but honest.
Do not fix it by softening the LogicException into a warning. Refusing is the
point.
🤖 Generated with Claude Code
What was measured
phpunit -c phpunit-unit.xml --do-not-fail-on-warning --no-coverageon a cleancheckout of
development:exit 2. Identical on both sides of a
git stash, so this is not something abranch introduced. Found during the cleanup in #841, which does not touch it.
phpunit.xml, the config CI runs, is fine:OK (1914 tests, 6122 assertions),exit 0.
What the errors are
All 91 are the deliberate refusals in the capability stubs, in two classes:
and the same shape for
ToolGrantSet.The refusal itself is right, and worth keeping: a stubbed grant grammar would
make every authorization test pass against a fake, which is the failure mode
this codebase keeps hitting. The problem is that
tests/bootstrap-unit.phpnevermaps the capability roots at all, so on that config the refusal is unavoidable
rather than diagnostic.
Why it is worth fixing rather than living with
phpunit-unit.xmlis the config a developer reaches for locally, because itruns without a Nextcloud tree. It being red by construction means a real
regression on it is indistinguishable from the standing 91, so nobody reads it,
so it is not a check.
Two shapes that would both work, in preference order:
tests/bootstrap-unit.phptoo, the waytests/bootstrap.phpdoes, and let the refusal fire only when openregisterreally is absent.
smaller green rather than a large red. Weaker, because a skip that nobody
revisits is its own kind of hollow green, but honest.
Do not fix it by softening the
LogicExceptioninto a warning. Refusing is thepoint.
🤖 Generated with Claude Code