Skip to content

Commit da5be3f

Browse files
committed
Fixup tests and tweak env var handling
1 parent 046603d commit da5be3f

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ steps:
2121
env:
2222
GROUP: "All"
2323
TEST_FAST: true
24-
TEST_WORKERS: 4
24+
RETESTITEMS_NWORKERS: 4
2525
if: build.message !~ /\[skip tests\]/
2626
timeout_in_minutes: 180
2727
matrix:

test/convnet_tests.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ end
170170
end
171171

172172
@testitem "EfficientNet" setup=[TestModels] begin
173-
config = TEST_FAST ? [:b0] : [:b0, :b1, :b2, :b3, :b4, :b5] #:b6, :b7, :b8]
173+
configs = TEST_FAST ? [:b0] : [:b0, :b1, :b2, :b3, :b4, :b5] #:b6, :b7, :b8]
174174
@testset "EfficientNet($config)" for config in configs
175175
# preferred image resolution scaling
176176
r = Metalhead.EFFICIENTNET_GLOBAL_CONFIGS[config][1]
@@ -235,7 +235,11 @@ end
235235
m = SqueezeNet() |> gpu
236236
@test size(m(x_224)) == (1000, 1)
237237
if SqueezeNet in PRETRAINED_MODELS
238-
@test acctest(SqueezeNet(; pretrain = true))
238+
if VERSION >= v"1.7"
239+
@test acctest(SqueezeNet(; pretrain = true))
240+
else
241+
@test_broken acctest(SqueezeNet(; pretrain = true))
242+
end
239243
else
240244
@test_throws ArgumentError SqueezeNet(pretrain = true)
241245
end

test/model_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ end
7272
const TEST_LBLS = readlines(download("https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt"))
7373

7474
function acctest(model)
75-
ypred = gpu(model)(TEST_X) |> vec
75+
ypred = gpu(model)(TEST_X) |> collect |> vec
7676
top5 = TEST_LBLS[sortperm(ypred; rev = true)]
7777
return "monarch" in top5
7878
end

test/runtests.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ const name_filter = test_group == "All" ? nothing : Regex(test_group)
77

88
@static if VERSION >= v"1.7"
99
using ReTestItems
10-
verbose_results = get(ENV, "CI", "false") == "true"
11-
nworkers = parse(Int, get(ENV, "TEST_WORKERS", "0"))
12-
runtests(Metalhead; name = name_filter, verbose_results, nworkers)
10+
if parse(Bool, get(ENV, "CI", "false"))
11+
runtests(Metalhead; name = name_filter, verbose_results = true)
12+
else
13+
# For running locally
14+
runtests(Metalhead; name = name_filter)
15+
end
1316
else
1417
using TestItemRunner
1518
function testitem_filter(ti)

0 commit comments

Comments
 (0)