From 4dd2aaeea82556224f183ec5f8e966f169755094 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 13 Aug 2025 09:33:30 +0200 Subject: [PATCH 1/2] Fix test suite to support the latest API. Remove also testing template outside of cluster. It does not make sense for sanity tests Signed-off-by: Petr "Stone" Hracek --- tests/test_nginx.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/tests/test_nginx.py b/tests/test_nginx.py index 3f49df93..801afa07 100644 --- a/tests/test_nginx.py +++ b/tests/test_nginx.py @@ -18,7 +18,7 @@ def setup_method(self): json_raw_file = self.oc_api.get_raw_url_for_json( container="nginx-container", dir="imagestreams", filename="nginx-rhel.json" ) - self.oc_api.import_is(path=json_raw_file, name="nginx") + self.oc_api.import_is(path=json_raw_file, name="nginx", skip_check=True) def teardown_method(self): self.oc_api.delete_project() @@ -31,20 +31,7 @@ def test_template_inside_cluster(self): template=template_json, name_in_template="nginx-example", expected_output="Welcome to your static nginx application", openshift_args=["SOURCE_REPOSITORY_REF=master", f"NGINX_VERSION={VERSION}", "NAME=nginx-example"] ) - assert self.oc_api.template_deployed(name_in_template="nginx-example") + assert self.oc_api.is_template_deployed(name_in_template="nginx-example") assert self.oc_api.check_response_inside_cluster( name_in_template="nginx-example", expected_output="Welcome to your static nginx application" ) - - def test_template_by_request(self): - template_json = self.oc_api.get_raw_url_for_json( - container="nginx-ex", dir="openshift/templates", filename="nginx.json" - ) - assert self.oc_api.deploy_template( - template=template_json, name_in_template="nginx-example", expected_output="Welcome to your static nginx application", - openshift_args=["SOURCE_REPOSITORY_REF=master", f"NGINX_VERSION={VERSION}", "NAME=nginx-example"] - ) - assert self.oc_api.template_deployed(name_in_template="nginx-example") - assert self.oc_api.check_response_outside_cluster( - name_in_template="nginx-example", expected_output="Welcome to your static nginx application" - ) From f984ea243c7a52420d4b5f748d995a1d3b125157 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 13 Aug 2025 11:28:06 +0200 Subject: [PATCH 2/2] Fix calling PyTest from Makefile Signed-off-by: Petr "Stone" Hracek --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 97a95a66..dcd3ec8a 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ -.PHONY: test-openshift-4 -test-openshift-4: - cd tests && PYTHONPATH=$(CURDIR) python3 -m pytest --verbose --color=yes --showlocals . \ No newline at end of file +.PHONY: test-openshift-pytest +test-openshift-pytest: + cd tests && PYTHONPATH=$(CURDIR) python3.12 -m pytest -s -rA --showlocals -vv test_nginx*.py