Skip to content

Commit 3e5b2b8

Browse files
committed
Add function is_test_allowed for specific OS and version.
Some containers are not available for Helm Charts and therefore the test should be skipped. The Minimal containers that are allowed are mentioned in Red Hat Container Catalog see. https://catalog.redhat.com/en/search?searchType=Containers&q=python+minimal&p=1 Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
1 parent dafb973 commit 3e5b2b8

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

test/constants.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@
55
}
66

77
BRANCH_TO_TEST = "master"
8+
9+
10+
def is_test_allowed(os: str, version: str):
11+
if os == "rhel8" and version == "3.12-minimal":
12+
return False
13+
if version == "3.9-minimal" or version == "3.11-minimal":
14+
return False
15+
return True

test/test_helm_python_django_app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from container_ci_suite.helm import HelmChartsAPI
77

8-
from constants import TAGS, BRANCH_TO_TEST
8+
from constants import TAGS, BRANCH_TO_TEST, is_test_allowed
99
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))
1010

1111
VERSION = os.getenv("VERSION")
@@ -38,6 +38,8 @@ def teardown_method(self):
3838
self.hc_api.delete_project()
3939

4040
def test_django_application_helm_test(self):
41+
if not is_test_allowed(os=OS, version=VERSION):
42+
pytest.skip(f"This combination for {OS} and {VERSION} is not supported for Helm Charts.")
4143
self.hc_api.package_name = "redhat-python-imagestreams"
4244
assert self.hc_api.helm_package()
4345
assert self.hc_api.helm_installation()

test/test_helm_python_django_psql_persistent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from container_ci_suite.helm import HelmChartsAPI
77

8-
from constants import TAGS, BRANCH_TO_TEST
8+
from constants import TAGS, BRANCH_TO_TEST, is_test_allowed
99

1010
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))
1111

@@ -33,6 +33,8 @@ def teardown_method(self):
3333
self.hc_api.delete_project()
3434

3535
def test_django_psql_helm_test(self):
36+
if not is_test_allowed(os=OS, version=VERSION):
37+
pytest.skip(f"This combination for {OS} and {VERSION} is not supported for Helm Charts.")
3638
self.hc_api.package_name = "redhat-postgresql-imagestreams"
3739
assert self.hc_api.helm_package()
3840
assert self.hc_api.helm_installation()

0 commit comments

Comments
 (0)