From 1923d5a7b53222dc9a5842d0a46325cd9c0d04e6 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Mon, 9 Sep 2024 15:42:15 +0200 Subject: [PATCH] Let's test all versions and not only one Signed-off-by: Petr "Stone" Hracek --- test/test_helm_dancer_app.py | 20 ++++++++++++++++++-- test/test_helm_perl_imagestreams.py | 24 ------------------------ 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/test/test_helm_dancer_app.py b/test/test_helm_dancer_app.py index c098cc0..5c34a89 100644 --- a/test/test_helm_dancer_app.py +++ b/test/test_helm_dancer_app.py @@ -14,6 +14,22 @@ test_dir = Path(os.path.abspath(os.path.dirname(__file__))) +VERSION = os.getenv("VERSION") +IMAGE_NAME = os.getenv("IMAGE_NAME") +OS = os.getenv("TARGET") + +if VERSION == "5.30-mod_fcgid": + VERSION = "5.30" + +if VERSION == "5.26-mod_fcgid": + VERSION = "5.26" + +TAGS = { + "rhel8": "-ubi8", + "rhel9": "-ubi9" +} +TAG = TAGS.get(OS, None) + class TestHelmPerlDancerAppTemplate: @@ -39,7 +55,7 @@ def test_dancer_application_curl_output(self): assert self.hc_api.helm_package() assert self.hc_api.helm_installation( values={ - "perl_version": "5.32-ubi8", + "perl_version": f"{VERSION}{TAG}", "namespace": self.hc_api.namespace } ) @@ -57,7 +73,7 @@ def test_dancer_application_helm_test(self): assert self.hc_api.helm_package() assert self.hc_api.helm_installation( values={ - "perl_version": "5.32-ubi8", + "perl_version": f"{VERSION}{TAG}", "namespace": self.hc_api.namespace } ) diff --git a/test/test_helm_perl_imagestreams.py b/test/test_helm_perl_imagestreams.py index a72cd8f..142ea67 100644 --- a/test/test_helm_perl_imagestreams.py +++ b/test/test_helm_perl_imagestreams.py @@ -41,27 +41,3 @@ def test_package_imagestream(self, version, registry): assert self.hc_api.helm_package() assert self.hc_api.helm_installation() assert self.hc_api.check_imagestreams(version=version, registry=registry) - - -class TestHelmCentOSPerlImageStreams: - - def setup_method(self): - package_name = "perl-imagestreams" - path = test_dir / "../charts/centos" - self.hc_api = HelmChartsAPI(path=path, package_name=package_name, tarball_dir=test_dir) - - def teardown_method(self): - self.hc_api.delete_project() - - @pytest.mark.parametrize( - "version,registry", - [ - ("5.32-ubi9", "registry.access.redhat.com/ubi9/perl-532:latest"), - ("5.32-ubi8", "registry.access.redhat.com/ubi8/perl-532:latest"), - ("5.26-ubi8", "registry.access.redhat.com/ubi8/perl-526:latest"), - ], - ) - def test_package_imagestream(self, version, registry): - assert self.hc_api.helm_package() - assert self.hc_api.helm_installation() - assert self.hc_api.check_imagestreams(version=version, registry=registry)