Skip to content

Commit e089681

Browse files
frenzymadnessphracek
authored andcommitted
Use packaging for version comparisons
And test newer Django-ex for newer Pythons in OS. Fixes: #730
1 parent d7906ff commit e089681

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

test/test_deploy_templates.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import sys
33

44
import pytest
5+
from packaging.version import Version
56

67
from container_ci_suite.openshift import OpenShiftAPI
78
from container_ci_suite.utils import check_variables
@@ -21,7 +22,8 @@
2122
IMAGE_TAG = "postgresql:10"
2223
PSQL_VERSION = "10"
2324

24-
if VERSION == "3.11" or VERSION == "3.12":
25+
if Version(VERSION) >= Version("3.11"):
26+
BRANCH_TO_TEST = "4.2.x"
2527
DEPLOYED_PSQL_IMAGE = "quay.io/sclorg/postgresql-12-c8s"
2628
IMAGE_TAG = "postgresql:12"
2729
PSQL_VERSION = "12"

test/test_imagestreams_quickstart.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import sys
33

44
import pytest
5+
from packaging.version import Version
56

67
from container_ci_suite.openshift import OpenShiftAPI
78
from container_ci_suite.utils import check_variables
@@ -21,7 +22,7 @@
2122
IMAGE_TAG = "postgresql:10"
2223
PSQL_VERSION = "10"
2324

24-
if VERSION == "3.11" or VERSION == "3.12":
25+
if Version(VERSION) >= Version("3.11"):
2526
BRANCH_TO_TEST = "4.2.x"
2627
DEPLOYED_PSQL_IMAGE = "quay.io/sclorg/postgresql-12-c8s"
2728
IMAGE_TAG = "postgresql:12"

test/test_python_ex_template.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import sys
33

44
import pytest
5+
from packaging.version import Version
56

67
from container_ci_suite.utils import check_variables
78
from container_ci_suite.openshift import OpenShiftAPI
@@ -15,7 +16,10 @@
1516
IMAGE_NAME = os.getenv("IMAGE_NAME")
1617
OS = os.getenv("TARGET")
1718

18-
BRANCH_TO_TEST = "2.2.x"
19+
if Version(VERSION) >= Version("3.11"):
20+
BRANCH_TO_TEST = "4.2.x"
21+
else:
22+
BRANCH_TO_TEST = "2.2.x"
1923

2024

2125
# Replacement with 'test_python_s2i_app_ex'

0 commit comments

Comments
 (0)