Skip to content

[access] test(backgroundjob): cover transfer, sync, log clean-up, state history and review reminder job gaps - #7560

Merged
rubenvdlinde merged 1 commit into
mainfrom
cloud/t04-transfer-jobs
Nov 9, 2026
Merged

rubenvdlinde merged 1 commit into
mainfrom
cloud/t04-transfer-jobs

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

SIG coverage round t1, lane T04: PHP unit tests for the transfer and maintenance background jobs. The [access] prefix is there because transfers and log clean-up touch archival and retention.

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)
lib/BackgroundJob/TransferExecutionJob.php 95/110 110/110
lib/BackgroundJob/LogCleanUpTask.php 48/58 58/58
lib/BackgroundJob/StateHistoryRebuildJob.php 45/54 54/54
lib/BackgroundJob/TransferCheckJob.php 44/49 49/49
lib/BackgroundJob/SyncDataJob.php 47/51 51/51
lib/BackgroundJob/ReviewReminderJob.php 61/62 62/62
Total 340/384 384/384

The tests close these gaps:

  • TransferExecutionJob: a bad argument, a transfer list that is not found, an attempt that throws, a missing status, and the sftp, openconnector and default rest transports. Also the attempt cap of 0 or less falling back to 10, with a retry at attempt 9 and escalation at 10.
  • LogCleanUpTask: the state-history prune branches.
  • StateHistoryRebuildJob: the annotation edge cases.
  • TransferCheckJob: the scan-failure path and the no-eligible-objects path.
  • SyncDataJob: how since is derived.
  • ReviewReminderJob: the zero-frequency fallback.

The jitter in TransferExecutionJob::backoffSeconds comes from random_int, so the tests only assert that the scheduled time falls after a frozen "now".

Ran

  • php -d pcov.enabled=1 -d pcov.directory=lib vendor/bin/phpunit -c phpunit.xml --coverage-clover /tmp/tj.xml --filter '<new + existing tests for these six jobs>' tests/Unit/BackgroundJob ran 83 tests with 404 assertions and no failures. 10 tests are risky, all in the existing Golden tests; none of the new files is risky. Because this was a subset run, the coverage above is a lower bound.
  • weak.php over tests/Unit/BackgroundJob reports none of the new files.

Mutation samples (each reverted)

  • mutation: lib/BackgroundJob/TransferExecutionJob.php:409 < 1 -> < 0 -> 1 test failed
  • mutation: lib/BackgroundJob/LogCleanUpTask.php:229 !== '' -> === '' -> 1 test failed
  • mutation: lib/BackgroundJob/StateHistoryRebuildJob.php:234 === '' -> === 'x' -> 1 test failed
  • mutation: lib/BackgroundJob/TransferCheckJob.php:133 empty($eligibleObjects) === true -> false -> 1 test failed
  • mutation: lib/BackgroundJob/SyncDataJob.php:163 !== null -> === null -> 2 tests failed
  • mutation: lib/BackgroundJob/ReviewReminderJob.php:97 <= 0 -> < 0 -> 1 test failed

The tests were written with Claude Code.


Generated by Claude Code

…y and review reminder job 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.

It fails at the step "PHPUnit unit suite (in-container, HARD GATE)". That step currently fails on every PR, including the JS-only #7510.

Run Tests Errors Failures Warnings
#7510 (JS-only baseline) 49064 11 11 1
this PR 49090 11 11 1

The 26 extra tests are exactly the ones this PR adds, and they all pass. The failing tests are ProcessingLogServiceGoldenTest, SearchReferenceResolverGoldenTest and others, none of which this PR touches. 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:54

Copy link
Copy Markdown
Contributor Author

This PR only adds PHP test files, so the red quality / … checks come from development, not from this PR:

  • test:l10n and test:l10n:parity are red on plain development. A key is missing from the locales, and keys used in src/ are missing from en.js.
  • The eslint errors are in files from development. format checks frontend files, and this PR touches none.
  • phpstan and psalm only analyse lib/, which this PR does not touch.

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


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

This adds to my earlier comment. Three more checks also fail 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 these come from it. The details are in #7519 and #7523.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

If the quality / Frontend Tests (unit) check (the jest suite) is red, this PR is not the cause. The PR only adds PHPUnit files under tests/Unit/ and changes nothing in src/, no .js/.vue file and no jest config. Jest therefore runs the same code as on development, and #7554 shows the same failure.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde merged commit 7b2e4eb into main Nov 9, 2026
37 of 49 checks passed
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ 848574f

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 ❌ cancelled — no verdict
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 17:24 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