Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion scripts/native-worker/fleet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<FleetPointer>("deploy/current.json"))?.value
.script_name,
Expand Down
7 changes: 6 additions & 1 deletion scripts/native-worker/fleet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Loading