Req#22
Merged
Merged
Conversation
Builds a safety net of opt-in integration tests against real hosts
(httpbin.org, badssl.com, hex.pm, github.com, rocketvalidator.com)
covering behaviors that mocks can't catch: TLS handshakes, gzip
streams, redirect chains, basic auth, DNS failures, and full page /
sitemap scraping pipelines.
- test/support/integration_urls.exs: shared URL helpers and a
with_transient_retry/2 helper that retries 502/503/504 and timeouts
while letting permanent errors (401/403/404/500) propagate.
- test/integration/{resolver,tls,compression,page_scraper,sitemap}_integration_test.exs:
one file per behavioral area, all tagged :integration and excluded
from the default mix test run.
- mix test.all alias for running unit + integration in one command,
wired through preferred_cli_env so it runs in :test.
- AGENTS.md: documents the new alias.
Introduce Funkspector.HTTP.Adapter behaviour with two adapters:
Funkspector.HTTP.Adapters.Req (new default, Finch/Mint-backed,
hackney-free) and Funkspector.HTTP.Adapters.HTTPoison (opt-in,
preserves the pre-2.0 transport).
Normalize HTTP results across adapters via new %Funkspector.Response{}
and %Funkspector.Error{} structs. Adapter selection is configurable
app-wide (`config :funkspector, :http_adapter, …`) and per-call via the
`:adapter` option.
Make :httpoison and :hackney optional deps; add :req as a required dep.
Add Mix aliases `mix test.httpoison` and `mix test.adapters` so the
full unit + integration suite can be exercised against both adapters.
Breaking: %HTTPoison.Error{} → %Funkspector.Error{} and
%HTTPoison.Response{} → %Funkspector.Response{} in error/response
returns. The :reason atom (`:nxdomain`, `:timeout`, …) is unchanged.
Owner
Author
|
@copilot review |
I reviewed the PR as requested and did not find any additional changes to apply on top of the current branch state (head commit: |
The adapter module references %HTTPoison.Response{} and %HTTPoison.Error{}
structs at compile time, so it could not be compiled in a consumer
project that drops httpoison from its deps — even though mix.exs already
declares httpoison as optional: true.
Wrap the defmodule block in Code.ensure_loaded?(HTTPoison) so the module
is only defined when HTTPoison is actually available. Funkspector's own
test matrix still pulls HTTPoison transitively (optional deps are
included in the package's own build), so test.adapters keeps exercising
both adapters.
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.
No description provided.