From d5974bc06b945352fbaaee30ec93cbb5490d9780 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Wed, 14 Feb 2024 12:51:48 -0800 Subject: [PATCH 1/2] CLN: split #1928, refactor render test --- tests/tests_unit/test_render.py | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/tests/tests_unit/test_render.py b/tests/tests_unit/test_render.py index 73c4fb5ca..103e019f6 100644 --- a/tests/tests_unit/test_render.py +++ b/tests/tests_unit/test_render.py @@ -1,7 +1,5 @@ import os -from _nebari.stages.bootstrap import CiEnum -from nebari import schema from nebari.plugins import nebari_plugin_manager @@ -22,20 +20,9 @@ def test_render_config(nebari_render): "03-kubernetes-initialize", }.issubset(os.listdir(output_directory / "stages")) - if config.provider == schema.ProviderEnum.do: - assert (output_directory / "stages" / "01-terraform-state/do").is_dir() - assert (output_directory / "stages" / "02-infrastructure/do").is_dir() - elif config.provider == schema.ProviderEnum.aws: - assert (output_directory / "stages" / "01-terraform-state/aws").is_dir() - assert (output_directory / "stages" / "02-infrastructure/aws").is_dir() - elif config.provider == schema.ProviderEnum.gcp: - assert (output_directory / "stages" / "01-terraform-state/gcp").is_dir() - assert (output_directory / "stages" / "02-infrastructure/gcp").is_dir() - elif config.provider == schema.ProviderEnum.azure: - assert (output_directory / "stages" / "01-terraform-state/azure").is_dir() - assert (output_directory / "stages" / "02-infrastructure/azure").is_dir() - - if config.ci_cd.type == CiEnum.github_actions: - assert (output_directory / ".github/workflows/").is_dir() - elif config.ci_cd.type == CiEnum.gitlab_ci: - assert (output_directory / ".gitlab-ci.yml").is_file() + assert ( + output_directory / "stages" / f"01-terraform-state/{config.provider.value}" + ).is_dir() + assert ( + output_directory / "stages" / f"02-infrastructure/{config.provider.value}" + ).is_dir() From f3e3b024dec4497d5f9fcbef5f6bfbdbdc130b59 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Thu, 15 Feb 2024 11:13:09 -0800 Subject: [PATCH 2/2] update --- tests/tests_unit/test_render.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/tests_unit/test_render.py b/tests/tests_unit/test_render.py index 103e019f6..e0fd6636f 100644 --- a/tests/tests_unit/test_render.py +++ b/tests/tests_unit/test_render.py @@ -1,5 +1,6 @@ import os +from _nebari.stages.bootstrap import CiEnum from nebari.plugins import nebari_plugin_manager @@ -26,3 +27,8 @@ def test_render_config(nebari_render): assert ( output_directory / "stages" / f"02-infrastructure/{config.provider.value}" ).is_dir() + + if config.ci_cd.type == CiEnum.github_actions: + assert (output_directory / ".github/workflows/").is_dir() + elif config.ci_cd.type == CiEnum.gitlab_ci: + assert (output_directory / ".gitlab-ci.yml").is_file()