From 0ffa812444d275191a264645ca32377ce9cdf726 Mon Sep 17 00:00:00 2001 From: yutaro-oguri Date: Fri, 14 Jun 2024 15:47:57 +0900 Subject: [PATCH] remove default env test cases --- test/integration_test/test_master_build.py | 1 + test/unit_test/test_master.py | 25 ---------------------- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/test/integration_test/test_master_build.py b/test/integration_test/test_master_build.py index 7018513..3c7d85c 100644 --- a/test/integration_test/test_master_build.py +++ b/test/integration_test/test_master_build.py @@ -212,6 +212,7 @@ def requires(self) -> list[Child]: self.assertEqual( cm.output, [ + 'INFO:kannon.master:No dynamic config files are given.', 'INFO:kannon.master:Creating task queue...', f'INFO:kannon.master:Task {c1_task_info} is pushed to task queue', f'INFO:kannon.master:Task {c2_task_info} is pushed to task queue', diff --git a/test/unit_test/test_master.py b/test/unit_test/test_master.py index 207cf0f..8533d39 100644 --- a/test/unit_test/test_master.py +++ b/test/unit_test/test_master.py @@ -101,10 +101,6 @@ class Example(gokart.TaskOnKart): # following should be overwritten self.assertEqual(child_job.spec.template.spec.containers[0].command, ["python", __file__, "--task-pkl-path", f"'{path_to_pkl}'"]) self.assertEqual(child_job.metadata.name, child_job_name) - # envvar TASK_WORKSPACE_DIRECTORY should be inherited - child_env = child_job.spec.template.spec.containers[0].env - self.assertEqual(len(child_env), 1) - self.assertEqual(child_env[0], {"name": "TASK_WORKSPACE_DIRECTORY", "value": "/cache"}) def test_success_custom_env(self) -> None: @@ -151,27 +147,6 @@ class Example(gokart.TaskOnKart): with self.assertRaises(AssertionError): master._create_child_job_object("test-job", path_to_pkl) - def test_fail_default_env_not_exist(self) -> None: - - class Example(gokart.TaskOnKart): - pass - - path_to_pkl = "path/to/obj" - template_job = self._get_template_job() - - cases = [None, ["TASK_WORKSPACE_DIRECTORY", "MY_ENV0", "MY_ENV1"]] - for case in cases: - with self.subTest(case=case): - master = Kannon( - api_instance=None, - template_job=template_job, - job_prefix="", - path_child_script=__file__, # just pass any existing file as dummy - env_to_inherit=case, - ) - with self.assertRaises(ValueError): - master._create_child_job_object("test-job", path_to_pkl) - def test_owner_reference_set(self) -> None: class Example(gokart.TaskOnKart):