Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Helm charts tests for Python #114

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tests/test_python_django_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,18 @@ def test_django_application_curl_output(self, version, branch):
assert self.hc_api.helm_installation()
self.hc_api.package_name = "python-django-application"
self.hc_api.helm_package()
pod_name = f"django-{version}".replace(".", "-")
assert self.hc_api.helm_installation(
values={
"python_version": version,
"namespace": self.hc_api.namespace,
"source_repository_ref": branch,
"name": pod_name
}
)
assert self.hc_api.is_s2i_pod_running(pod_name_prefix="django-example")
assert self.hc_api.is_s2i_pod_running(pod_name_prefix=pod_name, timeout=600)
assert self.hc_api.test_helm_curl_output(
route_name="django-example",
route_name=pod_name,
expected_str="Welcome to your Django application"
)

Expand All @@ -69,12 +71,14 @@ def test_django_application_helm_test(self, version, branch):
assert self.hc_api.helm_installation()
self.hc_api.package_name = "python-django-application"
assert self.hc_api.helm_package()
pod_name = f"django-{version}".replace(".", "-")
assert self.hc_api.helm_installation(
values={
"python_version": version,
"namespace": self.hc_api.namespace,
"source_repository_ref": branch,
"name": pod_name
}
)
assert self.hc_api.is_s2i_pod_running(pod_name_prefix="django-example", timeout=300)
assert self.hc_api.is_s2i_pod_running(pod_name_prefix=pod_name, timeout=600)
assert self.hc_api.test_helm_chart(expected_str=["Welcome to your Django application"])
12 changes: 8 additions & 4 deletions tests/test_python_django_psql_persistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ def test_django_psql_curl_output(self, version, branch):
assert self.hc_api.helm_installation()
self.hc_api.package_name = "django-psql-persistent"
assert self.hc_api.helm_package()
pod_name = f"django-psql-{version}".replace(".", "-")
assert self.hc_api.helm_installation(
values={
"python_version": version,
"namespace": self.hc_api.namespace,
"source_repository_ref": branch,
"name": pod_name
}
)
assert self.hc_api.is_s2i_pod_running(pod_name_prefix="django-psql")
assert self.hc_api.is_s2i_pod_running(pod_name_prefix=pod_name)
assert self.hc_api.test_helm_curl_output(
route_name="django-psql",
route_name=pod_name,
expected_str="Welcome to your Django application"
)

Expand Down Expand Up @@ -78,13 +80,15 @@ def test_django_psql_helm_test(self, version, branch):
assert self.hc_api.helm_installation()
self.hc_api.package_name = "django-psql-persistent"
assert self.hc_api.helm_package()
pod_name = f"django-psql-{version}".replace(".", "-")
assert self.hc_api.helm_installation(
values={
"python_version": version,
"namespace": self.hc_api.namespace,
"source_repository_ref": branch,
"postgresql_version": "15-el9"
"postgresql_version": "15-el9",
"name": pod_name
}
)
assert self.hc_api.is_s2i_pod_running(pod_name_prefix="django-psql", timeout=360)
assert self.hc_api.is_s2i_pod_running(pod_name_prefix=pod_name, timeout=600)
assert self.hc_api.test_helm_chart(expected_str=["Welcome to your Django application"])