HrdpsClient already calls Req.get/head with req_options() that
merge :hrdps_req_options from config. Add plug: {Req.Test, HrdpsClient}
to test config so Req.Test.stub intercepts HTTP calls — same pattern
as HrrrClient. Also add hrdps_cycle_available_fn default so the
HTTP probe doesn't fire in tests.
Replace the env-based Application.put_env stubs in DataCase with
Req.Test.stub(HrdpsClient, 404).
Add default NarrClient 404 stub to DataCase so incidental inline
NarrFetchWorker execution doesn't log 500 errors in unrelated tests.
Add DBConnection.Holder to the sandbox-cleanup noise suppression list
— same benign 'owner exited' category as the already-suppressed
Postgrex.Protocol and DBConnection.Connection.
Replace the non-idiomatic :auto sandbox mode with :manual, eliminating
the root cause of stale data across test runs. The :auto mode let any
process auto-checkout and commit outside test transactions — Oban in
testing:inline already disables plugins/queues, so :auto was never
needed.
Changes:
- test_helper: Sandbox.mode(Repo, :manual); drop manual app boot (mix
now starts the app idiomatically), drop --no-start alias, drop
table-cleanup loop
- DataCase: single reset_test_state/0 consolidates GridCache.clear,
ScoreCache.clear, score-file wipe, and default HTTP stubs; drop
the :auto-restore on_exit hack; setup_sandbox now just start_owner
- ConnCase: delegates shared reset to DataCase, removes duplicate
cache clears and stub installs
- config: pool Ecto.Adapters.SQL.Sandbox (idiomatic canonical form)
Note: GridCache/ScoreCache are globally-registered GenServers, so
the architecturally clean per-test start_supervised! approach
conflicts with async:true (parallel tests can't register the same
name). The centralized clear in reset_test_state is the practical
compromise — one place, documented, single call.
- nix/wgrib2.nix: build wgrib2 3.8.0 from source with NCEPLIBS-g2c 2.3.0,
matching the Dockerfile.base build.
- flake.nix: wire wgrib2 derivation into dev shell so direnv loads it.
- DataCase: call Req.Test.set_req_test_from_context/1 in setup so
async:false tests get shared Req.Test mode, making stubs visible
to Tasks spawned by async_stream_nolink.
- Delete Microwaveprop.Aprs, AprsRepo, Aprs.PathParser modules
- Delete Mix.Tasks.Calibrate.Aprs144 mix task
- Remove AprsRepo from application.ex children and config files
- Remove APRS test files and sandbox references in test_helper
- Fix credo nested-module alias suggestions in conn_case.ex
Read-side cutover for the binary scores store and a companion
cleanup that removes the biggest remaining DB write from the hot
path.
Propagation.scores_at/3, available_valid_times/1, latest_valid_time/0,
latest_valid_time/1, earliest_valid_time/1, point_detail/4, and
point_forecast/3 all now prefer ScoresFile and fall back to the
propagation_scores table when a file is missing. The map render
path reads from /data/scores first; Postgres stays as a safety
net while dual-write is on. point_detail still pulls factors from
Postgres (analysis-hour rows only) and coalesces nil to an empty
map so the JS popup iterates cleanly.
replace_scores/2 is now gated by a postgres_writes_enabled? flag
(runtime env MICROWAVEPROP_SCORES_POSTGRES=false, or the
:propagation_scores_postgres app env key) so the binary-only path
can be benchmarked locally without the DB insert. Default stays
true.
PropagationGridWorker no longer calls store_hrrr_profiles —
persisting 92k grid rows × 19 forecast hours of JSONB profiles
was ~12 min of wall time per chain for a table only
AsosAdjustmentWorker read from. Per-contact HRRR enrichment
through HrrrFetchWorker still writes its own (is_grid_point:
false) rows. AsosAdjustmentWorker is disabled in all three cron
configs since its data source is gone.
DataCase resets the scores tree between tests so per-test
ScoresFile writes don't leak across cases, and ScoresFileTest
switches to async: false because it mutates the global
:propagation_scores_dir env.