Skip to content

Commit 7622948

Browse files
committed
Enable tests on OpenShift shared cluster.
Do not tests MySQL-84 in OpenShift tests yet;) It is not shipped Also test only examples on local cluster and not on shared_cluster Signed-off-by: Petr "Stone" Hracek <[email protected]>
1 parent ea9303f commit 7622948

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

test/test_mysql_imagestream.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ def teardown_method(self):
3737
]
3838
)
3939
def test_imagestream_template(self, template):
40+
if VERSION == "8.4":
41+
# It is not shipped yet
42+
pytest.skip("Skipping test for 8.4")
4043
os_name = ''.join(i for i in OS if not i.isdigit())
41-
print(os.getcwd())
4244
assert self.oc_api.deploy_image_stream_template(
4345
imagestream_file=f"imagestreams/mysql-{os_name}.json",
4446
template_file=f"examples/{template}",

test/test_mysql_imagestream_template.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ def teardown_method(self):
3737
]
3838
)
3939
def test_imagestream_template(self, template):
40+
if VERSION == "8.4":
41+
# It is not shipped yet
42+
pytest.skip("Skipping test for 8.4")
4043
os_name = ''.join(i for i in OS if not i.isdigit())
4144
assert self.oc_api.deploy_image_stream_template(
4245
imagestream_file=f"imagestreams/mysql-{os_name}.json",

test/test_mysql_shared_helm_template.py

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77

88
test_dir = Path(os.path.abspath(os.path.dirname(__file__)))
99

10+
VERSION = os.getenv("VERSION")
11+
IMAGE_NAME = os.getenv("IMAGE_NAME")
12+
OS = os.getenv("TARGET")
13+
14+
TAGS = {
15+
"rhel8": "-el8",
16+
"rhel9": "-el9"
17+
}
18+
TAG = TAGS.get(OS, None)
1019

1120
class TestHelmMySQLDBPersistent:
1221

@@ -22,19 +31,21 @@ def setup_method(self):
2231
def teardown_method(self):
2332
self.hc_api.delete_project()
2433

25-
@pytest.mark.parametrize(
26-
"version",
27-
[
28-
"8.0-el8",
29-
"8.0-el9",
30-
],
31-
)
32-
def test_package_persistent(self, version):
34+
def test_package_persistent(self):
35+
if VERSION == "8.4":
36+
# It is not shipped yet
37+
pytest.skip("Skipping test for 8.4")
3338
self.hc_api.package_name = "redhat-mysql-imagestreams"
3439
assert self.hc_api.helm_package()
3540
assert self.hc_api.helm_installation()
3641
self.hc_api.package_name = "redhat-mysql-persistent"
3742
assert self.hc_api.helm_package()
38-
assert self.hc_api.helm_installation(values={"mysql_version": version, "namespace": self.hc_api.namespace})
43+
assert self.hc_api.helm_installation(
44+
values={
45+
"mysql_version": f"{VERSION}{TAG}",
46+
"namespace": self.hc_api.namespace,
47+
"database_service_name": "mysql"
48+
}
49+
)
3950
assert self.hc_api.is_pod_running(pod_name_prefix="mysql")
4051
assert self.hc_api.test_helm_chart(expected_str=["42", "testval"])

0 commit comments

Comments
 (0)