Commit 9b94f11
authored
feat: Remove RWSDK_DEPLOY for cross-platform builds and fix Windows E2E tests (#851)
This PR introduces fixes to resolve E2E test failures on Windows CI.
## User-Facing Fixes
* **Cross-Platform Scripting:**
* **Removed `RWSDK_DEPLOY` Env Var:** Replaced the non-portable `RWSDK_DEPLOY=1` syntax in starter's `package.json` scripts with a check against `process.env.NODE_ENV`. Vite automatically sets `NODE_ENV` to `"production"` for builds and `"development"` for the dev server. This provides a reliable, cross-platform way to determine the build context without requiring extra dependencies. This is also backwards compatible for existing projects created from the starter previously.
## E2E and CI Fixes
* **Windows Path Normalization:**
* **Vite Alias Resolution:** The primary cause of test failures was a path mismatch issue on Windows CI. Node.js was returning legacy "short" paths (e.g., `RUNNER~1`), while Vite's internals resolved to modern "long" paths (e.g., `runneradmin`). This inconsistency broke module alias resolution. The fix was to replace `fs.realpathSync` with `fs.realpathSync.native` throughout the E2E harness, which correctly canonicalizes paths to their long form.
* **Yarn YAML Parsing:** Corrected an issue where backslashes in Windows paths would cause YAML parsing errors in `.yarnrc.yml` files by normalizing paths to use forward slashes.
* **CI & E2E Test Harness Stability:**
* **Dev Server Timeout:** Resolved an issue where the dev server would fail silently on Windows. The root cause was `execa`'s `detached: true` option severing `stdio` streams. The fix was to conditionally set this option to `false` on Windows, restoring error and log output.
* **Package Manager Verbosity:** Added silent flags (`--reporter=silent`, `--silent`) to `pnpm`, `npm`, and `yarn` install commands to reduce log noise in CI.
* **GitHub Actions Workflow:** Fixed syntax errors in the `playground-e2e-tests.yml` workflow by removing a faulty conditional `shell` property and relying on runner defaults.
* **Windows Debugging Environment:**
* An interactive debugging environment for Windows was created and refined. It can be triggered via `./scripts/start-windows-debug.sh`.
* The environment automatically configures the runner with the user's local Git credentials, sets up custom git aliases, starts a Cursor tunnel, and launches a PowerShell session on SSH login.
* Securely forwards local `CLOUDFLARE_` environment variables to the remote session for testing.
## Current Status
The fixes in this PR have improved the stability of E2E tests on Windows, but several failures remain. Many of these appear to be timeouts, which may be transient. The current test results on Windows are as follows:
* **pnpm:**
* Test Files: 10 failed, 6 passed (16 total)
* Tests: 9 failed, 22 passed, 23 skipped (54 total)
* **npm:**
* Test Files: 14 failed, 2 passed (16 total)
* Tests: 1 failed, 4 passed, 49 skipped (54 total)
* Note: Includes a hook timeout error.
* **Yarn (Classic):**
* Test Files: 12 failed, 4 passed (16 total)
* Tests: 12 failed, 17 passed, 25 skipped (54 total)1 parent 49ace5e commit 9b94f11
File tree
37 files changed
+1199
-503
lines changed- .github/workflows
- .notes/justin/worklogs
- playground
- baseui
- chakra-ui
- content-collections
- database-do
- directives
- hello-world
- import-from-use-client
- mantine
- mdx
- monorepo-top-level-deps/packages/project
- non-blocking-suspense
- render-apis
- requestInfo
- resend
- rsc-kitchen-sink
- shadcn
- useid-test
- scripts
- sdk/src
- lib/e2e
- vite
- starter
37 files changed
+1199
-503
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
148 | | - | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | 152 | | |
154 | 153 | | |
155 | 154 | | |
156 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
157 | 164 | | |
158 | 165 | | |
159 | | - | |
160 | 166 | | |
161 | 167 | | |
162 | 168 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | 169 | | |
167 | 170 | | |
168 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
9 | 21 | | |
10 | 22 | | |
11 | 23 | | |
| |||
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
37 | 91 | | |
38 | 92 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments