Skip to content

Commit

Permalink
Commit unfinished work needed to fix test downloads from MaxMind
Browse files Browse the repository at this point in the history
  • Loading branch information
g-andrade committed Jul 20, 2024
1 parent 65742f3 commit 329f5c9
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/locus_remote_sources_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ groups() ->

should_run_remote_http_tests() ->
currently_checkedout_commit_is_likely_tagged()
andalso license_key_from_environment_is_defined().
andalso license_key_from_environment_is_defined()
% FIXME 2024/07/20 got rate limited by MaxMind when fixing tests
andalso list_to_atom("false").

currently_checkedout_commit_is_likely_tagged() ->
{ok, _} = application:ensure_all_started(locus),
Expand Down Expand Up @@ -205,12 +207,16 @@ cacheless_loading_test(Config) ->

{maxmind, _} ->
?assertRecv({locus, Loader, {request_sent, _URL, _Headers}}),
?assertRecv({locus, Loader, {download_redirected, _Info}}),
?assertRecv({locus, Loader, {request_sent, _, _}}),
?assertRecv({locus, Loader, {download_started, _Headers}}),
?assertRecv({locus, Loader, {download_finished, _BytesReceived,
{ok, _TrailingHeaders}}}),

?assertRecv({locus, Loader, {checksum, {request_sent, _ChecksumURL,
_ChecksumReqHeaders}}}),
?assertRecv({locus, Loader, {checksum, {download_redirected, _Info}}}),
?assertRecv({locus, Loader, {checksum, {request_sent, _, _}}}),
?assertRecv({locus, Loader, {checksum, {download_started,
_ChecksumRespHeaders}}}),
?assertRecv({locus, Loader, {checksum, {download_finished,
Expand Down Expand Up @@ -247,6 +253,8 @@ cold_remote_loading_test(Config) ->

{maxmind, _} ->
?assertRecv({locus, Loader, {request_sent, _URL, _Headers}}),
?assertRecv({locus, Loader, {download_redirected, _Info}}),
?assertRecv({locus, Loader, {request_sent, _, _}}),
?assertRecv({locus, Loader, {download_started, _Headers}}),
?assertRecv({locus, Loader, {download_finished, _BytesReceived,
{ok, _TrailingHeaders}}}),
Expand Down Expand Up @@ -461,6 +469,14 @@ idle_download_timeout_httptest(Config) ->
(fun F(AttemptsLeft) ->
ok = locus:start_loader(Loader, LoadFrom, LoaderOpts),
?assertRecv({locus, Loader, {request_sent, _URL, _Headers}}),

case LoadFrom of
{maxmind, _} ->
?assertRecv({locus, Loader, {download_redirected, _Info}}),
?assertRecv({locus, Loader, {request_sent, _, _}});
_ -> ok
end,

?assertRecv({locus, Loader, {download_started, _Headers}}),
try ?assertRecv({locus, Loader, {download_finished, _BytesReceived,
{error, timeout}}})
Expand Down

0 comments on commit 329f5c9

Please sign in to comment.