Skip to content

Commit

Permalink
remove default env test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
yutaro-oguri committed Jun 14, 2024
1 parent 4dc2bba commit 0ffa812
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
1 change: 1 addition & 0 deletions test/integration_test/test_master_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
25 changes: 0 additions & 25 deletions test/unit_test/test_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 0ffa812

Please sign in to comment.