Commit 96b73a4
committed
fix(test): spawn one via run.mjs in standalone tests so they run on Windows
metro-compiler, metro-startup-order, and process-cleanup spawned
`node node_modules/.bin/one` - on Windows the .bin shim is a .cmd/.exe
wrapper that node cannot load (MODULE_NOT_FOUND), so the dev server never
started and all three suites failed before testing anything. Resolve one's
real JS entry via createRequire (the same pattern as
packages/test/src/setupTest.ts and the test-warm-routes fix) and kill the
spawned tree with taskkill /T on Windows so dev-server workers don't orphan.
POSIX kill behavior is unchanged in the metro tests (SIGTERM then delayed
SIGKILL, as before); process-cleanup's final cleanup now force-kills on
POSIX too, matching what its own afterEach already did.
The orphan-detection test is now skipIf(win32): setupOrphanDetection in
packages/vxrn/src/exports/dev.ts is POSIX-only by design (returns early on
win32) and the test discovers the grandchild via pgrep, which doesn't exist
on Windows. Its spawn site is still fixed so the test stays correct where it
runs.
Also give packages/test/src/setup.ts's killProcessTree a Windows branch -
negative-pid process groups don't exist there, so the previous fallback
killed only the direct child and orphaned its workers.
Validated on Windows 11 (Bun 1.3.13, monorepo at v1.18.0): tests/test goes
from 4 failed suites (MODULE_NOT_FOUND) to 30 test files passed / 1 skipped,
145 tests passed / 10 skipped, 0 failures - Metro bundler boots (600ms),
the React-compiler bundle assertion and the startup-order assertion both
pass. oxlint 0/0, oxfmt clean, tsc --noEmit clean.1 parent ddd092a commit 96b73a4
4 files changed
Lines changed: 175 additions & 87 deletions
File tree
- packages/test/src
- tests/test/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
35 | 49 | | |
36 | 50 | | |
37 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 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 | + | |
5 | 33 | | |
6 | 34 | | |
7 | 35 | | |
| |||
22 | 50 | | |
23 | 51 | | |
24 | 52 | | |
25 | | - | |
26 | | - | |
| 53 | + | |
27 | 54 | | |
28 | 55 | | |
29 | 56 | | |
| |||
35 | 62 | | |
36 | 63 | | |
37 | 64 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
50 | 73 | | |
51 | 74 | | |
52 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 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 | + | |
5 | 33 | | |
6 | 34 | | |
7 | 35 | | |
| |||
23 | 51 | | |
24 | 52 | | |
25 | 53 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
41 | 65 | | |
42 | 66 | | |
43 | 67 | | |
| |||
80 | 104 | | |
81 | 105 | | |
82 | 106 | | |
83 | | - | |
84 | | - | |
| 107 | + | |
| 108 | + | |
85 | 109 | | |
86 | | - | |
87 | 110 | | |
88 | 111 | | |
89 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
5 | 30 | | |
6 | 31 | | |
7 | 32 | | |
| |||
28 | 53 | | |
29 | 54 | | |
30 | 55 | | |
31 | | - | |
| 56 | + | |
32 | 57 | | |
33 | | - | |
| 58 | + | |
34 | 59 | | |
35 | 60 | | |
36 | | - | |
| 61 | + | |
37 | 62 | | |
38 | 63 | | |
39 | 64 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
50 | 80 | | |
51 | | - | |
| 81 | + | |
52 | 82 | | |
53 | 83 | | |
54 | 84 | | |
55 | 85 | | |
56 | 86 | | |
57 | 87 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
76 | 107 | | |
77 | | - | |
78 | 108 | | |
79 | | - | |
| 109 | + | |
80 | 110 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
85 | 115 | | |
86 | | - | |
87 | | - | |
| 116 | + | |
| 117 | + | |
88 | 118 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
93 | 125 | | |
94 | 126 | | |
95 | 127 | | |
96 | 128 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
105 | 133 | | |
106 | 134 | | |
107 | 135 | | |
| |||
114 | 142 | | |
115 | 143 | | |
116 | 144 | | |
117 | | - | |
118 | | - | |
| 145 | + | |
| 146 | + | |
119 | 147 | | |
120 | 148 | | |
0 commit comments