Skip to content

Commit

Permalink
Let's test all versions and not only one
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
  • Loading branch information
phracek committed Sep 11, 2024
1 parent 1054245 commit 1923d5a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 26 deletions.
20 changes: 18 additions & 2 deletions test/test_helm_dancer_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
}
)
Expand All @@ -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
}
)
Expand Down
24 changes: 0 additions & 24 deletions test/test_helm_perl_imagestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 1923d5a

Please sign in to comment.