Commit 6df4e8d
fix(e2e): honor the live_download exclusion; fix runtime plugin search path (#68)
Follow-up to #67. The e2e workflow has been red on `main` for weeks —
first at compile (`--warnings-as-errors`), which #67 fixed; with compile
green, the `runtime-api` job then failed on `{:error, {:no_plugin,
"zig"}}` from tests that were never meant to run there. Two pre-existing
defects, both fixed at source:
## 1. Tag taxonomy — download tests ran in PR CI despite the exclusion
The live-download tests carried **both** `@tag :external_api` and `@tag
:live_download`. ExUnit's `--include` re-includes tests dropped by
`--exclude`, so
```
mix test --include external_api --exclude live_download
```
ran the ~10–50MB download tests that `e2e.yml`'s own header reserves for
manual dispatch. They now carry only `:live_download` (run manually via
`--include live_download`), matching the taxonomy defined at the top of
the test file.
## 2. Plugin search path — `Manager.install` couldn't resolve plugins
from a checkout
`@plugin_search_dirs` was a **module attribute**, so
`:code.priv_dir(:opsm)` was frozen at *compile* time, pointing inside
whatever `_build` compiled the module — its own comment said "resolved
at runtime", an intent that never held. Result: `runtime/core/*.ncl`
plugins were unreachable from any repo checkout (this also breaks the
`opsm runtime install` dogfooding path that reads `opsm.toml
[runtime]`).
Search dirs are now computed per call, with repo-checkout fallbacks
(`cwd/../runtime/core` under mix, `cwd/runtime/core` as escript) and a
fail-safe guard on `:code.priv_dir/1`. `find_plugin_ncl/1` is `@doc
false` public with unit tests covering checkout resolution.
Also hardened: `System.cmd("nickel", …)` raises `ErlangError :enoent`
when nickel isn't installed — now returns `{:error,
{:nickel_not_installed, tool}}`.
## Verified (OTP 28.3.1 / Elixir 1.19.5)
- `mix compile --warnings-as-errors` — green
- `mix test test/opsm/runtime/manager_test.exs` — 17/17 (2 new
`find_plugin_ncl` tests)
- The exact `runtime-api` CI command — **9 tests, 0 failures, 6
excluded**, live against ziglang.org / go.dev / nodejs.org; both
previously-failing tests correctly excluded
Note: the branch was restarted from `main` after #67's squash-merge (the
old remote branch was auto-deleted on merge), so this PR contains only
the follow-up commit.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Kq24sZCEohSrNFXSuEuz6C
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Kq24sZCEohSrNFXSuEuz6C)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6933186 commit 6df4e8d
3 files changed
Lines changed: 60 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
304 | 316 | | |
305 | | - | |
306 | | - | |
307 | 317 | | |
308 | 318 | | |
309 | 319 | | |
310 | 320 | | |
311 | 321 | | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
317 | 340 | | |
318 | | - | |
319 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
320 | 344 | | |
321 | 345 | | |
322 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | 143 | | |
145 | 144 | | |
146 | 145 | | |
| |||
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
161 | | - | |
162 | 160 | | |
163 | 161 | | |
164 | 162 | | |
| |||
175 | 173 | | |
176 | 174 | | |
177 | 175 | | |
178 | | - | |
179 | 176 | | |
180 | 177 | | |
181 | 178 | | |
| |||
185 | 182 | | |
186 | 183 | | |
187 | 184 | | |
188 | | - | |
189 | 185 | | |
190 | 186 | | |
191 | 187 | | |
| |||
202 | 198 | | |
203 | 199 | | |
204 | 200 | | |
205 | | - | |
206 | 201 | | |
207 | 202 | | |
208 | 203 | | |
| |||
229 | 224 | | |
230 | 225 | | |
231 | 226 | | |
232 | | - | |
233 | 227 | | |
234 | 228 | | |
235 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
108 | 126 | | |
109 | 127 | | |
110 | 128 | | |
| |||
0 commit comments