Skip to content

Commit 2518996

Browse files
committed
Remove constants module, move TAGS to conftest and TAG to VARS
1 parent c2335db commit 2518996

File tree

7 files changed

+14
-27
lines changed

7 files changed

+14
-27
lines changed

manifest-minimal.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ SYMLINK_RULES:
208208
- src: ../../test/conftest.py
209209
dest: test/conftest.py
210210

211-
- src: ../../test/constants.py
212-
dest: test/constants.py
213-
214211
- src: ../../test/__init__.py
215212
dest: test/__init__.py
216213

manifest.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,6 @@ SYMLINK_RULES:
207207
- src: ../../test/conftest.py
208208
dest: test/conftest.py
209209

210-
- src: ../../test/constants.py
211-
dest: test/constants.py
212-
213210
- src: ../../test/__init__.py
214211
dest: test/__init__.py
215212

test/conftest.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,23 @@
99
if not check_variables():
1010
sys.exit(1)
1111

12+
TAGS = {
13+
"rhel8": "-ubi8",
14+
"rhel9": "-ubi9",
15+
"rhel10": "-ubi10",
16+
}
17+
1218
Vars = namedtuple("Vars", ["OS", "VERSION", "IMAGE_NAME", "IS_MINIMAL", "VERSION_NO_MINIMAL", "SHORT_VERSION", "TEST_DIR"])
1319
VERSION = os.getenv("VERSION")
20+
OS = os.getenv("TARGET").lower()
1421
VARS = Vars(
15-
OS=os.getenv("TARGET").lower(),
22+
OS=OS,
1623
VERSION=VERSION,
1724
IMAGE_NAME=os.getenv("IMAGE_NAME"),
1825
IS_MINIMAL="minimal" in VERSION,
1926
VERSION_NO_MINIMAL=VERSION.replace("-minimal", ""),
2027
SHORT_VERSION=VERSION.replace("-minimal", "").replace(".", ""),
28+
TAG=TAGS.get(OS),
2129
TEST_DIR=Path(__file__).parent.absolute()
2230
)
2331

test/constants.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

test/test_helm_python_django_app.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
from container_ci_suite.helm import HelmChartsAPI
22

3-
from constants import TAGS, BRANCH_TO_TEST
4-
from conftest import skip_helm_charts_tests, VARS
3+
from conftest import BRANCH_TO_TEST, skip_helm_charts_tests, VARS
54

6-
7-
TAG = TAGS.get(VARS.OS)
85
DEPLOYED_PSQL_IMAGE = "quay.io/sclorg/postgresql-10-c8s:c8s"
96
IMAGE_TAG = "postgresql:10"
107
PSQL_VERSION = "10"
@@ -37,7 +34,7 @@ def test_django_application_helm_test(self):
3734
assert self.hc_api.helm_package()
3835
assert self.hc_api.helm_installation(
3936
values={
40-
"python_version": f"{VARS.VERSION}{TAG}",
37+
"python_version": f"{VARS.VERSION}{VARS.TAG}",
4138
"namespace": self.hc_api.namespace,
4239
"source_repository_ref": BRANCH_TO_TEST,
4340
}

test/test_helm_python_django_psql_persistent.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
from container_ci_suite.helm import HelmChartsAPI
22

3-
from constants import TAGS, BRANCH_TO_TEST
4-
from conftest import skip_helm_charts_tests, VARS
3+
from conftest import BRANCH_TO_TEST, skip_helm_charts_tests,VARS
54

6-
TAG = TAGS.get(VARS.OS)
75
if VARS.VERSION in ("3.11", "3.12", "3.12-minimal"):
86
BRANCH_TO_TEST = "4.2.x"
97

@@ -33,7 +31,7 @@ def test_django_psql_helm_test(self):
3331
assert self.hc_api.helm_package()
3432
assert self.hc_api.helm_installation(
3533
values={
36-
"python_version": f"{VARS.VERSION}{TAG}",
34+
"python_version": f"{VARS.VERSION}{VARS.TAG}",
3735
"namespace": self.hc_api.namespace,
3836
"source_repository_ref": BRANCH_TO_TEST,
3937
}

test/test_imagestreams_quickstart.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
from container_ci_suite.openshift import OpenShiftAPI
55

6-
from constants import TAGS, BRANCH_TO_TEST
7-
from conftest import VARS
6+
from conftest import BRANCH_TO_TEST,VARS
87

98
DEPLOYED_PSQL_IMAGE = "quay.io/sclorg/postgresql-10-c8s:c8s"
109
IMAGE_TAG = "postgresql:10"
@@ -16,8 +15,6 @@
1615
IMAGE_TAG = "postgresql:12"
1716
PSQL_VERSION = "12"
1817

19-
TAG = TAGS.get(VARS.OS, None)
20-
2118

2219
# Replacement with 'test_python_s2i_templates'
2320
class TestImagestreamsQuickstart:

0 commit comments

Comments
 (0)