Skip to content

test(apphost): cover store installer, store sources, document loader, feature toggles, bootstrap and calendar transformer gaps - #7584

Merged
rubenvdlinde merged 1 commit into
mainfrom
cloud/t04-store-services
Nov 9, 2026
Merged

rubenvdlinde merged 1 commit into
mainfrom
cloud/t04-store-services

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

SIG coverage round t1, lane T04: PHP unit tests for the AppHost store and services, plus the calendar transformer.

Covered

This PR adds new test files only. It changes no production code and adds no coverage metadata.

File Before (CI clover, development 30fbb6d) After (subset run, new + existing tests)
lib/AppHost/Store/GenericStoreInstaller.php 78/93 93/93
lib/Calendar/CalendarEventTransformer.php 121/133 124/133
lib/AppHost/Service/RegisterDocumentLoader.php 47/55 51/55
lib/AppHost/Service/LocalStoreRegistry.php 45/50 49/50
lib/AppHost/Store/Source/GitHubStoreSource.php 79/84 84/84
lib/AppHost/Bootstrap.php 232/239 238/239
lib/AppHost/Service/FeatureToggleService.php 88/91 91/91
lib/AppHost/Exception/FeatureToggleRefusedException.php 9/11 11/11

Bootstrap measurement. BootstrapBehaviourTest covers lines 371–376, the store-controller factory. Those lines show as uncovered whenever the pre-existing risky BootstrapAdminSettingsCharacterisationTest runs in the same process. The 238/239 figure comes from --filter 'BootstrapBehaviourTest|BootstrapTest|BootstrapFactoryChainTest'.

Left uncovered

  • CalendarEventTransformer 272–279 and 329: (b) unreachable. The "named zone" branch only matches strings that end in [Area/City]. new DateTime() rejects those strings, so the catch fallback always runs first.
  • CalendarEventTransformer: (d) possible bug, not pinned. A real named zone without brackets is treated as naive. For example, "2026-01-01 10:00:00 Europe/Amsterdam" is formatted as 20260101T100000Z. This needs its own fix.
  • RegisterDocumentLoader 99 and 158–159: file_get_contents returning false cannot be reached without a file-read seam.
  • RegisterDocumentLoader 149: glob() returning false, (b).
  • LocalStoreRegistry 160: idOf() given a non-array, (b). The caller always passes an array.
  • Bootstrap 644: preg_split returning false or empty, (b).

Ran

  • php -d pcov.enabled=1 -d pcov.directory=lib vendor/bin/phpunit -c phpunit.xml --coverage-clover ... --filter '<classes>' tests/Unit/AppHost tests/Unit/Calendar: OK (128 tests, 317 assertions).
  • The Bootstrap run and the loader/registry run, including GenericStoreServiceTest and RegisterDescriptorServiceTest, also pass. The figures above are from subset runs, so they are a lower bound.
  • weak.php reports none of the new files.

Mutation samples (each reverted)

  • mutation: lib/AppHost/Store/GenericStoreInstaller.php:244 'error' -> 'installed' -> 1 test failed
  • mutation: lib/Calendar/CalendarEventTransformer.php:248 all-day fallback 'DATE' -> 'DATE-TIME' -> 1 test failed
  • mutation: lib/AppHost/Service/RegisterDocumentLoader.php:164 $complete = false -> true -> 1 test failed
  • mutation: lib/AppHost/Service/LocalStoreRegistry.php:131 return OUTCOME_OK instead of the lookup's outcome -> 1 test failed
  • mutation: lib/AppHost/Store/Source/GitHubStoreSource.php:285 >= 300 -> >= 600 -> 2 tests failed
  • mutation: lib/AppHost/Bootstrap.php:373 appName: $appId -> 'x' -> 1 test failed
  • mutation: lib/AppHost/Service/FeatureToggleService.php:373 === false -> === true -> 1 test failed
  • mutation: lib/AppHost/Exception/FeatureToggleRefusedException.php:78 getKey returns appId -> 1 test failed

The tests were written with Claude Code.


Generated by Claude Code

…document loader, feature toggles, bootstrap and calendar transformer gaps

Assisted-by: ClaudeCode:claude-opus-5-5

Copy link
Copy Markdown
Contributor Author

The red Newman API Test Suite check is not caused by this PR.

The check fails at the step "PHPUnit unit suite (in-container, HARD GATE)". That step is currently red on every PR with the same result: 11 errors, 11 failures and 1 warning. Compare #7510, a JS-only PR (49064 tests). This run had 49099 tests and the same 11 / 11 / 1, so none of this PR's new tests failed.

The failures are in tests this PR doesn't touch: ProcessingLogServiceGoldenTest, SearchReferenceResolverGoldenTest, JobRunMapperNarrowGoldenTest, FileVersioningHandlerGoldenTest and others. No fix exists yet, and it belongs in its own PR. #7519 has the details.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde changed the base branch from development to main November 9, 2026 06:53

Copy link
Copy Markdown
Contributor Author

This PR only adds PHP test files, so the quality / … checks that are red on it are failing for reasons that come from development:

  • test:l10n and test:l10n:parity are red on plain development: a key is missing from the locales, and some keys used in src/ are missing from en.js.
  • The eslint errors are in files from development, and format checks frontend files that this PR doesn't touch.
  • phpstan and psalm only analyse lib/, which this PR doesn't touch.

The evidence is in #7519. Each check needs its own fix on development, and none exists yet.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

This adds to my earlier comment. Three more checks are red for reasons outside this PR:

  • phpcs checks only lib (phpcs.xml).
  • phpmd checks only lib (the composer phpmd script).
  • Hydra Gates inspects lib/, src/ and appinfo/; its 7 failing gates are standing debt on development.

This PR changes only tests/, so none of the three come from it. The details are in #7519 and #7523.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

The red quality / Frontend Tests (unit) check (the jest suite) is not caused by this PR. This PR adds only PHPUnit files under tests/Unit/ and changes nothing in src/, no .js/.vue file and no jest config, so jest runs exactly what development has. The same failure shows on other PRs, for example #7554.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde merged commit ace03f2 into main Nov 9, 2026
36 of 49 checks passed
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ aa2f512

Check PHP Vue Security License Tests
lint ✅
phpcs ❌
phpmd ❌
psalm ❌
phpstan ❌
phpmetrics ✅
eslint ❌
stylelint ✅
build ✅
check-specs ✅
test-l10n ❌
test-l10n-parity ❌
format ❌
check-schema-l10n ✅
test-coverage-ratchet ✅
composer ✅ ✅ 168/168
npm ✅ ✅ 641/641
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌ 49070/49080 · 19 skipped
Newman ❌ 1625/1628
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ❌

Quality workflow — 2026-11-09 18:10 UTC

Download the full PDF report from the workflow artifacts.

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.

2 participants