fix: wire HrdpsClient into Req.Test plug pipeline
Some checks failed
Build and Push / Build and Push Docker Image (push) Failing after 13m28s

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).
This commit is contained in:
Graham McIntire 2026-08-04 17:56:20 -05:00
parent 78013f8904
commit 09e65462f5
No known key found for this signature in database
GPG key ID: F4ABF488E6029E59
2 changed files with 6 additions and 0 deletions

View file

@ -95,6 +95,8 @@ config :microwaveprop, cache_contact_map: false
config :microwaveprop, elevation_req_options: [plug: {Req.Test, Microwaveprop.Terrain.ElevationClient}, retry: false]
config :microwaveprop, gefs_req_options: [plug: {Req.Test, Microwaveprop.Weather.GefsClient}, retry: false]
config :microwaveprop, giro_req_options: [plug: {Req.Test, Microwaveprop.Ionosphere.GiroClient}, retry: false]
config :microwaveprop, hrdps_cycle_available_fn: fn _run_time -> true end
config :microwaveprop, hrdps_req_options: [plug: {Req.Test, Microwaveprop.Weather.HrdpsClient}, retry: false]
# Default the HRRR cycle freshness probe to "always available" in tests.
# Individual cases that exercise the fallback path override via

View file

@ -58,6 +58,10 @@ defmodule Microwaveprop.DataCase do
Plug.Conn.send_resp(conn, 404, "not found")
end)
Req.Test.stub(Microwaveprop.Weather.HrdpsClient, fn conn ->
Plug.Conn.send_resp(conn, 404, "not found")
end)
:ok
end