diff --git a/scripts/native-worker/fleet.test.ts b/scripts/native-worker/fleet.test.ts index c2b90e1..7b27ab9 100644 --- a/scripts/native-worker/fleet.test.ts +++ b/scripts/native-worker/fleet.test.ts @@ -227,8 +227,20 @@ test.skipIf(process.env.NATIVE_WORKER_FLEET !== "1")( await operator.start(); operator.serve({ port: operatorPort }); await operator.publishHost(); - for (const node of nodes) + const galleryBundle = await readFile( + resolve(import.meta.dir, "../../dist/cloudflare/assets/gallery.js"), + "utf8", + ); + for (const node of nodes) { expect((await fetch(`${node}/health`)).status, logs).toBe(200); + const gallery = await fetch(`${node}/`); + expect(gallery.status, logs).toBe(200); + expect(await gallery.text()).toContain('src="/gallery.js"'); + const bundle = await fetch(`${node}/gallery.js`); + expect(bundle.status, logs).toBe(200); + expect(bundle.headers.get("content-type")).toContain("javascript"); + expect(await bundle.text(), logs).toBe(galleryBundle); + } expect( (await store.json("deploy/current.json"))?.value .script_name, diff --git a/scripts/native-worker/fleet.ts b/scripts/native-worker/fleet.ts index 6c18c11..aec99d7 100644 --- a/scripts/native-worker/fleet.ts +++ b/scripts/native-worker/fleet.ts @@ -304,7 +304,12 @@ export class CelldFleetOperator { `${prefix}/deploy/current.json`, ); if (!pointer) throw new Error("celld candidate pointer is missing"); - const keys = await this.store.keys(`${prefix}/deploy/`); + // celld stores asset bodies outside deploy/. Copy them before the index + // and manifest so the published pointer only names complete deployments. + const keys = [ + ...(await this.store.keys(`${prefix}/deploy-blobs/`)), + ...(await this.store.keys(`${prefix}/deploy/`)), + ]; for (const key of keys) { const target = key.slice(prefix.length + 1); if (