@@ -489,6 +489,16 @@ async function testRoute(request: Request, env: TestEnv): Promise<Response | nul
489489 const bucket = new MemoryR2 ( ) ;
490490 const testKey = btoa ( String . fromCharCode ( ...new Uint8Array ( 32 ) . fill ( 7 ) ) )
491491 . replaceAll ( '+' , '-' ) . replaceAll ( '/' , '_' ) . replace ( / = + $ / u, '' ) ;
492+ await env . DB . batch ( [
493+ env . DB . prepare ( `
494+ INSERT INTO backup_runs (id, backup_kind, status, started_at)
495+ VALUES ('slice5-stale-backup', 'daily', 'running', ?)
496+ ` ) . bind ( now - 31 * 60 * 1000 ) ,
497+ env . DB . prepare ( `
498+ INSERT INTO backup_runs (id, backup_kind, status, started_at)
499+ VALUES ('slice5-fresh-backup', 'daily', 'running', ?)
500+ ` ) . bind ( now - 60 * 1000 ) ,
501+ ] ) ;
492502 const result = await runR2Backup ( {
493503 ...env ,
494504 BACKUPS : bucket ,
@@ -503,10 +513,17 @@ async function testRoute(request: Request, env: TestEnv): Promise<Response | nul
503513 SELECT status, object_key, manifest_checksum, error_code
504514 FROM backup_runs WHERE id = ?
505515 ` ) . bind ( result . runId ) . first ( ) ;
516+ const reconciled = await env . DB . prepare ( `
517+ SELECT id, status, error_code, completed_at
518+ FROM backup_runs
519+ WHERE id IN ('slice5-stale-backup', 'slice5-fresh-backup')
520+ ORDER BY id
521+ ` ) . all ( ) ;
506522 return Response . json ( {
507523 objectCount : bucket . objects . size ,
508524 retention,
509525 run : runs ,
526+ reconciled : reconciled . results ,
510527 objectKeyIsSafe : ! result . objectKey . includes ( 'nyx' ) && ! result . objectKey . includes ( 'samet' ) ,
511528 checksumLength : result . objectChecksum . length ,
512529 } ) ;
0 commit comments