Commit 74b9042
fix(rbac,testcontainers): make e2e healthcheck-require-plugins actually work
Three small fixes uncovered by running the e2e test locally:
- internal-packages/rbac/src/index.ts: attach a no-op .catch() to
LazyController._init in the constructor. load() runs eagerly but its
result is only awaited on the first method call. When load() rejects
(REQUIRE_PLUGINS=1 + plugin missing), Node flags the unawaited
rejection as unhandledRejection — newer Node versions kill the
process before any consumer can await _init and convert the throw
into a 500. The .catch() marks the rejection as handled at the
global level; the actual error still re-throws when c() awaits _init.
- internal-packages/testcontainers/src/webapp.ts: when requirePlugins
is set, explicitly override RBAC_FORCE_FALLBACK="0" so a local
apps/webapp/.env that sets it to "1" doesn't short-circuit the loader
past the REQUIRE_PLUGINS check. Without this, the test passes in CI
(no .env file) but fails locally with no obvious error.
- internal-packages/testcontainers/src/webapp.ts: waitForHealthcheck
now takes an `acceptAnyResponse` flag. When requirePlugins is set,
/healthcheck is *expected* to return 500 (the whole point of the
test), so the bootstrap waiter must accept any HTTP response rather
than only 200 — otherwise startTestServer times out before the test
can assert.
apps/webapp/test/healthcheck-require-plugins.e2e.test.ts: tidied up
the locally-linked-skip placeholder.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent ee6bce6 commit 74b9042
3 files changed
Lines changed: 52 additions & 5 deletions
File tree
- apps/webapp/test
- internal-packages
- rbac/src
- testcontainers/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
17 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
18 | 35 | | |
19 | 36 | | |
20 | 37 | | |
21 | | - | |
| 38 | + | |
22 | 39 | | |
23 | 40 | | |
24 | 41 | | |
| |||
42 | 59 | | |
43 | 60 | | |
44 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
45 | 73 | | |
46 | 74 | | |
47 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
28 | | - | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
125 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
126 | 133 | | |
127 | 134 | | |
128 | 135 | | |
| |||
158 | 165 | | |
159 | 166 | | |
160 | 167 | | |
161 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
162 | 174 | | |
163 | 175 | | |
164 | 176 | | |
| |||
0 commit comments