From 384ea24581d00a07b59d9d15e51c0d2b76330856 Mon Sep 17 00:00:00 2001 From: lb584 <lb584@cam.ac.uk> Date: Fri, 27 Jan 2023 14:20:46 +0000 Subject: [PATCH] repackaging integration tests --- .../partial/integration_test_utils.py | 10 +-- tests/integration/partial/test_deposition.py | 2 +- tests/integration/partial/test_env_suit.py | 2 +- .../configs/config_EastAfrica_fc_live.json | 68 +++++++++---------- 4 files changed, 41 insertions(+), 41 deletions(-) diff --git a/tests/integration/partial/integration_test_utils.py b/tests/integration/partial/integration_test_utils.py index 67d4942..4e383b2 100644 --- a/tests/integration/partial/integration_test_utils.py +++ b/tests/integration/partial/integration_test_utils.py @@ -9,11 +9,11 @@ from zipfile import ZipFile class IntegrationTestUtils: EMAIL_CRED_PATH: str = "../../test_data/test_deployment/envs/Cred_gmail.json" - DEFAULT_CONFIG_FILE_PATH: str = "../../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json" - TEMP_CONFIG_FILE_PATH: str = "../../../test_data/test_deployment/regions/EastAfrica/workspace/temp_config.json" - EXAMPLE_SURVEY_FILE_PATH: str = "../../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/example_survey_run.zip" - EXAMPLE_DEPO_FILE_PATH: str = "../../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/example_depo_run.zip" - EXAMPLE_ENV_SUIT_FILE_PATH: str = "../../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/example_env_suit_run.zip" + DEFAULT_CONFIG_FILE_PATH: str = "../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json" + TEMP_CONFIG_FILE_PATH: str = "../../test_data/test_deployment/regions/EastAfrica/workspace/temp_config.json" + EXAMPLE_SURVEY_FILE_PATH: str = "../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/example_survey_run.zip" + EXAMPLE_DEPO_FILE_PATH: str = "../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/example_depo_run.zip" + EXAMPLE_ENV_SUIT_FILE_PATH: str = "../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/example_env_suit_run.zip" @staticmethod def load_json_file(file: str) -> dict: diff --git a/tests/integration/partial/test_deposition.py b/tests/integration/partial/test_deposition.py index 7c3fa10..9652cb7 100644 --- a/tests/integration/partial/test_deposition.py +++ b/tests/integration/partial/test_deposition.py @@ -31,7 +31,7 @@ class TestDeposition(unittest.TestCase): run_dict['WorkspacePath'] = TestDeposition.TEST_OUT_PATH run_dict['ServerName'] = '' # nothing, as local machine full_server_path = os.path.abspath( - "../../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/") + "../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/") run_dict['Deposition']['ServerPathTemplate'] = full_server_path IntegrationTestUtils.write_json_file(run_dict, IntegrationTestUtils.TEMP_CONFIG_FILE_PATH) diff --git a/tests/integration/partial/test_env_suit.py b/tests/integration/partial/test_env_suit.py index 14ca2f7..05c1372 100644 --- a/tests/integration/partial/test_env_suit.py +++ b/tests/integration/partial/test_env_suit.py @@ -34,7 +34,7 @@ class TestEnvSuit(unittest.TestCase): run_dict['Environment']['OUTPUT_PATH'] = TestEnvSuit.TEST_OUT_PATH run_dict['ServerName'] = '' # nothing, as local machine full_server_path = os.path.abspath( - "../../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/") + "../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/assets/") run_dict['Environment']['ServerPathTemplate'] = full_server_path IntegrationTestUtils.write_json_file(run_dict, IntegrationTestUtils.TEMP_CONFIG_FILE_PATH) diff --git a/tests/test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json b/tests/test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json index d6c8276..711a65e 100644 --- a/tests/test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json +++ b/tests/test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/config_EastAfrica_fc_live.json @@ -3,9 +3,9 @@ "SubRegionNames" : ["EastAfrica","Ethiopia"], "StartTime" : "?", "StartString" : "?", - "WorkspacePathout" : "../test_data/test_deployment/regions/EastAfrica/workspace/", + "WorkspacePathout" : "../../test_data/test_deployment/regions/EastAfrica/workspace/", "WorkspacePath" : "set_in_the_code", - "ResourcesPath" : "../test_data/test_deployment/regions/EastAfrica/resources/", + "ResourcesPath" : "../../test_data/test_deployment/regions/EastAfrica/resources/", "ServerPath" : "OVERRIDDEN", "ServerName" : "OVERRIDDEN, set to empty string in tests", "ServerKey" : "not used, set to empty string in tests", @@ -16,7 +16,7 @@ "AcceptableDowntimeDays": 35, "SeasonStartString" : "20220930", "SkipServerDownload" : true, - "ServerCredentialsFile" : "../test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/Cred-ODK-EIAR.json", + "ServerCredentialsFile" : "../../test_data/test_deployment/regions/EastAfrica/resources/coordinator/configs/Cred-ODK-EIAR.json", "ServerPathExtra" : "OVERRIDDEN", "FormEdits" : { "wheat_rust_survey_1_0" : {}, @@ -27,9 +27,9 @@ }, "WRSIS" : {} }, - "SourcesConfigFilename" : "../test_data/test_deployment/regions/EastAfrica/resources/wheat_source_generation/configs/config_EastAfrica_mapspam2017.R", + "SourcesConfigFilename" : "../../test_data/test_deployment/regions/EastAfrica/resources/wheat_source_generation/configs/config_EastAfrica_mapspam2017.R", "SourcesRegionName" : "EastAfrica", - "pySourcesConfigFilename" : "../test_data/test_deployment/regions/EastAfrica/resources/source_gen/configs/config_EastAfrica_mapspam2017.json" + "pySourcesConfigFilename" : "../../test_data/test_deployment/regions/EastAfrica/resources/source_gen/configs/config_EastAfrica_mapspam2017.json" }, "Environment" : { "ServerPathTemplate" : "/storage/sftp/metofficeupload/upload/Ethiopia/fromMO/daily_name/", @@ -38,12 +38,12 @@ "ProcessPreJob" : "process_pre_job_server_download", "ProcessInJob" : "process_in_job_env2_0", "ProcessEWSPlotting" : "process_EWS_plotting_env2_0", - "RESOURCES_PATH": "../test_data/test_deployment/regions/EastAfrica/resources/met_extractor/", - "WORK_PATH" : "../test_data/test_deployment/regions/EastAfrica/workspace/", - "INPUT_PATH" : "../test_data/test_deployment/regions/EastAfrica/workspace/", - "OUTPUT_PATH" : "../test_data/test_deployment/regions/EastAfrica/workspace/", - "SYS_CONFIG" : "../test_data/test_deployment/regions/EastAfrica/resources/met_extractor/configs/SYS_CONFIG_PINE.json", - "FIELD_NAME_CONSTANTS" : "../test_data/test_deployment/regions/EastAfrica/resources/met_extractor/configs/FIELD_NAME_CONSTANTS.csv", + "RESOURCES_PATH": "../../test_data/test_deployment/regions/EastAfrica/resources/met_extractor/", + "WORK_PATH" : "../../test_data/test_deployment/regions/EastAfrica/workspace/", + "INPUT_PATH" : "../../test_data/test_deployment/regions/EastAfrica/workspace/", + "OUTPUT_PATH" : "../../test_data/test_deployment/regions/EastAfrica/workspace/", + "SYS_CONFIG" : "../../test_data/test_deployment/regions/EastAfrica/resources/met_extractor/configs/SYS_CONFIG_PINE.json", + "FIELD_NAME_CONSTANTS" : "../../test_data/test_deployment/regions/EastAfrica/resources/met_extractor/configs/FIELD_NAME_CONSTANTS.csv", "RUN_TYPE" : "operational", "EXTRACTION_DAYS": 7, "FORECAST_DAYS": 6, @@ -111,14 +111,14 @@ } }, "EWS-Plotting" : { - "SysConfig" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/sys/SYS_CONFIG_PINE.json", - "RunConfig" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/env_suit/RUN_CONFIG_ENV.json", + "SysConfig" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/sys/SYS_CONFIG_PINE.json", + "RunConfig" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/env_suit/RUN_CONFIG_ENV.json", "EastAfrica" : { - "ChartConfig" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/chart/CHART_CONFIG_EAST_AFRICA_PINE.json", + "ChartConfig" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/chart/CHART_CONFIG_EAST_AFRICA_PINE.json", "FilterForCountry" : "False" }, "Ethiopia" : { - "ChartConfig" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/chart/CHART_CONFIG_ETHIOPIA_PINE.json", + "ChartConfig" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/chart/CHART_CONFIG_ETHIOPIA_PINE.json", "FilterForCountry" : "True" } } @@ -132,16 +132,16 @@ "ProcessInJob" : "process_in_job_dep", "ProcessEWSPlotting" : "process_EWS_plotting_dep", "EWS-Plotting" : { - "SysConfig" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/sys/SYS_CONFIG_PINE.json", - "NameExtractionConfig" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/name_extraction/NAME_EXTRACTION_CONFIG.json", - "RunConfig" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/deposition/RUN_CONFIG_DEPO.json", - "RunConfigNorm" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/deposition/RUN_CONFIG_DEPO_NORMALIZED.json", + "SysConfig" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/sys/SYS_CONFIG_PINE.json", + "NameExtractionConfig" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/name_extraction/NAME_EXTRACTION_CONFIG.json", + "RunConfig" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/deposition/RUN_CONFIG_DEPO.json", + "RunConfigNorm" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/deposition/RUN_CONFIG_DEPO_NORMALIZED.json", "EastAfrica" : { - "ChartConfig" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/chart/CHART_CONFIG_EAST_AFRICA_PINE.json", + "ChartConfig" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/chart/CHART_CONFIG_EAST_AFRICA_PINE.json", "Normalize" : "False" }, "Ethiopia" : { - "ChartConfig" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/chart/CHART_CONFIG_ETHIOPIA_PINE.json", + "ChartConfig" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/chart/CHART_CONFIG_ETHIOPIA_PINE.json", "Normalize" : "True" } } @@ -155,7 +155,7 @@ "ProcessEWSPlotting" : "process_EWS_plotting_epi", "Host" : { "MaxFieldsPerCell" : "1", - "HostRaster" : "../test_data/test_deployment/regions/EastAfrica/resources/epimodel/assets/wheat_area_frac_MapSPAM2010_EastAfrica.tif" + "HostRaster" : "../../test_data/test_deployment/regions/EastAfrica/resources/epimodel/assets/wheat_area_frac_MapSPAM2010_EastAfrica.tif" }, "Deposition" : { "VariableNames" : ["P_GRAMINIS_DEPOSITION"], @@ -209,10 +209,10 @@ } ], "EWS-Plotting" : { - "SysConfig" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/sys/SYS_CONFIG_PINE.json", - "RunConfig_seasonsofar" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/epi/RUN_CONFIG_EPI.json", - "RunConfig_seasonplusforecast" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/epi/RUN_CONFIG_EPI.json", - "ChartConfig" : "../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/chart/CHART_CONFIG_ETHIOPIA_PINE.json", + "SysConfig" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/sys/SYS_CONFIG_PINE.json", + "RunConfig_seasonsofar" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/epi/RUN_CONFIG_EPI.json", + "RunConfig_seasonplusforecast" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/epi/RUN_CONFIG_EPI.json", + "ChartConfig" : "../../test_data/test_deployment/regions/EastAfrica/resources/plotting/configs/chart/CHART_CONFIG_ETHIOPIA_PINE.json", "PlottingRegionName" : "Ethiopia", "EpiCase" : "ps" } @@ -272,19 +272,19 @@ } }, "Surveys" : { - "variety_names_tidy_fn" : "../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/configs/config_EastAfrica_variety_names_tidy.json", + "variety_names_tidy_fn" : "../../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/configs/config_EastAfrica_variety_names_tidy.json", "CountryColumnName" : "surveyor_infromation-country", "EastAfrica" : { - "ShapeFilenameAdmin0" : "../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp", - "ShapeFilenameAdmin1" : "../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp", - "ShapeFilenameAdmin2" : "../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp" + "ShapeFilenameAdmin0" : "../../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp", + "ShapeFilenameAdmin1" : "../../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp", + "ShapeFilenameAdmin2" : "../../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp" }, "Ethiopia" : { - "ShapeFilenameAdmin0" : "../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp", - "ShapeFilenameAdmin1" : "../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp", - "ShapeFilenameAdmin2" : "../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp" + "ShapeFilenameAdmin0" : "../../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp", + "ShapeFilenameAdmin1" : "../../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp", + "ShapeFilenameAdmin2" : "../../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/EthKen_admin0.shp" } }, - "logos" : "../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/logos_Ethiopia_plotting.png" + "logos" : "../../test_data/test_deployment/regions/EastAfrica/resources/advisory_builder/assets/logos_Ethiopia_plotting.png" } } -- GitLab