diff --git a/tests/integration/new_relations/test_new_relations.py b/tests/integration/new_relations/test_new_relations.py index 6ce4f14700..68f618a972 100644 --- a/tests/integration/new_relations/test_new_relations.py +++ b/tests/integration/new_relations/test_new_relations.py @@ -37,7 +37,7 @@ INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE = "invalid role(s) for extra user roles" -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") @pytest.mark.abort_on_fail async def test_deploy_charms(ops_test: OpsTest, charm): """Deploy both charms (application and database) to use in the tests.""" @@ -71,7 +71,7 @@ async def test_deploy_charms(ops_test: OpsTest, charm): await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active", timeout=3000) -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") async def test_no_read_only_endpoint_in_standalone_cluster(ops_test: OpsTest): """Test that there is no read-only endpoint in a standalone cluster.""" async with ops_test.fast_forward(): @@ -118,7 +118,7 @@ async def test_no_read_only_endpoint_in_standalone_cluster(ops_test: OpsTest): ) -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") async def test_read_only_endpoint_in_scaled_up_cluster(ops_test: OpsTest): """Test that there is read-only endpoint in a scaled up cluster.""" async with ops_test.fast_forward(): @@ -136,7 +136,7 @@ async def test_read_only_endpoint_in_scaled_up_cluster(ops_test: OpsTest): ) -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") async def test_database_relation_with_charm_libraries(ops_test: OpsTest): """Test basic functionality of database relation interface.""" # Get the connection string to connect to the database using the read/write endpoint. @@ -184,7 +184,7 @@ async def test_database_relation_with_charm_libraries(ops_test: OpsTest): cursor.execute("DROP TABLE test;") -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") async def test_user_with_extra_roles(ops_test: OpsTest): """Test superuser actions and the request for more permissions.""" # Get the connection string to connect to the database. @@ -205,7 +205,7 @@ async def test_user_with_extra_roles(ops_test: OpsTest): connection.close() -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") async def test_two_applications_doesnt_share_the_same_relation_data(ops_test: OpsTest): """Test that two different application connect to the database with different credentials.""" # Set some variables to use in this test. @@ -259,7 +259,7 @@ async def test_two_applications_doesnt_share_the_same_relation_data(ops_test: Op psycopg2.connect(connection_string) -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") async def test_an_application_can_connect_to_multiple_database_clusters(ops_test: OpsTest): """Test that an application can connect to different clusters of the same database.""" # Relate the application with both database clusters @@ -290,7 +290,7 @@ async def test_an_application_can_connect_to_multiple_database_clusters(ops_test assert application_connection_string != another_application_connection_string -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") async def test_an_application_can_connect_to_multiple_aliased_database_clusters(ops_test: OpsTest): """Test that an application can connect to different clusters of the same database.""" # Relate the application with both database clusters @@ -324,7 +324,7 @@ async def test_an_application_can_connect_to_multiple_aliased_database_clusters( assert application_connection_string != another_application_connection_string -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") async def test_an_application_can_request_multiple_databases(ops_test: OpsTest): """Test that an application can request additional databases using the same interface.""" # Relate the charms using another relation and wait for them exchanging some connection data. @@ -345,7 +345,7 @@ async def test_an_application_can_request_multiple_databases(ops_test: OpsTest): assert first_database_connection_string != second_database_connection_string -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") @pytest.mark.abort_on_fail async def test_relation_data_is_updated_correctly_when_scaling(ops_test: OpsTest): """Test that relation data, like connection data, is updated correctly when scaling.""" @@ -424,7 +424,7 @@ async def test_relation_data_is_updated_correctly_when_scaling(ops_test: OpsTest psycopg2.connect(primary_connection_string) -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") async def test_relation_with_no_database_name(ops_test: OpsTest): """Test that a relation with no database name doesn't block the charm.""" async with ops_test.fast_forward(): @@ -441,7 +441,7 @@ async def test_relation_with_no_database_name(ops_test: OpsTest): await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active", raise_on_blocked=True) -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") async def test_admin_role(ops_test: OpsTest): """Test that the admin role gives access to all the databases.""" all_app_names = [DATA_INTEGRATOR_APP_NAME] @@ -524,7 +524,7 @@ async def test_admin_role(ops_test: OpsTest): connection.close() -@pytest.mark.group(1) +@pytest.mark.group("new_relations_tests") async def test_invalid_extra_user_roles(ops_test: OpsTest): async with ops_test.fast_forward(): # Remove the relation between the database and the first data integrator. @@ -586,7 +586,7 @@ async def test_invalid_extra_user_roles(ops_test: OpsTest): ) -@pytest.mark.group(2) +@pytest.mark.group("nextcloud_blocked") @markers.amd64_only # nextcloud charm not available for arm64 async def test_nextcloud_db_blocked(ops_test: OpsTest, charm: str) -> None: # Deploy Database Charm and Nextcloud diff --git a/tests/integration/test_backups.py b/tests/integration/test_backups.py index 70137b4f37..d1961f3478 100644 --- a/tests/integration/test_backups.py +++ b/tests/integration/test_backups.py @@ -97,7 +97,7 @@ async def cloud_configs(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], charm) -> None: """Build and deploy two units of PostgreSQL in AWS, test backup and restore actions.""" @@ -188,7 +188,7 @@ async def test_backup_aws(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict], c await ops_test.model.remove_application(tls_certificates_app_name, block_until_done=True) -@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], charm) -> None: """Build and deploy two units of PostgreSQL in GCP, test backup and restore actions.""" @@ -215,7 +215,7 @@ async def test_backup_gcp(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict], c await ops_test.model.remove_application(tls_certificates_app_name, block_until_done=True) -@pytest.mark.group(2) +@pytest.mark.group("GCP") async def test_restore_on_new_cluster(ops_test: OpsTest, github_secrets, charm) -> None: """Test that is possible to restore a backup to another PostgreSQL cluster.""" previous_database_app_name = f"{DATABASE_APP_NAME}-gcp" @@ -308,7 +308,7 @@ async def test_restore_on_new_cluster(ops_test: OpsTest, github_secrets, charm) 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: diff --git a/tests/integration/test_backups_pitr.py b/tests/integration/test_backups_pitr.py index 500ac5fd7d..94ef8ae5a8 100644 --- a/tests/integration/test_backups_pitr.py +++ b/tests/integration/test_backups_pitr.py @@ -284,7 +284,7 @@ async def pitr_backup_operations( await ops_test.model.remove_application(tls_certificates_app_name, block_until_done=True) -@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], charm) -> None: """Build, deploy two units of PostgreSQL and do backup in AWS. Then, write new data into DB, switch WAL file and test point-in-time-recovery restore action.""" @@ -304,7 +304,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], charm) -> None: """Build, deploy two units of PostgreSQL and do backup in GCP. Then, write new data into DB, switch WAL file and test point-in-time-recovery restore action."""