-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added actual tests, slight code refactoring
- Loading branch information
Showing
8 changed files
with
111 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# VSCode | ||
/.vscode | ||
/HPCMod.code-workspace | ||
# some temp internal tests | ||
/bridges2 | ||
/simple1 | ||
/stampede2skx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#using Pkg | ||
#Pkg.status() | ||
|
||
#using Revise | ||
using HPCMod | ||
|
||
# run dev test | ||
include("../examples/simple1.jl") | ||
|
||
# run tests manually | ||
include("../test/runtests.jl") | ||
|
||
# run tests | ||
Pkg.test() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
using HPCMod | ||
using Test | ||
|
||
@testset "HPCMod.jl" begin | ||
@test HPCMod.hello_world() == "Hello world" | ||
include("testset1.jl") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using HPCMod | ||
using Random | ||
using DataFrames | ||
|
||
@testset "BatchJob Comparison" begin | ||
sim = Simulation() | ||
add_resource!(sim) | ||
user = User(sim) | ||
task = user.inividual_jobs_task | ||
jobs = user.inividual_jobs | ||
|
||
job1 = BatchJob(sim, task; nodes=2, walltime=10, submit_time=12, jobs_list=jobs) | ||
job2 = BatchJob(sim, task; nodes=2, walltime=10, submit_time=15, jobs_list=jobs) | ||
job3 = BatchJob(sim, task; nodes=2, walltime=10, submit_time=10, jobs_list=jobs) | ||
job4 = BatchJob(sim, task; nodes=2, walltime=10, submit_time=14, jobs_list=jobs) | ||
job5 = BatchJob(sim, task; nodes=2, walltime=10, submit_time=14, jobs_list=jobs) | ||
|
||
# compare by submit_time | ||
@test job1 < job2 | ||
@test job4 > job3 | ||
@test (job4 > job5) == false | ||
@test (job4 < job5) == false | ||
@test (job4 == job5) == false | ||
|
||
# pop test for user's inividual_jobs, sooner jobs pops first | ||
@test pop!(jobs).id==3 | ||
@test pop!(jobs).id==1 | ||
@test pop!(jobs).id==4 | ||
@test pop!(jobs).id==5 | ||
@test pop!(jobs).id==2 | ||
|
||
# jobs are still in sim.jobs_list | ||
@test length(sim.jobs_list)==5 | ||
|
||
end | ||
|
||
|
||
@testset "Simple Run" begin | ||
include("../examples/simple1.jl") | ||
|
||
# check that it at lest produce something | ||
@test nrow(mdf) > 100 | ||
@test sum(mdf.used_nodes) > 0 | ||
@test sum(mdf.jobs_in_queue) > 0 | ||
@test sum(mdf.jobs_running) > 0 | ||
@test sum(mdf.jobs_done) > 0 | ||
|
||
end |