From 2e6551cf818b4fad65a38b9adb662c06615e17ba Mon Sep 17 00:00:00 2001 From: A Ibrahim Date: Wed, 8 Apr 2026 20:44:03 +0200 Subject: [PATCH 1/2] fix: update integration tests for new paginated JSON schema JSON output from list commands now returns { items: [...] } instead of a flat array. Update the two integration tests that parsed JSON output as flat arrays to use parsed.items instead. Co-Authored-By: Claude Opus 4.6 (1M context) --- test/cli.test.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/cli.test.ts b/test/cli.test.ts index cd45a27..49c27bf 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -1156,10 +1156,10 @@ describe.skipIf(skipTests)('CLI Integration Tests', () => { const result = runCli('buckets list --format json'); expect(result.exitCode).toBe(0); const parsed = JSON.parse(result.stdout.trim()); - expect(Array.isArray(parsed)).toBe(true); - expect(parsed.some((b: { name: string }) => b.name === testBucket)).toBe( - true - ); + expect(Array.isArray(parsed.items)).toBe(true); + expect( + parsed.items.some((b: { name: string }) => b.name === testBucket) + ).toBe(true); }); }); @@ -1810,10 +1810,10 @@ describe.skipIf(skipTests)('CLI Integration Tests', () => { const result = runCli(`snapshots list ${snapBucket} --format json`); expect(result.exitCode).toBe(0); const parsed = JSON.parse(result.stdout.trim()); - expect(Array.isArray(parsed)).toBe(true); - expect(parsed.length).toBeGreaterThan(0); + expect(Array.isArray(parsed.items)).toBe(true); + expect(parsed.items.length).toBeGreaterThan(0); // Save version for later tests - snapshotVersion = parsed[0].version; + snapshotVersion = parsed.items[0].version; expect(snapshotVersion).toBeTruthy(); }); From 0e075ee8045172960cc63e1c3ca6b75e6ba20846 Mon Sep 17 00:00:00 2001 From: A Ibrahim Date: Wed, 8 Apr 2026 20:47:22 +0200 Subject: [PATCH 2/2] fix: update stale bucket cleanup to use paginated JSON schema The beforeAll cleanup also parsed buckets list JSON as a flat array. Silently failed in the catch block, leaving stale test buckets. Co-Authored-By: Claude Opus 4.6 (1M context) --- test/cli.test.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/cli.test.ts b/test/cli.test.ts index 49c27bf..e0b06cc 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -275,12 +275,11 @@ describe.skipIf(skipTests)('CLI Integration Tests', () => { const listResult = runCli('buckets list --format json'); if (listResult.exitCode === 0 && listResult.stdout.trim()) { try { - const buckets = JSON.parse(listResult.stdout.trim()) as Array<{ - name: string; - created: string; - }>; + const parsed = JSON.parse(listResult.stdout.trim()) as { + items: Array<{ name: string; created: string }>; + }; const now = Date.now(); - for (const bucket of buckets) { + for (const bucket of parsed.items) { if (!bucket.name.startsWith('tigris-cli-test-')) continue; const age = now - new Date(bucket.created).getTime(); if (age > staleThresholdMs) {