diff --git a/tests/unit/python/cli/administration/deploy/development/test_compose.py b/tests/unit/python/cli/administration/deploy/development/test_compose.py index 37ddf77306..0c0edca26a 100644 --- a/tests/unit/python/cli/administration/deploy/development/test_compose.py +++ b/tests/unit/python/cli/administration/deploy/development/test_compose.py @@ -95,6 +95,7 @@ class TestComposeUpRetries(unittest.TestCase): "INFINITO_GIT_COMMON_DIR": "", "INFINITO_CACHE_NETWORK": "", "INFINITO_CACHE_STACK": "", + "INFINITO_GPU_COUNT": "0", }, clear=False, ) @@ -146,6 +147,7 @@ class TestComposeUpRetries(unittest.TestCase): "INFINITO_GIT_COMMON_DIR": "", "INFINITO_CACHE_NETWORK": "", "INFINITO_CACHE_STACK": "", + "INFINITO_GPU_COUNT": "0", }, clear=False, ) diff --git a/tests/unit/python/cli/administration/deploy/development/test_env_compose_file_args.py b/tests/unit/python/cli/administration/deploy/development/test_env_compose_file_args.py index ee079c74ba..52599cb7ba 100644 --- a/tests/unit/python/cli/administration/deploy/development/test_env_compose_file_args.py +++ b/tests/unit/python/cli/administration/deploy/development/test_env_compose_file_args.py @@ -22,6 +22,7 @@ _LOCAL_PRIMARY = { "INFINITO_CACHE_NETWORK": "", "INFINITO_CACHE_STACK": "", "INFINITO_PUBLISH_PORTS": "", + "INFINITO_GPU_COUNT": "0", } _WORKTREE = { @@ -124,6 +125,18 @@ class TestComposeFileArgs(unittest.TestCase): def test_unpublished_ports_add_the_noports_override(self) -> None: self.assertIn("compose/noports.override.yml", compose_file_args()) + @patch.dict(os.environ, _LOCAL_PRIMARY, clear=False) + def test_a_host_without_a_gpu_reserves_none(self) -> None: + self.assertNotIn("compose/gpu.override.yml", compose_file_args()) + + @patch.dict( + os.environ, + {**_LOCAL_PRIMARY, "INFINITO_GPU_COUNT": "all"}, + clear=False, + ) + def test_a_host_with_a_gpu_adds_the_reservation(self) -> None: + self.assertIn("compose/gpu.override.yml", compose_file_args()) + if __name__ == "__main__": # pragma: no cover unittest.main()