Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

choosetests: add the --force-net option, which will throw an error if networking is unavailable #42889

Merged
merged 1 commit into from
Nov 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion test/choosetests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function choosetests(choices = [])
exit_on_error = false
use_revise = false
seed = rand(RandomDevice(), UInt128)
force_net = false
dryrun = false

for (i, t) in enumerate(choices)
Expand All @@ -77,6 +78,8 @@ function choosetests(choices = [])
use_revise = true
elseif startswith(t, "--seed=")
seed = parse(UInt128, t[8:end])
elseif t == "--force-net"
force_net = true
elseif t == "--help-list"
dryrun = true
elseif t == "--help"
Expand Down Expand Up @@ -149,7 +152,12 @@ function choosetests(choices = [])
net_on = true
try
ipa = getipaddr()
catch
catch ex
if force_net
msg = "Networking is unavailable, and the `--force-net` option was passed"
@error msg
rethrow()
end
@warn "Networking unavailable: Skipping tests [" * join(net_required_for, ", ") * "]"
net_on = false
end
Expand Down