From 82913291b6e9d2ead30a0b5c63554c97caea4de6 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 12 Jul 2026 14:54:16 +0200 Subject: [PATCH] test(e2e): SPOT db images, PG18 mount layout, drop removed flags Add a single source of truth in tests/e2e/helpers.py for the database images and their in-container data dirs (POSTGRES_IMAGE=postgres:alpine, POSTGRES_DATA_DIR=/var/lib/postgresql, MARIADB_IMAGE=mariadb:latest, MARIADB_DATA_DIR=/var/lib/mysql) and route every test through it. postgres:alpine now tracks 18+, which refuses a mount at /var/lib/postgresql/data and stores data under /var/lib/postgresql, so the mounts and the marker path move there. Drop the --rsync-image and the renamed hard-restart flag from the invocations. Co-Authored-By: Claude Fable 5 --- tests/e2e/helpers.py | 10 +++++++++- tests/e2e/test_e2e_dump_only_fallback_to_files.py | 12 ++++++------ tests/e2e/test_e2e_dump_only_sql_mixed_run.py | 6 ++++-- tests/e2e/test_e2e_files_full.py | 2 -- .../test_e2e_images_no_backup_required_early_skip.py | 2 +- tests/e2e/test_e2e_mariadb_anonymous_preemption.py | 6 ++++-- tests/e2e/test_e2e_mariadb_full.py | 6 ++++-- tests/e2e/test_e2e_mariadb_no_copy.py | 6 ++++-- tests/e2e/test_e2e_postgres_full.py | 6 ++++-- tests/e2e/test_e2e_postgres_no_copy.py | 6 ++++-- ...t_e2e_seed_star_and_db_entries_backup_postgres.py | 6 ++++-- 11 files changed, 44 insertions(+), 24 deletions(-) diff --git a/tests/e2e/helpers.py b/tests/e2e/helpers.py index 2d4a609..c37bd45 100644 --- a/tests/e2e/helpers.py +++ b/tests/e2e/helpers.py @@ -7,6 +7,14 @@ import time import uuid from pathlib import Path +# SPOT for the database images and their in-container data dirs the e2e +# suite runs against. postgres:alpine tracks latest (18+), which mounts at +# /var/lib/postgresql (not /var/lib/postgresql/data); bump here only. +POSTGRES_IMAGE = "postgres:alpine" +POSTGRES_DATA_DIR = "/var/lib/postgresql" +MARIADB_IMAGE = "mariadb:latest" +MARIADB_DATA_DIR = "/var/lib/mysql" + def run( cmd: list[str], @@ -172,7 +180,7 @@ def backup_run( "baudolo", "--compose-dir", compose_dir, - "--docker-compose-hard-restart-required", + "--hard-compose-restart", "mailu", "--repo-name", repo_name, diff --git a/tests/e2e/test_e2e_dump_only_fallback_to_files.py b/tests/e2e/test_e2e_dump_only_fallback_to_files.py index fa458c1..db239bc 100644 --- a/tests/e2e/test_e2e_dump_only_fallback_to_files.py +++ b/tests/e2e/test_e2e_dump_only_fallback_to_files.py @@ -2,6 +2,8 @@ import unittest from .helpers import ( + POSTGRES_IMAGE, + POSTGRES_DATA_DIR, backup_path, cleanup_docker, create_minimal_compose_dir, @@ -50,8 +52,8 @@ class TestE2EDumpOnlyFallbackToFiles(unittest.TestCase): "-e", "POSTGRES_USER=postgres", "-v", - f"{cls.pg_volume}:/var/lib/postgresql/data", - "postgres:16", + f"{cls.pg_volume}:{POSTGRES_DATA_DIR}", + POSTGRES_IMAGE, ] ) wait_for_postgres(cls.pg_container, user="postgres", timeout_s=90) @@ -65,7 +67,7 @@ class TestE2EDumpOnlyFallbackToFiles(unittest.TestCase): cls.pg_container, "sh", "-lc", - f"echo '{cls.marker}' > /var/lib/postgresql/data/marker.txt", + f"echo '{cls.marker}' > {POSTGRES_DATA_DIR}/marker.txt", ] ) @@ -79,7 +81,7 @@ class TestE2EDumpOnlyFallbackToFiles(unittest.TestCase): "baudolo", "--compose-dir", cls.compose_dir, - "--docker-compose-hard-restart-required", + "--hard-compose-restart", "mailu", "--repo-name", cls.repo_name, @@ -116,8 +118,6 @@ class TestE2EDumpOnlyFallbackToFiles(unittest.TestCase): cls.repo_name, "--source-volume", cls.pg_volume, - "--rsync-image", - "ghcr.io/kevinveenbirkenbach/alpine-rsync", ] ) diff --git a/tests/e2e/test_e2e_dump_only_sql_mixed_run.py b/tests/e2e/test_e2e_dump_only_sql_mixed_run.py index ae94df8..e28f2b5 100644 --- a/tests/e2e/test_e2e_dump_only_sql_mixed_run.py +++ b/tests/e2e/test_e2e_dump_only_sql_mixed_run.py @@ -1,6 +1,8 @@ import unittest from .helpers import ( + POSTGRES_IMAGE, + POSTGRES_DATA_DIR, backup_path, cleanup_docker, create_minimal_compose_dir, @@ -70,8 +72,8 @@ class TestE2EDumpOnlySqlMixedRun(unittest.TestCase): "-e", f"POSTGRES_PASSWORD={cls.pg_password}", "-v", - f"{cls.db_volume}:/var/lib/postgresql/data", - "postgres:16-alpine", + f"{cls.db_volume}:{POSTGRES_DATA_DIR}", + POSTGRES_IMAGE, ] ) wait_for_postgres(cls.pg_container, user="postgres", timeout_s=90) diff --git a/tests/e2e/test_e2e_files_full.py b/tests/e2e/test_e2e_files_full.py index e40d18b..73a8e76 100644 --- a/tests/e2e/test_e2e_files_full.py +++ b/tests/e2e/test_e2e_files_full.py @@ -94,8 +94,6 @@ class TestE2EFilesFull(unittest.TestCase): self.repo_name, "--source-volume", self.volume_src, - "--rsync-image", - "ghcr.io/kevinveenbirkenbach/alpine-rsync", ] ) diff --git a/tests/e2e/test_e2e_images_no_backup_required_early_skip.py b/tests/e2e/test_e2e_images_no_backup_required_early_skip.py index 619d38f..c5fc646 100644 --- a/tests/e2e/test_e2e_images_no_backup_required_early_skip.py +++ b/tests/e2e/test_e2e_images_no_backup_required_early_skip.py @@ -76,7 +76,7 @@ class TestE2EImagesNoBackupRequiredEarlySkip(unittest.TestCase): "baudolo", "--compose-dir", cls.compose_dir, - "--docker-compose-hard-restart-required", + "--hard-compose-restart", "mailu", "--repo-name", cls.repo_name, diff --git a/tests/e2e/test_e2e_mariadb_anonymous_preemption.py b/tests/e2e/test_e2e_mariadb_anonymous_preemption.py index c16f745..4a9171b 100644 --- a/tests/e2e/test_e2e_mariadb_anonymous_preemption.py +++ b/tests/e2e/test_e2e_mariadb_anonymous_preemption.py @@ -30,6 +30,8 @@ import pandas from baudolo.backup import db as db_mod from .helpers import ( + MARIADB_IMAGE, + MARIADB_DATA_DIR, cleanup_docker, require_docker, run, @@ -69,8 +71,8 @@ class TestE2EMariaDBAnonymousPreemption(unittest.TestCase): "-e", f"MARIADB_ROOT_PASSWORD={cls.root_password}", "-v", - f"{cls.db_volume}:/var/lib/mysql", - "mariadb:12.2", + f"{cls.db_volume}:{MARIADB_DATA_DIR}", + MARIADB_IMAGE, ] ) diff --git a/tests/e2e/test_e2e_mariadb_full.py b/tests/e2e/test_e2e_mariadb_full.py index 3f23b9a..ffce700 100644 --- a/tests/e2e/test_e2e_mariadb_full.py +++ b/tests/e2e/test_e2e_mariadb_full.py @@ -2,6 +2,8 @@ import unittest from .helpers import ( + MARIADB_IMAGE, + MARIADB_DATA_DIR, backup_run, backup_path, cleanup_docker, @@ -56,8 +58,8 @@ class TestE2EMariaDBFull(unittest.TestCase): "-e", f"MARIADB_PASSWORD={cls.db_password}", "-v", - f"{cls.db_volume}:/var/lib/mysql", - "mariadb:11", + f"{cls.db_volume}:{MARIADB_DATA_DIR}", + MARIADB_IMAGE, ] ) diff --git a/tests/e2e/test_e2e_mariadb_no_copy.py b/tests/e2e/test_e2e_mariadb_no_copy.py index 68a0dca..96a324a 100644 --- a/tests/e2e/test_e2e_mariadb_no_copy.py +++ b/tests/e2e/test_e2e_mariadb_no_copy.py @@ -2,6 +2,8 @@ import unittest from .helpers import ( + MARIADB_IMAGE, + MARIADB_DATA_DIR, backup_run, backup_path, cleanup_docker, @@ -55,8 +57,8 @@ class TestE2EMariaDBNoCopy(unittest.TestCase): "-e", f"MARIADB_PASSWORD={cls.db_password}", "-v", - f"{cls.db_volume}:/var/lib/mysql", - "mariadb:11", + f"{cls.db_volume}:{MARIADB_DATA_DIR}", + MARIADB_IMAGE, ] ) diff --git a/tests/e2e/test_e2e_postgres_full.py b/tests/e2e/test_e2e_postgres_full.py index fde00ad..a789334 100644 --- a/tests/e2e/test_e2e_postgres_full.py +++ b/tests/e2e/test_e2e_postgres_full.py @@ -2,6 +2,8 @@ import unittest from .helpers import ( + POSTGRES_IMAGE, + POSTGRES_DATA_DIR, backup_run, backup_path, cleanup_docker, @@ -47,8 +49,8 @@ class TestE2EPostgresFull(unittest.TestCase): "-e", "POSTGRES_USER=postgres", "-v", - f"{cls.pg_volume}:/var/lib/postgresql/data", - "postgres:16", + f"{cls.pg_volume}:{POSTGRES_DATA_DIR}", + POSTGRES_IMAGE, ] ) wait_for_postgres(cls.pg_container, user="postgres", timeout_s=90) diff --git a/tests/e2e/test_e2e_postgres_no_copy.py b/tests/e2e/test_e2e_postgres_no_copy.py index 28570a8..55c2703 100644 --- a/tests/e2e/test_e2e_postgres_no_copy.py +++ b/tests/e2e/test_e2e_postgres_no_copy.py @@ -2,6 +2,8 @@ import unittest from .helpers import ( + POSTGRES_IMAGE, + POSTGRES_DATA_DIR, backup_run, backup_path, cleanup_docker, @@ -46,8 +48,8 @@ class TestE2EPostgresNoCopy(unittest.TestCase): "-e", "POSTGRES_USER=postgres", "-v", - f"{cls.pg_volume}:/var/lib/postgresql/data", - "postgres:16", + f"{cls.pg_volume}:{POSTGRES_DATA_DIR}", + POSTGRES_IMAGE, ] ) wait_for_postgres(cls.pg_container, user="postgres", timeout_s=90) diff --git a/tests/e2e/test_e2e_seed_star_and_db_entries_backup_postgres.py b/tests/e2e/test_e2e_seed_star_and_db_entries_backup_postgres.py index 88a11d7..7eb71dc 100644 --- a/tests/e2e/test_e2e_seed_star_and_db_entries_backup_postgres.py +++ b/tests/e2e/test_e2e_seed_star_and_db_entries_backup_postgres.py @@ -1,6 +1,8 @@ import unittest from .helpers import ( + POSTGRES_IMAGE, + POSTGRES_DATA_DIR, backup_path, cleanup_docker, create_minimal_compose_dir, @@ -66,8 +68,8 @@ class TestE2ESeedStarAndDbEntriesBackupPostgres(unittest.TestCase): "-e", f"POSTGRES_PASSWORD={cls.pg_password}", "-v", - f"{cls.db_volume}:/var/lib/postgresql/data", - "postgres:16-alpine", + f"{cls.db_volume}:{POSTGRES_DATA_DIR}", + POSTGRES_IMAGE, ] ) wait_for_postgres(cls.pg_container, user="postgres", timeout_s=90)