Skip to content

Commit e8d7d9a

Browse files
committed
tests: Add offline mode
1 parent ecfdbb8 commit e8d7d9a

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
@@ -34,7 +34,10 @@ if PROGRAM_FILE != "" && realpath(PROGRAM_FILE) == @__FILE__
3434
pushfirst!(LOAD_PATH, joinpath(@__DIR__, ".."))
3535
using Pkg
3636
Pkg.activate(@__DIR__)
37-
Pkg.instantiate()
37+
try
38+
Pkg.instantiate()
39+
catch
40+
end
3841

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

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

0 commit comments

Comments
 (0)