Skip to content

Commit

Permalink
CLN: split nebari-dev#1928, refactor render test
Browse files Browse the repository at this point in the history
  • Loading branch information
fangchenli committed Feb 14, 2024
1 parent 858ca5f commit d5974bc
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions tests/tests_unit/test_render.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import os

from _nebari.stages.bootstrap import CiEnum
from nebari import schema
from nebari.plugins import nebari_plugin_manager


Expand All @@ -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()

0 comments on commit d5974bc

Please sign in to comment.