Skip to content

Commit 680cefa

Browse files
DilumAluthgerfourquet
authored andcommitted
Base.runtests: rename the --force-net option to --ci (#43168)
Co-authored-by: Rafael Fourquet <[email protected]> Co-authored-by: Rafael Fourquet <[email protected]> (cherry picked from commit e9430c9)
1 parent 1fdc09c commit 680cefa

File tree

2 files changed

+32
-26
lines changed

2 files changed

+32
-26
lines changed

.buildkite/pipelines/main/platforms/tester_linux.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,21 @@ steps:
6969
export NETWORK_RELATED_TESTS="Artifacts Downloads download LazyArtifacts LibGit2/online Pkg"
7070
7171
if [[ "${GROUP?}" == "all" ]]; then
72-
export TESTS="all LibGit2/online --force-net"
72+
export TESTS="all LibGit2/online --ci"
7373
elif [[ "${GROUP?}" == "all_except_pkg" ]]; then
74-
export TESTS="all LibGit2/online --force-net --skip Pkg"
74+
export TESTS="all LibGit2/online --ci --skip Pkg"
7575
elif [[ "${GROUP?}" == "g1" ]]; then
7676
# Group 1: ALL tests EXCEPT the network-related tests.
77-
export TESTS="all --force-net --skip $${NETWORK_RELATED_TESTS:?}"
77+
export TESTS="all --ci --skip $${NETWORK_RELATED_TESTS:?}"
7878
elif [[ "${GROUP?}" == "g2" ]]; then
7979
# Group 2: ONLY the network-related tests.
8080
# In Group 2, we use whatever the default setting is with regards to the Pkg server.
81-
export TESTS="$${NETWORK_RELATED_TESTS:?} --force-net"
81+
export TESTS="$${NETWORK_RELATED_TESTS:?} --ci"
8282
elif [[ "${GROUP?}" == "g3" ]]; then
8383
# Group 3: only Pkg.
8484
# In Group 3, we explicitly opt-out of the Pkg server.
8585
# The purpose of group 3 is to test the non-Pkg-server codepaths of Pkg.
86-
export TESTS="Pkg --force-net"
86+
export TESTS="Pkg --ci"
8787
export JULIA_PKG_SERVER=""
8888
else
8989
echo "Invalid value for GROUP: ${GROUP?}"

test/choosetests.jl

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ const TESTNAMES = [
2828
"boundscheck", "error", "ambiguous", "cartesian", "osutils",
2929
"channels", "iostream", "secretbuffer", "specificity",
3030
"reinterpretarray", "syntax", "corelogging", "missing", "asyncmap",
31-
"smallarrayshrink", "opaque_closure", "filesystem", "download"
31+
"smallarrayshrink", "opaque_closure", "filesystem", "download",
3232
]
3333

3434
"""
35-
3635
`(; tests, net_on, exit_on_error, seed) = choosetests(choices)` selects a set of tests to be
3736
run. `choices` should be a vector of test names; if empty or set to
3837
`["all"]`, all tests are selected.
@@ -65,7 +64,7 @@ function choosetests(choices = [])
6564
exit_on_error = false
6665
use_revise = false
6766
seed = rand(RandomDevice(), UInt128)
68-
force_net = false
67+
ci_option_passed = false
6968
dryrun = false
7069

7170
for (i, t) in enumerate(choices)
@@ -77,9 +76,9 @@ function choosetests(choices = [])
7776
elseif t == "--revise"
7877
use_revise = true
7978
elseif startswith(t, "--seed=")
80-
seed = parse(UInt128, t[8:end])
81-
elseif t == "--force-net"
82-
force_net = true
79+
seed = parse(UInt128, t[(length("--seed=") + 1):end])
80+
elseif t == "--ci"
81+
ci_option_passed = true
8382
elseif t == "--help-list"
8483
dryrun = true
8584
elseif t == "--help"
@@ -98,7 +97,11 @@ function choosetests(choices = [])
9897
9998
Or prefix a name with `-` (such as `-core`) to skip a particular test.
10099
""")
101-
return [], false, false, false, UInt128(0)
100+
return (; tests = [],
101+
net_on = false,
102+
exit_on_error = false,
103+
use_revise = false,
104+
seed = UInt128(0))
102105
elseif startswith(t, "--")
103106
error("unknown option: $t")
104107
elseif startswith(t, "-")
@@ -129,8 +132,8 @@ function choosetests(choices = [])
129132
end
130133
end
131134

132-
explicit_pkg = "Pkg" in tests
133-
explicit_libgit2 = "LibGit2/online" in tests
135+
explicit_pkg = "Pkg" in tests
136+
explicit_libgit2_online = "LibGit2/online" in tests
134137

135138
filtertests!(tests, "unicode", ["unicode/utf8"])
136139
filtertests!(tests, "strings", ["strings/basic", "strings/search", "strings/util",
@@ -151,22 +154,25 @@ function choosetests(choices = [])
151154
filter!(x -> (x != "Profile"), tests)
152155
end
153156

154-
net_required_for = ["download", "Sockets", "LibGit2", "LibCURL", "Downloads",
155-
"Artifacts", "LazyArtifacts"]
157+
net_required_for = [
158+
"Artifacts",
159+
"Downloads",
160+
"LazyArtifacts",
161+
"LibCURL",
162+
"LibGit2",
163+
"Sockets",
164+
"download",
165+
]
156166
net_on = true
157167
try
158168
ipa = getipaddr()
159-
catch ex
160-
if force_net
161-
msg = "Networking is unavailable, and the `--force-net` option was passed"
162-
@error msg
169+
catch
170+
if ci_option_passed
171+
@error("Networking unavailable, but `--ci` was passed")
163172
rethrow()
164173
end
165-
@warn "Networking unavailable: Skipping tests [" * join(net_required_for, ", ") * "]"
166174
net_on = false
167-
end
168-
169-
if !net_on
175+
@warn "Networking unavailable: Skipping tests [" * join(net_required_for, ", ") * "]"
170176
filter!(!in(net_required_for), tests)
171177
end
172178

@@ -194,8 +200,8 @@ function choosetests(choices = [])
194200
filter!(x -> (x != "stdlib" && !(x in STDLIBS)) , tests)
195201
append!(tests, new_tests)
196202

197-
requested_all || explicit_pkg || filter!(x -> x != "Pkg", tests)
198-
requested_all || explicit_libgit2 || filter!(x -> x != "LibGit2/online", tests)
203+
requested_all || explicit_pkg || filter!(x -> x != "Pkg", tests)
204+
requested_all || explicit_libgit2_online || filter!(x -> x != "LibGit2/online", tests)
199205

200206
# Filter out tests from the test groups in the stdlibs
201207
filter!(!in(tests), unhandled)

0 commit comments

Comments
 (0)