Skip to content

Commit

Permalink
ci: Include regression test for GitHub CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fabern committed Jul 29, 2022
1 parent 54a8850 commit f427f69
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/03-regression-tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ is_a_CI_system = issubset(["GITHUB_ACTION"], collect(keys(ENV))) # checks if ENV
if !is_a_CI_system
@test all(abs.((u_ref .- loaded_u_ref) ./ (loaded_u_ref .+ eps(Float64))) .< 1e-3) # adding eps for values where _ref is zero
else
@test_broken all(abs.((u_ref .- loaded_u_ref) ./ (loaded_u_ref .+ eps(Float64))) .< 1e-3) # adding eps for values where _ref is zero
@test all(abs.((u_ref .- loaded_u_ref) ./ (loaded_u_ref .+ eps(Float64))) .< 1e-3) # adding eps for values where _ref is zero
end
elseif task == "overwrite" && !is_a_CI_system # only overwrite on local machine, never on CI
jldsave(fname; u_ref);
else
# do nothing
@test_broken all(abs.((u_ref .- loaded_u_ref) ./ (loaded_u_ref .+ eps(Float64))) .< 1e-3) # adding eps for values where _ref is zero
end

if (false)
Expand Down Expand Up @@ -131,8 +130,8 @@ end
@test all(abs.((SWAT_d18O_ref .- loaded_SWAT_d18O_ref) ./ (loaded_SWAT_d18O_ref .+ eps(Float64))) .< 1e-5) # adding eps for values where _ref is zero
@test all(abs.((SWAT_d2H_ref .- loaded_SWAT_d2H_ref ) ./ (loaded_SWAT_d2H_ref .+ eps(Float64))) .< 1e-5) # adding eps for values where _ref is zero
else
@test_broken all(abs.((SWAT_d18O_ref .- loaded_SWAT_d18O_ref) ./ (loaded_SWAT_d18O_ref .+ eps(Float64))) .< 1e-5) # adding eps for values where _ref is zero
@test_broken all(abs.((SWAT_d2H_ref .- loaded_SWAT_d2H_ref ) ./ (loaded_SWAT_d2H_ref .+ eps(Float64))) .< 1e-5) # adding eps for values where _ref is zero
@test all(abs.((SWAT_d18O_ref .- loaded_SWAT_d18O_ref) ./ (loaded_SWAT_d18O_ref .+ eps(Float64))) .< 1e-5) # adding eps for values where _ref is zero
@test all(abs.((SWAT_d2H_ref .- loaded_SWAT_d2H_ref ) ./ (loaded_SWAT_d2H_ref .+ eps(Float64))) .< 1e-5) # adding eps for values where _ref is zero
end
elseif task == "overwrite" && !is_a_CI_system # only overwrite on local machine, never on CI
# overwrite output
Expand Down

0 comments on commit f427f69

Please sign in to comment.