fix(tests): keep live_download out of the default suite; stop org re-crawl on warm-cache miss - #70
Merged
Conversation
…crawl on warm-cache miss Two fixes that turn the e2e workflow green on main (run #47 failed on both attempts): - test_helper.exs: :live_download was never in the default ExUnit exclusion list — it was only ever kept out of 'mix test' by riding on the :external_api tag. Removing that tag in #68 therefore leaked the ~10-50MB download tests into the default suite, where they fail on runners without nickel ({:nickel_not_installed, "zig"}). Exclude :live_download explicitly; run them via --include live_download. - HyperpPolymathForge.fetch_package/2: a per-name cache miss triggered a full GitHub org re-crawl even when the index was already populated, so any absent package name burned unauthenticated rate limit and surfaced {:http_error, 401/403} instead of :not_found (the ETS-seeded 'no network fallback' test documents the intended contract, and CI runners hit this deterministically). A miss against a warm cache now returns :not_found without touching the network; a cold cache still refreshes and still propagates refresh errors. Warmth criterion mirrors ensure_index/0. Verified on OTP 28.3.1 / Elixir 1.19.5 — all three CI test commands green locally: full default suite 807 tests 0 failures, e2e step 55/55, runtime-api step 9/9 (6 excluded); compile --warnings-as-errors clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kq24sZCEohSrNFXSuEuz6C
hyperpolymath
marked this pull request as ready for review
July 17, 2026 04:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the loop on the e2e redness:
main's e2e run #47 failed on both attempts (I re-ran its failed jobs to confirm determinism). Local reproduction on the exact toolchain identified two causes — one introduced by #68, one long-latent:1.
:live_downloadleaked into the default suite (regression from #68)test_helper.exsnever excluded:live_download— those tests were only kept out ofmix testby riding on their:external_apitag. When #68 removed that tag (correctly, to fix the--include/--excludeinteraction), the ~10–50MB download tests fell into the default suite, where the e2e-opsm "Run all tests" step runs them on runners without nickel →{:error, {:nickel_not_installed, "zig"}}× 2. Fix: exclude:live_downloadexplicitly inExUnit.start/1; run them deliberately via--include live_download.2.
HyperpPolymathForge.fetch_package/2re-crawled the GitHub org on every missA per-name cache miss triggered
refresh_index()— a full unauthenticated org listing — even when the index was already populated. Any absent package name burned rate limit, and on CI runners the 403 surfaced as{:error, {:http_error, 403}}instead of{:error, :not_found}. The ETS-seeded test athyperpolymath_forge_test.exs:321documents the intended contract ("cache is non-empty, so refresh_index won't fire") — the implementation just never honored it. A miss against a warm cache now returns:not_foundwith no network I/O; a cold cache still refreshes and still propagates refresh errors. The warmth criterion mirrors the existingensure_index/0.Verified (OTP 28.3.1 / Elixir 1.19.5)
mix compile --warnings-as-errors— cleanmix test) — 807 tests, 0 failures (previously 2)--include e2e --include integration) — 55/55--include external_api --exclude live_download) — 9/9, 6 excludedjust toolchain-check— greenWith this, all three e2e workflow test commands pass locally against
main's toolchain; the only expected remaining red on this PR is the pre-existing governance ReScript policy check (fails identically onmain; owner-decision).🤖 Generated with Claude Code
https://claude.ai/code/session_01Kq24sZCEohSrNFXSuEuz6C
Generated by Claude Code