Skip to content

Commit 3f3ad08

Browse files
committed
Simplify test skipping.
1 parent 6788dba commit 3f3ad08

File tree

6 files changed

+30
-44
lines changed

6 files changed

+30
-44
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ steps:
5454
plugins:
5555
- JuliaCI/julia#v1:
5656
version: 1.8
57-
- JuliaCI/julia-test#v1:
58-
test_args: "--thorough"
57+
- JuliaCI/julia-test#v1: ~
5958
- JuliaCI/julia-coverage#v1:
6059
dirs:
6160
- src

test/core/device/intrinsics/wmma.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if capability(device()) < v"7.0"
2+
@warn "Device capability too low, skipping WMMA tests"
3+
else
4+
15
using CUDA.WMMA
26

37
map_ptx_to_jl_frag = Dict(
@@ -363,3 +367,5 @@ end
363367
@test occursin(r"wmma.store.d.sync(.aligned)?.col.m16n16k16.shared.f32", ptx)
364368
end
365369
end
370+
371+
end

test/core/device/random.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
if VERSION < v"1.6.1"
2+
@warn "Julia version too old, skipping random tests"
3+
else
4+
15
using Random
26

37
n = 256
@@ -125,3 +129,5 @@ end
125129
@test Array(a) == Array(b)
126130
end
127131
end
132+
133+
end

test/core/nvml.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ macro maybe_unsupported(ex)
1010
end
1111
end
1212

13+
if !has_nvml()
14+
@warn "NVML not available, skipping tests"
15+
else
16+
1317
@testset "system" begin
1418
@test NVML.version() isa VersionNumber
1519
@test NVML.driver_version() isa VersionNumber
@@ -57,3 +61,5 @@ end
5761
NVML.compute_processes(dev)
5862
end
5963
end
64+
65+
end

test/libraries/cusolver/multigpu.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
using LinearAlgebra, Test
2-
using CUDA
1+
using CUDA.CUSOLVER
32

3+
if !has_cusolvermg()
4+
@warn "CUSOLVERMG not available, skipping tests"
5+
else
6+
7+
using LinearAlgebra
48
import LinearAlgebra: BlasInt
59

610
m = 256
@@ -107,3 +111,5 @@ if CUSOLVER.version() >= v"10.3"
107111
end
108112
end
109113
end
114+
115+
end

test/runtests.jl

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ if do_help
4141
4242
--help Show this text.
4343
--list List all available tests.
44-
--thorough Don't allow skipping tests that are not supported.
4544
--quickfail Fail the entire run as soon as a single test errored.
4645
--jobs=N Launch `N` processes to perform tests (default: Sys.CPU_THREADS).
4746
--gpu=1,2,... Which GPUs to use (comma-separated list of indices, default: all)
@@ -52,7 +51,6 @@ if do_help
5251
end
5352
set_jobs, jobs = extract_flag!(ARGS, "--jobs"; typ=Int)
5453
do_sanitize, sanitize_tool = extract_flag!(ARGS, "--sanitize", "memcheck")
55-
do_thorough, _ = extract_flag!(ARGS, "--thorough")
5654
do_quickfail, _ = extract_flag!(ARGS, "--quickfail")
5755
do_gpu_list, gpu_list = extract_flag!(ARGS, "--gpu")
5856
do_list, _ = extract_flag!(ARGS, "--list")
@@ -145,51 +143,16 @@ else
145143
map(gpu_entry, CUDA.devices())
146144
end
147145
@info("Testing using device " * join(map(gpu->"$(gpu.id) ($(gpu.name))", gpus), ", ", " and ") *
148-
". To change this, specify the `--gpus` argument to the test, or set the `CUDA_VISIBLE_DEVICES` environment variable.")
146+
". To change this, specify the `--gpus` argument to the tests, or set the `CUDA_VISIBLE_DEVICES` environment variable.")
149147
ENV["CUDA_VISIBLE_DEVICES"] = join(map(gpu->gpu.uuid, gpus), ",")
150148

151-
# determine tests to skip
152-
skip_tests = []
153-
has_cusolvermg() || push!(skip_tests, "libraries/cusolver/multigpu")
154-
has_nvml() || push!(skip_tests, "core/nvml")
155-
if first(gpus).cap < v"7.0"
156-
push!(skip_tests, "core/device/intrinsics/wmma")
157-
end
158-
if Sys.ARCH == :aarch64
159-
# CUFFT segfaults on ARM
160-
push!(skip_tests, "libraries/cufft")
161-
end
162-
if VERSION < v"1.6.1-"
163-
push!(skip_tests, "core/device/random")
164-
end
165-
for (i, test) in enumerate(skip_tests)
166-
# we find tests by scanning the file system, so make sure the path separator matches
167-
skip_tests[i] = replace(test, '/'=>Base.Filesystem.path_separator)
168-
end
169-
# skip_tests is a list of patterns, expand it to actual tests we were going to run
170-
skip_tests = filter(test->any(skip->occursin(skip,test), skip_tests), tests)
171-
if do_thorough
172-
# we're not allowed to skip tests, so make sure we will mark them as such
173-
all_tests = copy(tests)
174-
if !isempty(skip_tests)
175-
@error "Skipping the following tests: $(join(skip_tests, ", "))"
176-
filter!(!in(skip_tests), tests)
177-
end
178-
else
179-
if !isempty(skip_tests)
180-
@info "Skipping the following tests: $(join(skip_tests, ", "))"
181-
filter!(!in(skip_tests), tests)
182-
end
183-
all_tests = copy(tests)
184-
end
185-
186149
# determine parallelism
187150
if !set_jobs
188151
cpu_jobs = Sys.CPU_THREADS
189152
memory_jobs = Int(Sys.free_memory()) ÷ (2 * 2^30)
190153
jobs = min(cpu_jobs, memory_jobs)
191154
end
192-
@info "Running $jobs tests in parallel. If this is too many, specify the `--jobs` argument to the tests, or set the JULIA_CPU_THREADS environment variable."
155+
@info "Running $jobs tests in parallel. If this is too many, specify the `--jobs` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable."
193156

194157
# add workers
195158
const test_exeflags = Base.julia_cmd()
@@ -481,7 +444,7 @@ for (testname, (resp,)) in results
481444
Test.pop_testset()
482445
end
483446
end
484-
for test in all_tests
447+
for test in tests
485448
(test in completed_tests) && continue
486449
fake = Test.DefaultTestSet(test)
487450
Test.record(fake, Test.Error(:test_interrupted, test, nothing,

0 commit comments

Comments
 (0)