diff --git a/test/condor.jl b/test/condor.jl new file mode 100644 index 0000000..cf87cf8 --- /dev/null +++ b/test/condor.jl @@ -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] diff --git a/test/runtests.jl b/test/runtests.jl index b0093e9..6f55139 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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