feat(recoverable-job): add folder_consistency

This commit is contained in:
Edouard Vanbelle
2026-07-29 01:33:47 +02:00
parent 394708c9a1
commit 782a5c99bd
5 changed files with 370 additions and 6 deletions
+25 -5
View File
@@ -90,11 +90,13 @@ jsonpath "$..interval_ms" count == 3
# Every entry carries a `running` bool — same aggregate primitive.
# Count matches the registered-tenant count: 4 Part 1 periodics
# (trash_cleanup, storage_reconcile, dedup_gc, grant_cleanup) + 1
# Part 2 recoverable (drives_consistency, wrapped by RecoverableAdapter
# so it appears here alongside the periodics). Bump when a new
# tenant registers.
jsonpath "$..running" count == 5
# (trash_cleanup, storage_reconcile, dedup_gc, grant_cleanup) + 2
# Part 2 recoverables (drives_consistency, folders_consistency —
# wrapped by RecoverableAdapter so they appear here alongside the
# periodics). Bump when a new tenant registers.
jsonpath "$..running" count == 6
jsonpath "$[*].name" contains "drives_consistency"
jsonpath "$[*].name" contains "folders_consistency"
# ─────────────────────────────────────────────────────────────
@@ -131,6 +133,24 @@ HTTP 200
jsonpath "$..last_outcome.outcome" contains "ok"
# ─────────────────────────────────────────────────────────────
# Step 4b — Trigger `folders_consistency`. Second Part 2
# recoverable tenant. Goes through the same
# RecoverableAdapter → PgJobStoreProvider path as
# drives_consistency (opens a run row, walks the
# `storage.folders` cursor, marks Completed). Success
# envelope shape identical.
# ─────────────────────────────────────────────────────────────
POST {{base_url}}/api/admin/jobs/folders_consistency/trigger
Authorization: Bearer {{admin_token}}
HTTP 200
[Asserts]
jsonpath "$.ok" == true
jsonpath "$.outcome.outcome" == "ok"
jsonpath "$.outcome.count" exists
# ─────────────────────────────────────────────────────────────
# Step 5 — Trigger a job that doesn't exist. 404 anti-enum on
# `JobRegistry::trigger` returning `None`.