Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:1zu7inoki4 is past its budget: trevato/forge: "whether a snapshot is encrypted before it leaves is a setting, and the status says which > by default t… #12687
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/12634-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork 1 thread · 1 unresolved
4 files
changed +30
−3
test/helpers/stub-bucket.ts +18
| @@ -43,3 +43,21 @@ export function stubBucket(objects: Map<string, Uint8Array>, seen: string[]): Re | ||
| 43 | 43 | }, |
| 44 | 44 | }); |
| 45 | 45 | } |
| 46 | ||
| 47 | const PROXY_NAMES = ["HTTP_PROXY", "HTTPS_PROXY", "ALL_PROXY", "http_proxy", "https_proxy", "all_proxy", "NO_PROXY", "no_proxy"] as const; | |
| 48 | ||
| 49 | /** | |
| 50 | * A stub bucket is on loopback: a proxy in the environment (a check cell's egress proxy, or one | |
| 51 | * another test left behind) must not stand between the client and it. Drops the proxy variables | |
| 52 | * and returns what puts them back. | |
| 53 | */ | |
| 54 | export function bypassProxy(): () => void { | |
| 55 | const saved = PROXY_NAMES.map((n) => [n, process.env[n]] as const); | |
| 56 | for (const n of PROXY_NAMES) delete process.env[n]; | |
| 57 | return () => { | |
| 58 | for (const [n, v] of saved) { | |
| 59 | if (v === undefined) delete process.env[n]; | |
| 60 | else process.env[n] = v; | |
| 61 | } | |
| 62 | }; | |
| 63 | } |
test/mirror-worker.test.ts +4 −1
| @@ -13,7 +13,10 @@ import { lastMirror, mirrorOffThread } from "../src/snapshot/mirror.ts"; | ||
| 13 | 13 | import { storeFrom } from "../src/snapshot/remake.ts"; |
| 14 | 14 | import { sealedStore } from "../src/snapshot/sealed_store.ts"; |
| 15 | 15 | import { dirStore, remakeOf, s3Store, type Store } from "../src/snapshot/store.ts"; |
| 16 | import { stubBucket } from "./helpers/stub-bucket.ts"; | |
| 16 | import { bypassProxy, stubBucket } from "./helpers/stub-bucket.ts"; | |
| 17 | ||
| 18 | const restoreProxy = bypassProxy(); | |
| 19 | afterAll(restoreProxy); | |
| 17 | 20 | |
| 18 | 21 | const root = mkdtempSync(join(tmpdir(), "mirror-worker-")); |
| 19 | 22 | afterAll(() => rmSync(root, { recursive: true, force: true })); |
test/snapshot-incremental.test.ts +4 −1
| @@ -74,7 +74,10 @@ import { dirStore, s3Store, type Store } from "../src/snapshot/store.ts"; | ||
| 74 | 74 | import { verifySnapshot } from "../src/snapshot/verify.ts"; |
| 75 | 75 | import { chunked, pack } from "./helpers/snapshot-fixtures.ts"; |
| 76 | 76 | import { quietLogs } from "./helpers/globals.ts"; |
| 77 | import { stubBucket } from "./helpers/stub-bucket.ts"; | |
| 77 | import { bypassProxy, stubBucket } from "./helpers/stub-bucket.ts"; | |
| 78 | ||
| 79 | const restoreProxy = bypassProxy(); | |
| 80 | afterAll(restoreProxy); | |
| 78 | 81 | |
| 79 | 82 | quietLogs(); |
| 80 | 83 |
test/snapshot-repositories.test.ts +4 −1
| @@ -69,7 +69,10 @@ import { | ||
| 69 | 69 | } from "../src/snapshot/store.ts"; |
| 70 | 70 | import { verifySnapshot } from "../src/snapshot/verify.ts"; |
| 71 | 71 | import { quietLogs } from "./helpers/globals.ts"; |
| 72 | import { stubBucket } from "./helpers/stub-bucket.ts"; | |
| 72 | import { bypassProxy, stubBucket } from "./helpers/stub-bucket.ts"; | |
| 73 | ||
| 74 | const restoreProxy = bypassProxy(); | |
| 75 | afterAll(restoreProxy); | |
| 73 | 76 | |
| 74 | 77 | quietLogs(); |
| 75 | 78 |
new above
offline
Next step: make stubBucket users get this by default, so a fourth test file cannot forget the call and flake in a check cell.