Skip to content

Commit 386189d

Browse files
authored
Merge pull request #38 from DilumAluthge-forks/dpa/info-statements
Test suite: Change some `println()` statements to `@info` statements
2 parents 83fe844 + 829091d commit 386189d

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

test/runtests.jl

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,42 @@ end
1818
@testset "SlurmClusterManager.jl" begin
1919
# test that slurm is available
2020
@test !(Sys.which("sinfo") === nothing)
21-
21+
2222
# submit job
2323
# project should point to top level dir so that SlurmClusterManager is available to script.jl
2424
project_path = abspath(joinpath(@__DIR__, ".."))
25-
println("project_path = $project_path")
25+
@info "" project_path
2626
jobid = withenv("JULIA_PROJECT"=>project_path) do
2727
strip(read(`sbatch --export=ALL --parsable -n 4 -o test.out script.jl`, String))
2828
end
29-
println("jobid = $jobid")
30-
29+
@info "" jobid
30+
3131
# get job state from jobid
3232
getjobstate = jobid -> begin
3333
cmd = Cmd(`scontrol show jobid=$jobid`, ignorestatus=true)
3434
info = read(cmd, String)
3535
state = match(r"JobState=(\S*)", info)
3636
return state === nothing ? nothing : state.captures[1]
3737
end
38-
38+
3939
# wait for job to complete
4040
status = timedwait(60.0, pollint=1.0) do
4141
state = getjobstate(jobid)
4242
state == nothing && return false
43-
println("jobstate = $state")
43+
@info "jobstate=$(state)"
4444
return state == "COMPLETED" || state == "FAILED"
4545
end
46-
46+
4747
state = getjobstate(jobid)
48-
48+
4949
# check that job finished running within timelimit (either completed or failed)
5050
@test status == :ok
5151
@test state == "COMPLETED"
52-
52+
5353
# print job output
5454
output = read("test.out", String)
55-
println("script output:")
55+
println("# BEGIN script output")
5656
println(output)
57+
println("# END script output")
5758

5859
end # testset "SlurmClusterManager.jl"

0 commit comments

Comments
 (0)