Skip to content

Commit

Permalink
ci: clean up C3 e2e test projects according to their type
Browse files Browse the repository at this point in the history
Previously we only deleted Pages projects - in fact we were trying to delete
the Hono (non-Pages) Worker as a Pages project.

Now we delete the project based on its type.
  • Loading branch information
petebacondarwin committed Nov 15, 2023
1 parent baa1931 commit 2e06a23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
beforeEach,
beforeAll,
} from "vitest";
import { deleteProject } from "../scripts/common";
import { deleteProject, deleteWorker } from "../scripts/common";
import { frameworkToTest } from "./frameworkToTest";
import {
isQuarantineMode,
Expand Down Expand Up @@ -160,13 +160,13 @@ describe.concurrent(`E2E: Web frameworks`, () => {
afterEach(async (ctx) => {
const framework = ctx.meta.name;
clean(framework);
// Cleanup the pages project in case we need to retry it
// Cleanup the project in case we need to retry it
const projectName = getName(framework);
try {
const frameworkConfig = FrameworkMap[framework];
if (frameworkConfig.type !== "workers") {
await deleteProject(projectName);
} catch (error) {
console.error(`Failed to cleanup project: ${projectName}`);
console.error(error);
} else {
await deleteWorker(projectName);
}
});

Expand Down
2 changes: 1 addition & 1 deletion packages/create-cloudflare/scripts/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const apiFetch = async (
});

if (response.status >= 400) {
console.error(`REQUEST ERROR: ${url}`);
console.error(`REQUEST ERROR: ${url}`, init);
console.error(`(${response.status}) ${response.statusText}`);
const body = (await response.json()) as ApiErrorBody;
console.error(body.errors);
Expand Down

0 comments on commit 2e06a23

Please sign in to comment.