Skip to content

Commit

Permalink
Small test and docs fixes for new config flow
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Oct 5, 2023
1 parent 1007ea5 commit da0bd8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/src/repl_scripts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function print_repl_script(config)
end
end
ib *= """\n"""
ib *= """config = CA.AtmosConfig(; config_dict);\n"""
ib *= """config = CA.AtmosConfig(config_dict);\n"""
ib *= """\n"""
ib *= """include("examples/hybrid/driver.jl")\n"""
println(ib)
Expand Down
22 changes: 6 additions & 16 deletions test/config.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,18 @@ include(joinpath("..", "perf", "common.jl"))
@test config.parsed_args["y_elem"] == 6

# Test with `target_job`
config = AtmosCoveragePerfConfig(;
config_dict = CA.config_from_target_job("sphere_baroclinic_wave_rhoe"),
config = AtmosCoveragePerfConfig(
CA.config_from_target_job("sphere_baroclinic_wave_rhoe"),
)
# Target job config overridden by `default_perf`
@test config.parsed_args["dt"] == "1secs"
@test config.parsed_args["dt"] == "400secs"
# Target job config not overridden by `default_perf`
@test config.parsed_args["regression_test"] == true

# Test that config_dict overrides `default_perf`
config_dict = Dict("dt" => "50secs", "turbconv_case" => "GABLS")
config = AtmosCoveragePerfConfig(; config_dict)
@test config.parsed_args["dt"] == "1secs"
config = AtmosCoveragePerfConfig(config_dict)
@test config.parsed_args["dt"] == "50secs"
@test config.parsed_args["turbconv_case"] == "GABLS"

# Test that `default_perf` overrides `target_job`
config = AtmosCoveragePerfConfig(;
config_dict = CA.config_from_target_job("sphere_baroclinic_wave_rhoe"),
)
# default_perf
@test config.parsed_args["dt"] == "1secs"
# target_job
@test config.parsed_args["regression_test"] == true
# defaults
@test config.parsed_args["y_elem"] == 6
@test config.parsed_args["regression_test"] == false
end

0 comments on commit da0bd8a

Please sign in to comment.