Skip to content

Commit

Permalink
Merge pull request #114 from sclorg/fix_python
Browse files Browse the repository at this point in the history
Fix Helm charts tests for Python
  • Loading branch information
phracek authored Nov 13, 2024
2 parents 9c6df18 + b127f89 commit 254e504
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
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"])

0 comments on commit 254e504

Please sign in to comment.