Skip to content

Commit 6114791

Browse files
Upgrade to ParallelTestRunner v2 (#693)
1 parent 837c890 commit 6114791

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2121
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2222

2323
[compat]
24-
ParallelTestRunner = "1"
24+
ParallelTestRunner = "2"

test/runtests.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,31 +67,31 @@ Metal.functional() || error("Metal.jl is not functional on this system. This is
6767
@info "System information:\n" * sprint(io->Metal.versioninfo(io))
6868

6969
# register custom tests that do not correspond to files in the test directory
70-
custom_tests = Dict{String, Expr}()
70+
testsuite = find_tests(@__DIR__)
7171
## GPUArrays test suite
7272
import GPUArrays
7373
gpuarrays = pathof(GPUArrays)
7474
gpuarrays_root = dirname(dirname(gpuarrays))
7575
gpuarrays_testsuite = joinpath(gpuarrays_root, "test", "testsuite.jl")
7676
include(gpuarrays_testsuite)
7777
for name in keys(TestSuite.tests)
78-
custom_tests["gpuarrays/$name"] = :(TestSuite.tests[$name](MtlArray))
78+
testsuite["gpuarrays/$name"] = :(TestSuite.tests[$name](MtlArray))
7979
end
8080

81+
args = parse_args(ARGS)
82+
8183
# filter out certain tests depending on the exact testing conditions
82-
function test_filter(name)
83-
if Metal.DefaultStorageMode != Metal.PrivateStorage && name == "gpuarrays/indexing scalar"
84+
if filter_tests!(testsuite, args)
85+
if Metal.DefaultStorageMode != Metal.PrivateStorage
8486
# GPUArrays' scalar indexing tests assume that indexing is not supported
85-
return false
87+
delete!(testsuite, "gpuarrays/indexing scalar")
8688
end
8789

8890
# for some reason, the environment shenanigans done by the scripts only work when
8991
# invoked from the Metal.jl CI, and not from GPUArrays.jl' reverse CI
90-
if get(ENV, "BUILDKITE_PIPELINE_NAME", "") != "Metal.jl" && name == "scripts"
91-
return false
92+
if get(ENV, "BUILDKITE_PIPELINE_NAME", "") != "Metal.jl"
93+
delete!(testsuite, "scripts")
9294
end
93-
94-
return true
9595
end
9696

9797
# workers to run tests on
@@ -157,4 +157,4 @@ init_code = quote
157157
end
158158
end
159159

160-
runtests(Metal, ARGS; custom_tests, test_filter, init_code, test_worker)
160+
runtests(Metal, args; testsuite, init_code, test_worker)

0 commit comments

Comments
 (0)