also looking at this
fix: hydrate durable registry snapshots before serving writes
#244
11 files
+202
-35
| @@ -1,3 +1,4 @@ | ||
| 1 | import { S3RequestError } from './storage/aws-client' | |
| 1 | 2 | import { describe, expect, it } from 'bun:test' |
| 2 | 3 | import { BuildStatusStore } from './storage/build-status' |
| 3 | 4 | |
| @@ -7,7 +8,7 @@ function mockBucket() { | ||
| 7 | 8 | const client = { |
| 8 | 9 | async getObjectBuffer(_bucket: string, key: string): Promise<Buffer> { |
| 9 | 10 | const value = objects.get(key) |
| 10 | if (!value) throw new Error('S3 GET failed: 404 Not Found') | |
| 11 | if (!value) throw new S3RequestError('GET', 404, 'NoSuchKey') | |
| 11 | 12 | return value |
| 12 | 13 | }, |
| 13 | 14 | async putObject(input: { key: string, body: Buffer | string }): Promise<void> { |
| @@ -74,7 +75,7 @@ describe('BuildStatusStore partial coverage', () => { | ||
| 74 | 75 | const client = { |
| 75 | 76 | async getObjectBuffer(_bucket: string, key: string): Promise<Buffer> { |
| 76 | 77 | const value = objects.get(key) |
| 77 | if (!value) throw new Error('S3 GET failed: 404 Not Found') | |
| 78 | if (!value) throw new S3RequestError('GET', 404, 'NoSuchKey') | |
| 78 | 79 | return value |
| 79 | 80 | }, |
| 80 | 81 | async putObject(input: { key: string, body: Buffer | string }): Promise<void> { |
| @@ -135,7 +136,7 @@ describe('BuildStatusStore partial coverage', () => { | ||
| 135 | 136 | const client = { |
| 136 | 137 | async getObjectBuffer(_bucket: string, key: string): Promise<Buffer> { |
| 137 | 138 | const value = objects.get(key) |
| 138 | if (!value) throw new Error('S3 GET failed: 404 Not Found') | |
| 139 | if (!value) throw new S3RequestError('GET', 404, 'NoSuchKey') | |
| 139 | 140 | return value |
| 140 | 141 | }, |
| 141 | 142 | async putObject(input: { key: string, body: Buffer | string }): Promise<void> { |
| @@ -196,7 +197,7 @@ describe('BuildStatusStore retired platforms', () => { | ||
| 196 | 197 | const client = { |
| 197 | 198 | async getObjectBuffer(_bucket: string, key: string): Promise<Buffer> { |
| 198 | 199 | const value = objects.get(key) |
| 199 | if (!value) throw new Error('S3 GET failed: 404 Not Found') | |
| 200 | if (!value) throw new S3RequestError('GET', 404, 'NoSuchKey') | |
| 200 | 201 | return value |
| 201 | 202 | }, |
| 202 | 203 | async putObject(input: { key: string, body: Buffer | string }): Promise<void> { |