diff --git a/tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh b/tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh index 38d4ae48..2e6d7b63 100755 --- a/tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh +++ b/tests/integration/generated/update_bash_generation_expected_files_chrysalis.sh @@ -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 diff --git a/tests/integration/template_update_bash_generation_expected_files.sh b/tests/integration/template_update_bash_generation_expected_files.sh index 1b7fdff4..4263aa48 100755 --- a/tests/integration/template_update_bash_generation_expected_files.sh +++ b/tests/integration/template_update_bash_generation_expected_files.sh @@ -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 diff --git a/tests/integration/test_bash_generation.py b/tests/integration/test_bash_generation.py index d8083ed8..f9b2a3b9 100644 --- a/tests/integration/test_bash_generation.py +++ b/tests/integration/test_bash_generation.py @@ -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( diff --git a/tests/integration/test_campaign.py b/tests/integration/test_campaign.py index b49e58a4..ccf49e76 100644 --- a/tests/integration/test_campaign.py +++ b/tests/integration/test_campaign.py @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( @@ -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( diff --git a/tests/integration/test_defaults.py b/tests/integration/test_defaults.py index ee934d4f..d2fc1c68 100644 --- a/tests/integration/test_defaults.py +++ b/tests/integration/test_defaults.py @@ -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" diff --git a/tests/integration/test_images.py b/tests/integration/test_images.py index d809cdf6..63890000 100644 --- a/tests/integration/test_images.py +++ b/tests/integration/test_images.py @@ -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, ) @@ -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: diff --git a/tests/integration/test_last_year.py b/tests/integration/test_last_year.py index f6ebad33..281bc0e7 100644 --- a/tests/integration/test_last_year.py +++ b/tests/integration/test_last_year.py @@ -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",