Skip to content

Commit 1c806e9

Browse files
committed
tests: Add offline mode
1 parent 2d75603 commit 1c806e9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

test/runtests.jl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ if PROGRAM_FILE != "" && realpath(PROGRAM_FILE) == @__FILE__
3535
pushfirst!(LOAD_PATH, joinpath(@__DIR__, ".."))
3636
using Pkg
3737
Pkg.activate(@__DIR__)
38-
Pkg.instantiate()
38+
try
39+
Pkg.instantiate()
40+
catch
41+
end
3942

4043
using ArgParse
4144
s = ArgParseSettings(description = "Dagger Testsuite")
@@ -55,6 +58,9 @@ if PROGRAM_FILE != "" && realpath(PROGRAM_FILE) == @__FILE__
5558
"-v", "--verbose"
5659
action = :store_true
5760
help = "Run the tests with debug logs from Dagger"
61+
"-O", "--offline"
62+
action = :store_true
63+
help = "Set Pkg into offline mode"
5864
end
5965
end
6066

@@ -88,6 +94,11 @@ if PROGRAM_FILE != "" && realpath(PROGRAM_FILE) == @__FILE__
8894
if parsed_args["verbose"]
8995
ENV["JULIA_DEBUG"] = "Dagger"
9096
end
97+
98+
if parsed_args["offline"]
99+
Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true
100+
Pkg.offline(true)
101+
end
91102
else
92103
to_test = all_test_names
93104
@info "Running all tests"

0 commit comments

Comments
 (0)