test(aggregation): remove the coverage metadata that was discarding coverage - #2899
Merged
rubenvdlinde merged 2 commits intoAug 27, 2026
Merged
Conversation
…overage Closes #2847. Under `beStrictAboutCoverageMetadata="true"`, PHPUnit does not merely restrict recording to the units a test names — it marks any test that executes anything else RISKY and throws that test's coverage away entirely. The message is explicit once you look: This test executed code that is not listed as code to be covered or used: - OCA\OpenRegister\Db\Register - OCA\OpenRegister\Db\Schema - OCA\OpenRegister\Service\Aggregation\AggregationQuery Almost every test in this directory legitimately runs a collaborator — AggregationQuery, PlaceholderResolver, the Db entities — so naming the class under test did not focus the measurement, it deleted it. Measured locally with pcov, identical scope both runs (237 tests, 461 assertions): with @Covers without AggregationRunner 44.39% (613/1381) 80.30% (1109/1381) ...methods 9.80% (5/51) 33.33% (17/51) scope statements 1618 2137 Risky tests 33 0 Same tests, same assertions, same executed lines — only the attribution differs.⚠️ Those are pcov numbers. coverage-guard.php's own docblock records that CI measures with xdebug and the two do not count statements identically, so treat the DIRECTION as the result and let CI's `--against` measurement be the authority. `.coverage-baseline` is untouched: the guard treats a measurement above the floor as good news, and this only moves it up. `TimeseriesRequestValidatorTest` had `@coversDefaultClass` with not one `@covers ::method` to pair with it — naming a default nothing used, while still restricting recording. The reasoning already existed, measured, in AggregationJoinAndCompositeGroupByTest's docblock; the other ten files simply never had it applied. Each now carries a short note pointing there, so the annotation is not helpfully restored later. Full suite: 17336 tests, 0 failures.
CI failed all six PHPUnit cells with
"@Covers ::method`" is invalid
My own explanatory comment was the cause. PHPUnit parses a CLASS docblock,
so the sentence describing what had been removed re-declared it — and the
method-scoped spelling is malformed, so it errored rather than being
tolerated. A comment about the bug became the bug.
Every docblock added by this branch now names the annotation without a
leading at-sign, and TimeseriesRequestValidatorTest says why so the next
person does not helpfully "fix" the prose.
(I wrote the replacement comment containing the same literal string once
more before catching it. It is a genuinely easy trap: the natural way to
document an annotation is to write it.)
The pre-existing mentions in AggregationJoinAndCompositeGroupByTest are
left alone — those parse harmlessly; only the method-scoped form is
malformed.
Full suite: 17498 tests, 0 failures, no invalid annotation.
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| check-l10n-js | ✅ | ||||
| composer | ✅ | ✅ 175/175 | |||
| npm | ✅ | ✅ 545/545 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ❌ | ||||
| Newman | ✅ | ||||
| Playwright | ✅ | ||||
| Hydra gates | ❌ |
Quality workflow — 2026-08-27 06:16 UTC
Download the full PDF report from the workflow artifacts.
4 tasks
Contributor
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| check-l10n-js | ✅ | ||||
| composer | ✅ | ✅ 175/175 | |||
| npm | ✅ | ✅ 545/545 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ✅ | ||||
| Newman | ✅ | ||||
| Playwright | ✅ | ||||
| Hydra gates | ✅ |
Quality workflow — 2026-08-27 07:15 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.
Closes #2847.
@coverswas not focusing the measurement, it was deleting itUnder
beStrictAboutCoverageMetadata="true", PHPUnit does not merely restrictrecording to the units a test names — it marks any test that executes anything
else risky and throws that test's coverage away entirely. The message says
so once you look for it:
Almost every test in this directory legitimately runs a collaborator —
AggregationQuery,PlaceholderResolver, the Db entities — so naming the classunder test discarded the whole file's measurement.
Measured
Locally with pcov, identical scope both runs (237 tests, 461 assertions):
@coversAggregationRunnerlinesAggregationRunnermethodsSame tests, same assertions, same executed lines. Only the attribution differs.
.coverage-baselineis deliberately untouched — the guard treats ameasurement above the floor as good news and exits 0, and this only moves it up.
Also
TimeseriesRequestValidatorTestcarried@coversDefaultClasswith not one@covers ::methodto pair with it: naming a default nothing used, while stillrestricting recording.
The reasoning already existed — measured — in
AggregationJoinAndCompositeGroupByTest's docblock. The other ten files simplynever had it applied. Each now carries a short note pointing there, so the
annotation is not helpfully restored later by someone tidying up.
Verified
TextExtractionServiceTestno-assertion tests, untouched here)phpcs.xmlscanslibonly, so these files are not in its scopelib/code touched