Skip to content

Commit 3c695d8

Browse files
authored
chore: use main testing account on c3 e2e tests (#8268)
* switch api token and account id * add test to retrigger ci * skip if yarn
1 parent 62f5429 commit 3c695d8

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

.github/workflows/c3-e2e-quarantine.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ jobs:
4242
packageManager: ${{ matrix.pm.name}}
4343
packageManagerVersion: ${{ matrix.pm.version }}
4444
quarantine: true
45-
accountId: ${{ secrets.C3_TEST_CLOUDFLARE_ACCOUNT_ID }}
46-
apiToken: ${{ secrets.C3_TEST_CLOUDFLARE_API_TOKEN }}
45+
accountId: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
46+
apiToken: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }}

.github/workflows/c3-e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@ jobs:
8181
packageManagerVersion: ${{ matrix.pm.version }}
8282
quarantine: false
8383
experimental: ${{ matrix.experimental }}
84-
accountId: ${{ secrets.C3_TEST_CLOUDFLARE_ACCOUNT_ID }}
85-
apiToken: ${{ secrets.C3_TEST_CLOUDFLARE_API_TOKEN }}
84+
accountId: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
85+
apiToken: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }}

.github/workflows/e2e-project-cleanup.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
- name: Cleanup C3 E2E test projects
2424
run: node -r esbuild-register tools/e2e/e2eCleanup.ts
2525
env:
26-
CLOUDFLARE_API_TOKEN: ${{ secrets.C3_TEST_CLOUDFLARE_API_TOKEN }}
27-
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.C3_TEST_CLOUDFLARE_ACCOUNT_ID }}
26+
CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }}
27+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }}
2828

2929
- name: Cleanup E2E test projects
3030
run: node -r esbuild-register tools/e2e/e2eCleanup.ts

packages/create-cloudflare/e2e-tests/cli.test.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import fs, { readFileSync } from "node:fs";
22
import { basename } from "node:path";
3+
import { detectPackageManager } from "helpers/packageManagers";
34
import { beforeAll, describe, expect } from "vitest";
45
import { version } from "../package.json";
56
import { getFrameworkToTest } from "./frameworkToTest";
@@ -14,7 +15,7 @@ import type { Suite } from "vitest";
1415

1516
const experimental = process.env.E2E_EXPERIMENTAL === "true";
1617
const frameworkToTest = getFrameworkToTest({ experimental: false });
17-
18+
const { name: pm } = detectPackageManager();
1819
// Note: skipIf(frameworkToTest) makes it so that all the basic C3 functionality
1920
// tests are skipped in case we are testing a specific framework
2021
describe.skipIf(experimental || frameworkToTest || isQuarantineMode())(
@@ -421,5 +422,22 @@ describe.skipIf(experimental || frameworkToTest || isQuarantineMode())(
421422
expect(output).toContain(`lang JavaScript`);
422423
},
423424
);
425+
426+
test({ experimental }).skipIf(
427+
process.platform === "win32" || pm === "yarn",
428+
)("--existing-script", async ({ logStream, project }) => {
429+
const { output } = await runC3(
430+
[
431+
project.path,
432+
"--existing-script=existing-script-test-do-not-delete",
433+
"--git=false",
434+
"--no-deploy",
435+
],
436+
[],
437+
logStream,
438+
);
439+
expect(output).toContain("Pre-existing Worker (from Dashboard)");
440+
expect(output).toContain("Application created successfully!");
441+
});
424442
},
425443
);

0 commit comments

Comments
 (0)