Skip to content

test(coverage): raise unit coverage past 80% and publish the measured figure - #1085

Merged
rubenvdlinde merged 2 commits into
developmentfrom
coverage/publish-measured
Nov 11, 2026
Merged

rubenvdlinde merged 2 commits into
developmentfrom
coverage/publish-measured

Conversation

@rubenvdlinde

@rubenvdlinde rubenvdlinde commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What

Raises launchpad's unit coverage past 80% of statements and publishes the measured figure, in the same format as the other fleet apps (scripts/coverage-publish.php, composer coverage:publish, coverage-summary.json, the coverage line in README.md).

  • Five tests were risky under coverage because their @uses lists missed classes that recent refactors extracted (BulkOutcome, TranslationVariantDraft, FilesWidgetAccess, ConfluenceImportRun, ParentFirstPageOrder). PHPUnit discarded their coverage, and with failOnRisky the suite exited 1 whenever a coverage driver was loaded. The missing @uses lines fix both.
  • New tests, access and validation first: the admin-only action matrix endpoints (gate attribute, seed key merge, encoding failure as 400), the admin role endpoints (409 duplicate, 400 invalid, 404 delete, the caller's own role behind the action matrix, the 401 of the inline admin guard), template read and delete, the role feature permission writes (required keys, the name rule for new rows, list normalisation, grid geometry floor), and the visibility rule evaluator (group, time, date, attribute rules).
  • coverage:publish passes -d pcov.directory=lib: pcov's auto-detection picks the Vue src/ folder and then measures 0%.
  • .coverage-baseline moves from 49.47 to 80.00, one point under the measurement.

Measured

PHP: 81.0% of statements (17,784 of 21,952), 2,802 tests, pcov 1.0.12 on PHP 8.3, at b3fd2179. Before this change: 79.0%. The JavaScript frontend has no coverage measurement yet, so it is not in the figure.

Verified locally

  • diff check: phpcs, touched tests and gates green on the new lines. Gate 4 (composer-audit) reports advisories in the unchanged composer.lock; it runs only because composer.json gained a script, so it is inherited.
  • composer check:strict once: phpcs, psalm, phpstan and the full PHPUnit suite (2,802 tests) pass. phpmd fails on lib/ findings this change does not touch (inherited).
  • maintainability floor compare: no drop (4.21 to 4.21).

AI assistance: prepared with Claude Code (Opus 5.5) and reviewed before submission.

…nd visibility rules

Five tests were marked risky because their @uses lists missed classes
extracted by recent refactors, so PHPUnit discarded their coverage. The
missing @uses lines restore it. New tests cover the role feature
permission writes, the admin-only action matrix, the admin role and
template endpoints and the visibility rule evaluator.

Assisted-by: ClaudeCode:claude-opus-5-5
scripts/coverage-publish.php turns the PHPUnit clover report into
coverage-summary.json and the coverage line in README.md;
composer coverage:publish runs the suite with coverage first. pcov is
pointed at lib/, because its auto-detection picks the Vue src/ folder
and would measure nothing. The committed floor moves from 49.47 to
80.00, one point under the measurement.

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde merged commit ad6c504 into development Nov 11, 2026
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant