Skip to content

Commit b24e0a8

Browse files
committed
Do not support upgrades on Fedora
Skip in case of previous version does not exist Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
1 parent 332707a commit b24e0a8

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

test/conftest.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
TEST_APP = TEST_DIR / "test-app"
3838
VERY_LONG_IDENTIFIER = "very_long_identifier_" + "x" * 40
3939
MIGRATION_PATHS = ["12", "13", "15", "16", "18"]
40-
VERSION_DICT = {
40+
PREVIOUS_VERSION_DICT = {
4141
"13": "12",
4242
"15": "13",
4343
"16": "15",
@@ -49,12 +49,14 @@
4949
"select count(*) from staff;": "2",
5050
"select * from information_schema.tables;": "28",
5151
}
52+
RHEL9 = "none 13 15 16 18 none"
53+
RHEL10 = "none 16 18 none"
5254
UPGRADE_PATH_DICT = {
5355
"rhel8": "none 12 13 15 16 18 none",
54-
"rhel9": "none 13 15 16 18 none",
55-
"c9s": "none 13 15 16 18 none",
56-
"rhel10": "none 16 18 none",
57-
"c10s": "none 16 18 none",
56+
"rhel9": RHEL9,
57+
"c9s": RHEL9,
58+
"rhel10": RHEL10,
59+
"c10s": RHEL10,
5860
"fedora": "none 15 16 18 none",
5961
}
6062
VARS = Vars(
@@ -65,7 +67,7 @@
6567
TAG=OS.replace("rh", "-", 1),
6668
TEST_APP=TEST_APP,
6769
VERY_LONG_IDENTIFIER=VERY_LONG_IDENTIFIER,
68-
PREVIOUS_VERSION=VERSION_DICT.get(VERSION),
70+
PREVIOUS_VERSION=PREVIOUS_VERSION_DICT.get(VERSION),
6971
PAGILA=PAGILA,
7072
MIGRATION_PATHS=MIGRATION_PATHS,
7173
UPGRADE_PATH_DICT=UPGRADE_PATH_DICT,
@@ -90,14 +92,9 @@ def get_image_id(version):
9092
"""
9193
Get the image ID of the PostgreSQL container.
9294
"""
93-
ns = {
94-
"rhel8": f"registry.redhat.io/rhel8/postgresql-{version}",
95-
"rhel9": f"registry.redhat.io/rhel9/postgresql-{version}",
96-
"rhel10": f"registry.redhat.io/rhel10/postgresql-{version}",
97-
"c9s": f"quay.io/sclorg/postgresql-{version}-c9s",
98-
"c10s": f"quay.io/sclorg/postgresql-{version}-c10s",
99-
}
100-
return ns[VARS.OS]
95+
if version.startswith("rhel"):
96+
return f"registry.redhat.io/{VARS.OS}/postresql-{version}"
97+
return f"quay.io/sclorg/postgresql-{version}-{VARS.OS}"
10198

10299

103100
def check_db_output(

test/test_container_upgrade.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ def test_upgrade_functionality(self, upgrade_type, datadir):
4444
2. Create a container with the new version and run pg_upgrade
4545
3. Test if the database connection works
4646
"""
47+
if VARS.OS == "fedora":
48+
pytest.skip("Skip upgrade test on Fedora. Only CentOS Stream and RHELs are supported.")
4749
self.datadir = datadir
4850
self.upgrade_volume_dir = tempfile.mkdtemp(prefix=f"/tmp/psql-upgrade-{upgrade_type}-{datadir}")
4951
prev_version = get_upgrade_path()
50-
assert prev_version, "Previous version not found"
52+
if not prev_version:
53+
pytest.skip(f"Skipping for {VARS.OS} and version {VARS.VERSION}. No upgrade path found.")
5154
assert PodmanCLIWrapper.podman_pull_image(image_name=get_image_id(prev_version))
5255
# Override the image name to previous version
5356
self.upgrade_db.image_name = get_image_id(prev_version)

0 commit comments

Comments
 (0)