Skip to content

Commit

Permalink
fixed versioning tests
Browse files Browse the repository at this point in the history
  • Loading branch information
louisponet committed Jun 21, 2021
1 parent e986c6e commit aa79a2e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions test/job_control_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -286,23 +286,23 @@ rm(joinpath(job, DFControl.VERSION_DIR_NAME), recursive=true)

@testset "versioning" begin
job[:nbnd] = 30
job.version = 1
curver = DFControl.last_version(job)
save(job)
@test job.version == curver+1
save(job)
@test job.version == 2
@test ispath(joinpath(job, DFControl.VERSION_DIR_NAME))
@test ispath(joinpath(job, DFControl.VERSION_DIR_NAME, "1"))
@test ispath(joinpath(job, DFControl.VERSION_DIR_NAME, "$(curver+1)"))
job[:nbnd] = 40
save(job)
@test job.version == 3
@test job.version == curver + 3
@test job["scf"][:nbnd] == 40
switch_version(job, 2)
@test job.version == 2
@test !(2 versions(job))
@test DFControl.last_version(job) == 3
switch_version(job, curver+1)
@test job.version == curver+1
# @test DFControl.last_version(job) == 2
@test job["scf"][:nbnd] == 30
switch_version(job, 3)
@test !ispath(joinpath(job, DFControl.VERSION_DIR_NAME, "3"))
@test ispath(joinpath(job, DFControl.VERSION_DIR_NAME, "1"))
rm_version!(job, curver + 1)
@test !ispath(joinpath(job, DFControl.VERSION_DIR_NAME, "$(curver + 1)"))
@test ispath(joinpath(job, DFControl.VERSION_DIR_NAME, "$(curver + 2)"))
end

rm(joinpath(job, DFControl.VERSION_DIR_NAME), recursive=true)
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ testdir = @__DIR__
@time @testset "documenation" begin @suppress include("documentation_tests.jl") end
@time @testset "Setting defaults" begin @suppress include("defaults_tests.jl") end
@time @testset "Job from CIF file" begin @suppress include("jobfromcif_tests.jl") end
@time @testset "Job control tests" begin @suppress include("job_control_tests.jl") end
@time @testset "Job control tests" begin include("job_control_tests.jl") end
@time @testset "Remove defaults" begin @suppress include("rmdefaults_tests.jl") end
end
2 changes: 1 addition & 1 deletion test/testassets/test_job/nscf.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
verbosity = 'high'
calculation = 'nscf'
outdir = 'localhost/test_job/outputs'
pseudo_dir = '/home/ponet/.julia/dev/DFControl/test/testassets/test_job'
pseudo_dir = '/home/lponet/.julia/dev/DFControl/test/testassets/test_job'
restart_mode = 'from_scratch'
/

Expand Down

0 comments on commit aa79a2e

Please sign in to comment.