From 5a89a40d3887ae985315910194d155eb18306e4c Mon Sep 17 00:00:00 2001 From: Lucas Gameiro Date: Mon, 30 Sep 2024 17:31:40 -0300 Subject: [PATCH] [MISC] Use more meaningful group naming for multi-group tests (#707) * change group names * update group name --- tests/integration/ha_tests/test_self_healing.py | 14 +++++++------- tests/integration/test_backups.py | 10 +++++----- tests/integration/test_backups_pitr.py | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/integration/ha_tests/test_self_healing.py b/tests/integration/ha_tests/test_self_healing.py index 70731da9dc..36a89728c0 100644 --- a/tests/integration/ha_tests/test_self_healing.py +++ b/tests/integration/ha_tests/test_self_healing.py @@ -52,7 +52,7 @@ MEDIAN_ELECTION_TIME = 10 -@pytest.mark.group(1) +@pytest.mark.group("ha_tests") @pytest.mark.abort_on_fail async def test_build_and_deploy(ops_test: OpsTest) -> None: """Build and deploy three unit of PostgreSQL.""" @@ -78,7 +78,7 @@ async def test_build_and_deploy(ops_test: OpsTest) -> None: await ops_test.model.wait_for_idle(status="active", timeout=1000, raise_on_error=False) -@pytest.mark.group(1) +@pytest.mark.group("ha_tests") @pytest.mark.parametrize("process", DB_PROCESSES) @pytest.mark.parametrize("signal", ["SIGTERM", pytest.param("SIGKILL", marks=markers.juju2)]) async def test_interruption_db_process( @@ -113,7 +113,7 @@ async def test_interruption_db_process( await is_cluster_updated(ops_test, primary_name) -@pytest.mark.group(1) +@pytest.mark.group("ha_tests") @pytest.mark.parametrize("process", DB_PROCESSES) async def test_freeze_db_process( ops_test: OpsTest, process: str, continuous_writes, primary_start_timeout @@ -156,7 +156,7 @@ async def test_freeze_db_process( await is_cluster_updated(ops_test, primary_name) -@pytest.mark.group(1) +@pytest.mark.group("ha_tests") @pytest.mark.unstable @pytest.mark.parametrize("process", DB_PROCESSES) @pytest.mark.parametrize("signal", ["SIGTERM", "SIGKILL"]) @@ -222,7 +222,7 @@ async def test_full_cluster_restart( await check_writes(ops_test) -@pytest.mark.group(1) +@pytest.mark.group("ha_tests") async def test_forceful_restart_without_data_and_transaction_logs( ops_test: OpsTest, continuous_writes, @@ -309,7 +309,7 @@ async def test_forceful_restart_without_data_and_transaction_logs( await is_cluster_updated(ops_test, primary_name) -@pytest.mark.group(1) +@pytest.mark.group("ha_tests") @markers.amd64_only async def test_network_cut( ops_test: OpsTest, continuous_writes, primary_start_timeout, chaos_mesh @@ -374,7 +374,7 @@ async def test_network_cut( await is_cluster_updated(ops_test, primary_name) -@pytest.mark.group(2) +@pytest.mark.group("scaling_to_zero") async def test_scaling_to_zero(ops_test: OpsTest, continuous_writes) -> None: """Scale the database to zero units and scale up again.""" # Deploy applications diff --git a/tests/integration/test_backups.py b/tests/integration/test_backups.py index a896212c98..47c6e4d426 100644 --- a/tests/integration/test_backups.py +++ b/tests/integration/test_backups.py @@ -101,7 +101,7 @@ async def cloud_configs(ops_test: OpsTest, github_secrets) -> None: bucket_object.delete() -@pytest.mark.group(1) +@pytest.mark.group("AWS") @pytest.mark.abort_on_fail async def test_backup_aws(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None: """Build and deploy two units of PostgreSQL in AWS and then test the backup and restore actions.""" @@ -205,7 +205,7 @@ async def test_backup_aws(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) - ) -@pytest.mark.group(2) +@pytest.mark.group("GCP") @pytest.mark.abort_on_fail async def test_backup_gcp(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None: """Build and deploy two units of PostgreSQL in GCP and then test the backup and restore actions.""" @@ -236,7 +236,7 @@ async def test_backup_gcp(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) - ) -@pytest.mark.group(2) +@pytest.mark.group("GCP") async def test_restore_on_new_cluster(ops_test: OpsTest, github_secrets) -> None: """Test that is possible to restore a backup to another PostgreSQL cluster.""" previous_database_app_name = f"{DATABASE_APP_NAME}-gcp" @@ -327,7 +327,7 @@ async def test_restore_on_new_cluster(ops_test: OpsTest, github_secrets) -> None connection.close() -@pytest.mark.group(2) +@pytest.mark.group("GCP") async def test_invalid_config_and_recovery_after_fixing_it( ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict] ) -> None: @@ -388,7 +388,7 @@ async def test_invalid_config_and_recovery_after_fixing_it( ) -@pytest.mark.group(2) +@pytest.mark.group("GCP") async def test_delete_pod(ops_test: OpsTest, github_secrets) -> None: logger.info("Getting original backup config") database_app_name = f"new-{DATABASE_APP_NAME}" diff --git a/tests/integration/test_backups_pitr.py b/tests/integration/test_backups_pitr.py index df98545302..3129a79c4c 100644 --- a/tests/integration/test_backups_pitr.py +++ b/tests/integration/test_backups_pitr.py @@ -293,7 +293,7 @@ async def pitr_backup_operations( ) -@pytest.mark.group(1) +@pytest.mark.group("AWS") @pytest.mark.abort_on_fail async def test_pitr_backup_aws(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None: """Build and deploy two units of PostgreSQL in AWS and then test PITR backup and restore actions.""" @@ -313,7 +313,7 @@ async def test_pitr_backup_aws(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dic ) -@pytest.mark.group(2) +@pytest.mark.group("GCP") @pytest.mark.abort_on_fail async def test_pitr_backup_gcp(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]) -> None: """Build and deploy two units of PostgreSQL in GCP and then test PITR backup and restore actions."""