Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/condor.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@test Distributed.nprocs() == 1
@test Distributed.nworkers() == 1
@test Distributed.procs() == [1]
@test Distributed.workers() == [1]

mgr = HTCManager(4)
Distributed.addprocs(mgr)

@test Distributed.nprocs() == 5
@test Distributed.nworkers() == 4
@test Distributed.procs() == [1, 2, 3, 4, 5]
@test Distributed.workers() == [2, 3, 4, 5]
39 changes: 2 additions & 37 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,12 @@ using Distributed: workers, nworkers
using Distributed: procs, nprocs
using Distributed: remotecall_fetch, @spawnat
using Test: @testset, @test, @test_skip
# ElasticManager:
using HTCondorClusterManager: ElasticManager
# Slurm:
using HTCondorClusterManager: addprocs_slurm, SlurmManager
# SGE:
using HTCondorClusterManager: addprocs_sge, SGEManager

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

@info "" test_args

slurm_is_installed() = !isnothing(Sys.which("sbatch"))
qsub_is_installed() = !isnothing(Sys.which("qsub"))
using HTCondorClusterManager: addprocs_htc, HTCManager

@testset "HTCondorClusterManager.jl" begin
include("elastic.jl")

if slurm_is_installed()
@info "Running the Slurm tests..." Sys.which("sbatch")
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
else
@warn "sbatch was not found - Slurm tests will be skipped" Sys.which("sbatch")
@test_skip false
end
end

if qsub_is_installed()
@info "Running the SGE (via qsub) tests..." Sys.which("qsub")
include("sge_qsub.jl")
else
if "sge_qsub" 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
include("condor.jl")

end # @testset
Loading