Commit db736df
committed
fix: pass server pid to TestServer Plug via persistent_term
The Plug runs in Bandit's process tree, so it cannot directly know
the TestServer GenServer pid. Use :persistent_term to register the
pid in the GenServer's init/1 and look it up in the Plug's call/2.
This fixes a real bug where calling TestServer.start_link/1 returned
a pid but the Plug still used Process.whereis(AdoCli.TestServer) which
only finds named processes.
Test infrastructure only — no production code touched.
Verified end-to-end:
- 107 tests pass
- mix ci green (Credo strict, Dialyzer, xref, format)
- Browser login: 'Authenticated successfully as myorg'
- All 4 auth methods work (env, PAT, device code, browser)1 parent ae71bc5 commit db736df
1 file changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| |||
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
122 | 130 | | |
123 | 131 | | |
124 | 132 | | |
| |||
127 | 135 | | |
128 | 136 | | |
129 | 137 | | |
| 138 | + | |
130 | 139 | | |
131 | 140 | | |
132 | 141 | | |
| |||
180 | 189 | | |
181 | 190 | | |
182 | 191 | | |
| 192 | + | |
| 193 | + | |
183 | 194 | | |
184 | 195 | | |
185 | 196 | | |
| |||
0 commit comments