Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
rm -rf /lcrc/group/e3sm/public_html/zppy_test_resources/expected_bash_files
# Your output will now become the new expectation.
# You can just move (i.e., not copy) the output since re-running this test will re-generate the output.
rm -rf test_bash_generation_output/post/scripts/provenance*
mv test_bash_generation_output/post/scripts /lcrc/group/e3sm/public_html/zppy_test_resources/expected_bash_files
# Rerun test
pytest tests/integration/test_bash_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
rm -rf #expand expected_dir#expected_bash_files
# Your output will now become the new expectation.
# You can just move (i.e., not copy) the output since re-running this test will re-generate the output.
rm -rf test_bash_generation_output/post/scripts/provenance*
mv test_bash_generation_output/post/scripts #expand expected_dir#expected_bash_files
# Rerun test
pytest tests/integration/test_bash_generation.py
1 change: 1 addition & 0 deletions tests/integration/test_bash_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
def test_bash_generation():
# cfg is not machine-specific
assert os.system("zppy -c tests/integration/test_bash_generation.cfg") == 0
assert os.system("rm test_bash_generation_output/post/scripts/provenance*") == 0
expected_dir = get_expansions()["expected_dir"]
assert (
os.system(
Expand Down
20 changes: 20 additions & 0 deletions tests/integration/test_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
def test_campaign_cryosphere():
assert os.system("zppy -c tests/integration/test_campaign_cryosphere.cfg") == 0
assert os.system("rm test_campaign_cryosphere_output/post/scripts/*.bash") == 0
assert os.system("rm test_campaign_cryosphere_output/post/scripts/provenance*") == 0
expected_dir = get_expansions()["expected_dir"]
assert (
os.system(
Expand All @@ -26,6 +27,12 @@ def test_campaign_cryosphere_override():
os.system("rm test_campaign_cryosphere_override_output/post/scripts/*.bash")
== 0
)
assert (
os.system(
"rm test_campaign_cryosphere_override_output/post/scripts/provenance*"
)
== 0
)
expected_dir = get_expansions()["expected_dir"]
assert (
os.system(
Expand All @@ -39,6 +46,9 @@ def test_campaign_cryosphere_override():
def test_campaign_high_res_v1():
assert os.system("zppy -c tests/integration/test_campaign_high_res_v1.cfg") == 0
assert os.system("rm test_campaign_high_res_v1_output/post/scripts/*.bash") == 0
assert (
os.system("rm test_campaign_high_res_v1_output/post/scripts/provenance*") == 0
)
expected_dir = get_expansions()["expected_dir"]
assert (
os.system(
Expand All @@ -52,6 +62,7 @@ def test_campaign_high_res_v1():
def test_campaign_none():
assert os.system("zppy -c tests/integration/test_campaign_none.cfg") == 0
assert os.system("rm test_campaign_none_output/post/scripts/*.bash") == 0
assert os.system("rm test_campaign_none_output/post/scripts/provenance*") == 0
expected_dir = get_expansions()["expected_dir"]
assert (
os.system(
Expand All @@ -65,6 +76,9 @@ def test_campaign_none():
def test_campaign_water_cycle():
assert os.system("zppy -c tests/integration/test_campaign_water_cycle.cfg") == 0
assert os.system("rm test_campaign_water_cycle_output/post/scripts/*.bash") == 0
assert (
os.system("rm test_campaign_water_cycle_output/post/scripts/provenance*") == 0
)
expected_dir = get_expansions()["expected_dir"]
assert (
os.system(
Expand All @@ -84,6 +98,12 @@ def test_campaign_water_cycle_override():
os.system("rm test_campaign_water_cycle_override_output/post/scripts/*.bash")
== 0
)
assert (
os.system(
"rm test_campaign_water_cycle_override_output/post/scripts/provenance*"
)
== 0
)
expected_dir = get_expansions()["expected_dir"]
assert (
os.system(
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def test_defaults():
# cfg is not machine-specific
assert os.system("zppy -c tests/integration/test_defaults.cfg") == 0
assert os.system("rm test_defaults_output/post/scripts/*.bash") == 0
assert os.system("rm test_defaults_output/post/scripts/provenance*") == 0
assert (
os.system(
"rm -rf test_defaults_output/post/scripts/global_time_series_0001-0020_dir"
Expand Down
16 changes: 10 additions & 6 deletions tests/integration/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ def test_images():
if "weekly_bundles" in expansions["cfgs_to_run"]:
# No mpas_analysis
if "mpas_analysis" in expansions["tasks_to_run"]:
tasks_to_run_copy = tasks_to_run.copy()
tasks_to_run_copy.remove("mpas_analysis")
tasks_to_run_modified = tasks_to_run.copy()
tasks_to_run_modified.remove("mpas_analysis")
else:
tasks_to_run_modified = tasks_to_run
set_up_and_run_image_checker(
"bundles",
V3_CASE_NAME,
expansions,
diff_dir_suffix,
tasks_to_run_copy,
tasks_to_run_modified,
test_results_dict,
)

Expand Down Expand Up @@ -90,14 +92,16 @@ def test_images():
if "weekly_legacy_3.0.0_bundles" in expansions["cfgs_to_run"]:
# No mpas_analysis
if "mpas_analysis" in expansions["tasks_to_run"]:
tasks_to_run_copy = tasks_to_run.copy()
tasks_to_run_copy.remove("mpas_analysis")
tasks_to_run_modified = tasks_to_run.copy()
tasks_to_run_modified.remove("mpas_analysis")
else:
tasks_to_run_modified = tasks_to_run
set_up_and_run_image_checker(
"legacy_3.0.0_bundles",
V3_CASE_NAME,
expansions,
diff_dir_suffix,
tasks_to_run_copy,
tasks_to_run_modified,
test_results_dict,
)
except Exception as e:
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/test_last_year.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
def test_last_year():
# Note that this integration test does not have any expected files in `tests.integration.utils.get_expansions()["expected_dir"]`
# cfg is not machine-specific
# Start fresh:
assert os.system("rm -rf test_last_year_output") == 0
assert os.system("zppy -c tests/integration/test_last_year.cfg --last-year 12") == 0
# Remove files that are not deterministic:
assert os.system("rm test_last_year_output/post/scripts/*.settings") == 0
assert os.system("rm test_last_year_output/post/scripts/provenance*") == 0
actual_files = sorted(os.listdir("test_last_year_output/post/scripts"))
expected_files = [
"climo_atm_monthly_180x360_aave_0001-0010.bash",
Expand Down
Loading