Skip to content

Commit

Permalink
Update runtests.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge authored Jan 2, 2025
1 parent 0742910 commit 137ee1d
Showing 1 changed file with 39 additions and 34 deletions.
73 changes: 39 additions & 34 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,52 @@ using Test: @testset, @test, @test_skip

const test_args = lowercase.(strip.(ARGS))

@info "" test_args

slurm_is_installed() = !isnothing(Sys.which("sbatch"))
lsf_is_installed() = !isnothing(Sys.which("bsub"))
qsub_is_installed() = !isnothing(Sys.which("qsub"))

include("elastic.jl")

if slurm_is_installed()
@info "Running the Slurm tests..." Sys.which("sbatch") test_args
include("slurm.jl")
else
if "slurm" in test_args
@error "ERROR: The Slurm tests were explicitly requested in ARGS, but sbatch was not found, so the Slurm tests cannot be run" Sys.which("sbatch") test_args
@test false
@testset "ClusterManagers.jl" begin
include("elastic.jl")

if slurm_is_installed()
@info "Running the Slurm tests..." Sys.which("sbatch")
include("slurm.jl")
else
@warn "sbatch was not found - Slurm tests will be skipped" Sys.which("sbatch") test_args
@test_skip false
if "slurm" in test_args
@error "ERROR: The Slurm tests were explicitly requested in ARGS, but sbatch was not found, so the Slurm tests cannot be run" Sys.which("sbatch") test_args
@test false
else
@warn "sbatch was not found - Slurm tests will be skipped" Sys.which("sbatch")
@test_skip false
end
end
end

if lsf_is_installed()
@info "Running the LSF tests..." Sys.which("bsub")
include("lsf.jl")
else
if "lsf" in test_args
@error "ERROR: The LSF tests were explicitly requested in ARGS, but bsub was not found, so the LSF tests cannot be run" Sys.which("bsub") test_args
@test false

if lsf_is_installed()
@info "Running the LSF tests..." Sys.which("bsub")
include("lsf.jl")
else
@warn "bsub was not found - LSF tests will be skipped" Sys.which("bsub") test_args
@test_skip false
if "lsf" in test_args
@error "ERROR: The LSF tests were explicitly requested in ARGS, but bsub was not found, so the LSF tests cannot be run" Sys.which("bsub") test_args
@test false
else
@warn "bsub was not found - LSF tests will be skipped" Sys.which("bsub")
@test_skip false
end
end
end

if qsub_is_installed()
@info "Running the SGE tests..." Sys.which("qsub")
include("slurm.jl")
else
if "slurm" in test_args
@error "ERROR: The SGE tests were explicitly requested in ARGS, but qsub was not found, so the SGE tests cannot be run" Sys.which("qsub") test_args
@test false

if qsub_is_installed()
@info "Running the SGE tests..." Sys.which("qsub")
include("slurm.jl")
else
@warn "qsub was not found - SGE tests will be skipped" Sys.which("qsub") test_args
@test_skip false
if "slurm" in test_args
@error "ERROR: The SGE tests were explicitly requested in ARGS, but qsub was not found, so the SGE tests cannot be run" Sys.which("qsub") test_args
@test false
else
@warn "qsub was not found - SGE tests will be skipped" Sys.which("qsub")
@test_skip false
end
end
end

end # @testset

0 comments on commit 137ee1d

Please sign in to comment.