Skip to content

Commit 0dae4ac

Browse files
improve turbo settings and vite e2e test config (#8754)
* improve turbo settings and vite e2e test config * skip the vite warnings playground when in build mode * Run Wrangler test:e2e in non-interactive mode * fixup! improve turbo settings and vite e2e test config
1 parent 448e3ad commit 0dae4ac

File tree

5 files changed

+52
-51
lines changed

5 files changed

+52
-51
lines changed

packages/vite-plugin-cloudflare/e2e/vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default defineConfig({
66
cache: false,
77
root: __dirname,
88
testTimeout: 1000 * 60 * 10, // 10 min for lengthy installs
9-
maxConcurrency: 3,
9+
fileParallelism: false,
1010
globalSetup: ["global-setup.ts"],
1111
},
1212
});
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import dedent from "ts-dedent";
22
import { expect, test, vi } from "vitest";
3-
import { serverLogs } from "../../../__test-utils__";
3+
import { isBuild, serverLogs } from "../../../__test-utils__";
44

5-
test("should display warnings if nodejs_compat is missing", async () => {
6-
await vi.waitFor(async () => {
7-
expect(serverLogs.warns.join("").replaceAll("\\", "/")).toContain(
8-
dedent`
5+
test.skipIf(isBuild)(
6+
"should display warnings if nodejs_compat is missing",
7+
async () => {
8+
await vi.waitFor(async () => {
9+
expect(serverLogs.warns.join("").replaceAll("\\", "/")).toContain(
10+
dedent`
911
Unexpected Node.js imports for environment "worker". Do you need to enable the "nodejs_compat" compatibility flag? Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details.
1012
- "node:assert/strict" imported from "worker-warnings/index.ts"
1113
- "perf_hooks" imported from "worker-warnings/index.ts"
1214
`
13-
);
14-
});
15-
});
15+
);
16+
});
17+
}
18+
);

packages/wrangler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"test": "dotenv -- pnpm run assert-git-version && dotenv -- vitest",
6565
"test:ci": "pnpm run test run",
6666
"test:debug": "pnpm run test --silent=false --verbose=true",
67-
"test:e2e": "dotenv -- vitest -c ./e2e/vitest.config.mts",
67+
"test:e2e": "dotenv -- vitest run -c ./e2e/vitest.config.mts",
6868
"test:watch": "pnpm run test --testTimeout=50000 --watch",
6969
"type:tests": "tsc -p ./src/__tests__/tsconfig.json && tsc -p ./e2e/tsconfig.json"
7070
},

packages/wrangler/turbo.json

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,55 +21,61 @@
2121
"config-schema.json"
2222
],
2323
"env": [
24-
"NODE_EXTRA_CA_CERTS",
25-
"CLOUDFLARE_ACCOUNT_ID",
26-
"SOURCEMAPS",
27-
"NODE_ENV",
28-
"SPARROW_SOURCE_KEY",
2924
"ALGOLIA_APP_ID",
3025
"ALGOLIA_PUBLIC_KEY",
31-
"CLOUDFLARE_API_TOKEN",
32-
"CLOUDFLARE_ACCOUNT_ID",
33-
"WRANGLER_AUTH_DOMAIN",
34-
"PATH",
35-
"WRANGLER_LOG",
36-
"EXPERIMENTAL_MIDDLEWARE",
37-
"FORMAT_WRANGLER_ERRORS",
26+
"NODE_ENV",
27+
"SOURCEMAPS",
28+
"SPARROW_SOURCE_KEY",
29+
"SENTRY_DSN"
30+
],
31+
"passThroughEnv": [
32+
"CF_PAGES_UPLOAD_JWT",
3833
"CF_PAGES",
39-
"WORKERS_CI",
4034
"CI",
41-
"CF_PAGES_UPLOAD_JWT",
35+
"CLOUDFLARE_ACCOUNT_ID",
36+
"CLOUDFLARE_API_TOKEN",
37+
"CUSTOM_BUILD_VAR",
4238
"EXPERIMENTAL_MIDDLEWARE",
39+
"FORMAT_WRANGLER_ERRORS",
40+
"http_proxy",
41+
"HTTP_PROXY",
42+
"https_proxy",
43+
"HTTPS_PROXY",
44+
"HYPERDRIVE_DATABASE_URL",
45+
"LC_ALL",
4346
"NO_D1_WARNING",
4447
"NO_HYPERDRIVE_WARNING",
45-
"WRANGLER",
46-
"WRANGLER_IMPORT",
47-
"CUSTOM_BUILD_VAR",
48+
"PATH",
4849
"PWD",
49-
"LC_ALL",
50-
"WRANGLER_SEND_METRICS",
51-
"https_proxy",
52-
"HTTPS_PROXY",
53-
"http_proxy",
54-
"HTTP_PROXY",
55-
"CI_OS",
56-
"SENTRY_DSN",
5750
"SYSTEMROOT",
5851
"TZ",
52+
"WORKERS_CI",
53+
"WRANGLER_API_ENVIRONMENT",
54+
"WRANGLER_AUTH_DOMAIN",
5955
"WRANGLER_DISABLE_EXPERIMENTAL_WARNING",
6056
"WRANGLER_DISABLE_REQUEST_BODY_DRAINING",
61-
"WRANGLER_WORKER_REGISTRY_PORT",
62-
"WRANGLER_API_ENVIRONMENT",
63-
"HYPERDRIVE_DATABASE_URL"
57+
"WRANGLER_LOG",
58+
"WRANGLER_SEND_METRICS",
59+
"WRANGLER_WORKER_REGISTRY_PORT"
6460
]
6561
},
6662
"test:ci": {
6763
"inputs": ["!*/**/.wrangler/**", "**/__tests__/**"],
68-
"dependsOn": ["build"]
64+
"dependsOn": ["build"],
65+
"env": ["VITEST", "NODE_DEBUG", "MINIFLARE_WORKERD_PATH"]
6966
},
7067
"test:e2e": {
7168
"inputs": ["e2e/**"],
72-
"dependsOn": ["build"]
69+
"dependsOn": ["build"],
70+
"env": [
71+
"VITEST",
72+
"NODE_DEBUG",
73+
"MINIFLARE_WORKERD_PATH",
74+
"WRANGLER",
75+
"WRANGLER_IMPORT",
76+
"CLOUDFLARE_ACCOUNT_ID",
77+
"CLOUDFLARE_API_TOKEN"
78+
]
7379
}
7480
}
7581
}

turbo.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,8 @@
33
"remoteCache": {
44
"signature": true
55
},
6-
"globalEnv": [
7-
"CI_OS",
8-
"NODE_VERSION",
9-
"VITEST",
10-
"NODE_DEBUG",
11-
"NODE_EXTRA_CA_CERTS",
12-
"MINIFLARE_WORKERD_PATH"
13-
],
6+
"globalEnv": ["CI_OS", "NODE_VERSION"],
7+
"globalPassThroughEnv": ["NODE_EXTRA_CA_CERTS"],
148
"tasks": {
159
"dev": {
1610
"persistent": true,
@@ -41,11 +35,9 @@
4135
},
4236
"test:ci": {
4337
"dependsOn": ["build"],
44-
"outputLogs": "new-only",
45-
"env": ["MINIFLARE_WORKERD_PATH"]
38+
"outputLogs": "new-only"
4639
},
4740
"test:e2e": {
48-
"env": ["WRANGLER", "CLOUDFLARE_ACCOUNT_ID", "CLOUDFLARE_API_TOKEN"],
4941
"dependsOn": ["build"],
5042
"outputLogs": "new-only"
5143
},

0 commit comments

Comments
 (0)