Skip to content

[access] test(retention): cover token refresh, tenant deprovisioning and retention sweep jobs - #7586

Merged
rubenvdlinde merged 4 commits into
mainfrom
cloud/t01-retention-jobs
Nov 9, 2026
Merged

rubenvdlinde merged 4 commits into
mainfrom
cloud/t01-retention-jobs

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What

New behaviour tests (no production code touched) for 8 retention, deprovisioning and token-refresh background classes:

  • OAuth2TokenRefreshJob (+ OAuth2TokenRefreshServices) — daily interval; only active token sets with a uuid whose provider is a token-set provider are swept, with scope defaulting to personal; relink is not counted as failure, other errors are; a failing listing stops the run
  • TenantDeprovisionJob — every deprovisioning tenant archived, one failure does not stop the rest, a failing query archives nothing
  • ArchivalRetentionTask failure and skip paths — register/schema/table-check/scan failures delete nothing, non-annotated schemas skipped, missing table not scanned, expired row without uuid counted but untouched, unreadable object kept as unresolved, refused/failing delete not counted, held row without archivist group notifies nobody, failing notifier does not stop the sweep
  • ProcessingLogRetentionJob — purge that cannot be recorded is logged with its figures; prune of nothing records nothing (frozen clock)
  • RuleRunRetentionJob — nothing removed logs nothing; removal count logged
  • RelatedRetentionLookup, RelatedRetentionRules — bundles hand back each collaborator under its name

Measured (subset run, lower bound of full suite)

php -d pcov.enabled=1 -d pcov.directory=lib vendor/bin/phpunit -c phpunit.xml --coverage-clover /tmp/t01-sub.xml <new files> tests/Unit/BackgroundJob/{ArchivalRetentionTask,ProcessingLogRetentionJob,RuleRunRetentionJob}Test.php + clover_files.py

File before (CI) after
lib/BackgroundJob/OAuth2TokenRefreshJob.php 0/47 47/47
lib/BackgroundJob/Support/OAuth2TokenRefreshServices.php 0/1 1/1
lib/BackgroundJob/TenantDeprovisionJob.php 10/26 26/26
lib/BackgroundJob/ArchivalRetentionTask.php 104/134 133/134
lib/BackgroundJob/ProcessingLogRetentionJob.php 38/43 43/43
lib/BackgroundJob/RuleRunRetentionJob.php 15/16 16/16
lib/BackgroundJob/Support/RelatedRetentionLookup.php 0/1 1/1
lib/BackgroundJob/Support/RelatedRetentionRules.php 0/1 1/1

The one remaining ArchivalRetentionTask statement (line 287, non-array schema configuration) looks unreachable: Schema::getConfiguration() returns an array or null.

42 tests green. phpcs clean. weak.php reports none of the new tests.

Mutation samples (each reverted, never committed)

  • mutation: lib/BackgroundJob/OAuth2TokenRefreshJob.php:193 dropped the active-status filter -> 1 test failed
  • mutation: lib/BackgroundJob/OAuth2TokenRefreshJob.php:152 counted a relink as a failure -> 1 test failed
  • mutation: lib/BackgroundJob/TenantDeprovisionJob.php:95 skipped the archive() call -> 1 test failed
  • mutation: lib/BackgroundJob/ArchivalRetentionTask.php:453 counted every delete as done (ignored deleteObject's result) -> 1 test failed
  • mutation: lib/BackgroundJob/ArchivalRetentionTask.php:386 disposed rows without a uuid -> 1 test failed
  • mutation: lib/BackgroundJob/ArchivalRetentionTask.php:408 stopped counting unresolved rows -> 1 test failed
  • mutation: lib/BackgroundJob/RuleRunRetentionJob.php:97 dropped the nothing-removed early return -> 1 test failed
  • mutation: lib/BackgroundJob/ProcessingLogRetentionJob.php:139 recorded a purge of zero entries (> 0 to >= 0) -> 1 test failed
  • mutation: lib/BackgroundJob/Support/RelatedRetentionLookup.php swapped the schema and register mapper names -> 1 test failed

Tests written with Claude Code.


Generated by Claude Code

…ule-run retention jobs

Assisted-by: ClaudeCode:claude-opus-5-5
Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde changed the base branch from development to main November 9, 2026 06:53

Copy link
Copy Markdown
Contributor Author

Newman API Test Suite (api-test-coverage) is failing, but not because of this PR.

The job runs the full PHPUnit suite. It ends with 11 errors and 11 failures, all in tests this PR does not touch:

  • JobRunMapperNarrowGoldenTest
  • FileVersioningHandlerGoldenTest
  • A18InterfaceBindingsTest
  • TextExtractionJobsGoldenTest
  • EndpointsControllerAnswersGoldenTest
  • SchemaConfigValidatorsGoldenTest
  • ProcessingLogServiceGoldenTest

None of the new *BehaviourTest files fail.

The same 22 tests also fail on development, including a1fd993, the commit this branch was cut from. They fail the same way on #7526, #7549 and #7576.

This PR only adds test files, so there is nothing to fix here. No fix exists yet that could be ported in. I have not re-run the check, because development fails it the same way.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Frontend Check (format) is red, but not because of this PR. Prettier flags only existing .vue/.js files under src/. This PR adds PHP test files under tests/Unit/BackgroundJob/ and touches no front-end file.

The rest of the quality job will fail on this PR for the same reasons it did on #7526, #7549 and #7576:

  • Vue Quality (eslint): errors in existing files under src/.
  • phpcs, phpstan, psalm, phpmd: every finding is in existing production code under lib/. None point at tests/.
  • Frontend Check (test:l10n:parity): l10n/de.js is missing "We could not count the objects. Close this window and try again.". The key is also missing on development.
  • Frontend Check (test:l10n): this check is already red on development (see "Known state" in CLAUDE.md).
  • Hydra Gates: the same 7 gates fail, from a full-repo scan of controllers and Vue components.

None of these can be fixed from a test-only PR. They need their own fixes on development, and the l10n gaps need their own locale commits.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Frontend Tests (unit) is red, but not because of this PR.

All 4,965 jest tests passed. The failure is one suite that Jest cannot load: src/views/migrationPack/migrationPackTables.dom.golden.spec.js stops with "Jest encountered an unexpected token" before any test in it runs. That is a parse or transform problem in an existing front-end spec under src/. This PR adds only PHP test files and changes no .js or .vue file and no jest config, so it neither causes this nor can fix it here.

Frontend Check (test:l10n) is also red. That one is already explained in my previous comment.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde merged commit 72d68c1 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 @ 8e7ddc8

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 ❌ 49065/49075 · 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:20 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