diff --git a/tests/integration/partial/integration_test_utils.py b/tests/integration/partial/integration_test_utils.py index 91d0fefc0493366821438c73dc1ba718e4e2cc2f..b7d31f4bd431b80c2109cb1da41453e653764b4f 100644 --- a/tests/integration/partial/integration_test_utils.py +++ b/tests/integration/partial/integration_test_utils.py @@ -68,6 +68,16 @@ class IntegrationTestUtils: parser.add_argument('unittest_args', nargs='*') return parser + @staticmethod + def generate_output_path(filename_prefix: str) -> str: + # if an environment variable "TEST_OUTDIR" is set, use that as the output path + if os.getenv("TEST_OUTDIR"): + result = os.getenv("TEST_OUTDIR") + filename_prefix + "/" + else: + result = IntegrationTestUtils.TEST_WORKSPACE_PATH + filename_prefix + "/" + + return result + @staticmethod def run_full_integration_test_pipeline(test_case: [TestCase], test_prefix: str, diff --git a/tests/integration/partial/test_advisory.py b/tests/integration/partial/test_advisory.py index 0e0584298806af0bb2ae2cbb9ad48ea56d9361d9..d69f38ec7f9306cfc4c4344974ecce7b7ed59a2b 100644 --- a/tests/integration/partial/test_advisory.py +++ b/tests/integration/partial/test_advisory.py @@ -45,7 +45,7 @@ class TestAdvisory(BaseAdvisoryTestSuite.AdvisoryTestSuite): prefix: str = "temp_advisory_" + nowstring # prefix: str = "temp_advisory" - IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.TEST_WORKSPACE_PATH + prefix + "/" + IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.generate_output_path(prefix) os.makedirs(IntegrationTestUtils.TEST_OUT_PATH, exist_ok = True) sys_config_path = IntegrationTestUtils.DEFAULT_SYS_CONFIG_FILE_PATH @@ -57,7 +57,7 @@ class TestAdvisory(BaseAdvisoryTestSuite.AdvisoryTestSuite): run_config = IntegrationTestUtils.DEFAULT_ADVISORY_CONFIG_FILE_PATH run_config_dict: dict = IntegrationTestUtils.load_json_file(run_config) - IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.TEST_WORKSPACE_PATH + prefix + "/" + IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.generate_output_path(prefix) # may be reusing a non-timestamped output file during development, so allow extant TEST_OUT_PATH os.makedirs(IntegrationTestUtils.TEST_OUT_PATH, exist_ok = True) diff --git a/tests/integration/partial/test_deposition.py b/tests/integration/partial/test_deposition.py index 2704f012d7b24bec4242a0438092ceb7e45f582a..62e663d6285cbf1b92bef0b7dbe84424d81b0a0d 100644 --- a/tests/integration/partial/test_deposition.py +++ b/tests/integration/partial/test_deposition.py @@ -46,7 +46,7 @@ class TestDeposition(BaseDepoTestSuite.DepoTestSuite): # prefix: str = "temp_depo" # may be reusing a non-timestamped output file during development, so allow extant TEST_OUT_PATH - IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.TEST_WORKSPACE_PATH + prefix + "/" + IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.generate_output_path(prefix) os.makedirs(IntegrationTestUtils.TEST_OUT_PATH, exist_ok = True) sys_config_path = IntegrationTestUtils.DEFAULT_SYS_CONFIG_FILE_PATH diff --git a/tests/integration/partial/test_env_suit.py b/tests/integration/partial/test_env_suit.py index bd51b39669fc07e3e0bd43769c95b286ee9aa575..dd00a2b611a28f8184366892f0bca7b4fb6c59d1 100644 --- a/tests/integration/partial/test_env_suit.py +++ b/tests/integration/partial/test_env_suit.py @@ -46,7 +46,7 @@ class TestEnvSuit(BaseEnvSuitTestSuite.EnvSuitTestSuite): # prefix: str = "temp_env" # may be reusing a non-timestamped output file during development, so allow extant TEST_OUT_PATH - IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.TEST_WORKSPACE_PATH + prefix + "/" + IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.generate_output_path(prefix) os.makedirs(IntegrationTestUtils.TEST_OUT_PATH, exist_ok = True) sys_config_path = IntegrationTestUtils.DEFAULT_SYS_CONFIG_FILE_PATH diff --git a/tests/integration/partial/test_epi.py b/tests/integration/partial/test_epi.py index 71443cd24832cf6056277937d5ae5f3ab747ad30..b48fe3ae40fa8d0a8c5db6a427f0c467d78ae123 100644 --- a/tests/integration/partial/test_epi.py +++ b/tests/integration/partial/test_epi.py @@ -41,7 +41,7 @@ class TestEpi(BaseEpiTestSuite.EpiTestSuite): prefix: str = "temp_epi_" + nowstring # prefix: str = "temp_epi" - IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.TEST_WORKSPACE_PATH + prefix + "/" + IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.generate_output_path(prefix) os.makedirs(IntegrationTestUtils.TEST_OUT_PATH, exist_ok = True) sys_config_path = IntegrationTestUtils.DEFAULT_SYS_CONFIG_FILE_PATH diff --git a/tests/integration/partial/test_survey.py b/tests/integration/partial/test_survey.py index 42b8c984515f73cd223e005f6bedc48cf6a4d763..9ea063bb3876defbd2203c31481f3634619d7399 100644 --- a/tests/integration/partial/test_survey.py +++ b/tests/integration/partial/test_survey.py @@ -43,7 +43,7 @@ class TestSurvey(BaseSurveyTestSuite.SurveyTestSuite): prefix: str = "temp_survey_" + nowstring # prefix: str = "temp_survey" - IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.TEST_WORKSPACE_PATH + prefix + "/" + IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.generate_output_path(prefix) os.makedirs(IntegrationTestUtils.TEST_OUT_PATH, exist_ok = True) sys_config_path = IntegrationTestUtils.DEFAULT_SYS_CONFIG_FILE_PATH @@ -56,7 +56,7 @@ class TestSurvey(BaseSurveyTestSuite.SurveyTestSuite): run_config = IntegrationTestUtils.DEFAULT_SURVEY_CONFIG_FILE_PATH run_config_dict: dict = IntegrationTestUtils.load_json_file(run_config) run_dict: dict = copy.deepcopy(run_config_dict) - IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.TEST_WORKSPACE_PATH + prefix + "/" + IntegrationTestUtils.TEST_OUT_PATH = IntegrationTestUtils.generate_output_path(prefix) run_dict['WORK_PATH'] = IntegrationTestUtils.TEST_OUT_PATH run_dict['INPUT_PATH'] = IntegrationTestUtils.TEST_OUT_PATH run_dict['OUTPUT_PATH'] = IntegrationTestUtils.TEST_OUT_PATH diff --git a/tests/test_data/test_deployment/regions/EastAfrica/full_test_workspace/.gitignore b/tests/test_data/test_deployment/regions/EastAfrica/full_test_workspace/.gitignore deleted file mode 100644 index 7c891764cec8ee000b16848818b56798c452c8b4..0000000000000000000000000000000000000000 --- a/tests/test_data/test_deployment/regions/EastAfrica/full_test_workspace/.gitignore +++ /dev/null @@ -1 +0,0 @@ -temp_* diff --git a/tests/test_data/test_deployment/regions/EastAfrica/workspace/.gitignore b/tests/test_data/test_deployment/regions/EastAfrica/workspace/.gitignore deleted file mode 100644 index 7c891764cec8ee000b16848818b56798c452c8b4..0000000000000000000000000000000000000000 --- a/tests/test_data/test_deployment/regions/EastAfrica/workspace/.gitignore +++ /dev/null @@ -1 +0,0 @@ -temp_*