Skip to content

Commit bde6803

Browse files
author
Lucas Gameiro
authored
[MISC] Use more meaningful group naming for multi-group tests (#625)
* update group names * update naming
1 parent 58ff61a commit bde6803

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

tests/integration/new_relations/test_new_relations.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE = "invalid role(s) for extra user roles"
3838

3939

40-
@pytest.mark.group(1)
40+
@pytest.mark.group("new_relations_tests")
4141
@pytest.mark.abort_on_fail
4242
async def test_deploy_charms(ops_test: OpsTest, charm):
4343
"""Deploy both charms (application and database) to use in the tests."""
@@ -71,7 +71,7 @@ async def test_deploy_charms(ops_test: OpsTest, charm):
7171
await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active", timeout=3000)
7272

7373

74-
@pytest.mark.group(1)
74+
@pytest.mark.group("new_relations_tests")
7575
async def test_no_read_only_endpoint_in_standalone_cluster(ops_test: OpsTest):
7676
"""Test that there is no read-only endpoint in a standalone cluster."""
7777
async with ops_test.fast_forward():
@@ -118,7 +118,7 @@ async def test_no_read_only_endpoint_in_standalone_cluster(ops_test: OpsTest):
118118
)
119119

120120

121-
@pytest.mark.group(1)
121+
@pytest.mark.group("new_relations_tests")
122122
async def test_read_only_endpoint_in_scaled_up_cluster(ops_test: OpsTest):
123123
"""Test that there is read-only endpoint in a scaled up cluster."""
124124
async with ops_test.fast_forward():
@@ -136,7 +136,7 @@ async def test_read_only_endpoint_in_scaled_up_cluster(ops_test: OpsTest):
136136
)
137137

138138

139-
@pytest.mark.group(1)
139+
@pytest.mark.group("new_relations_tests")
140140
async def test_database_relation_with_charm_libraries(ops_test: OpsTest):
141141
"""Test basic functionality of database relation interface."""
142142
# 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):
184184
cursor.execute("DROP TABLE test;")
185185

186186

187-
@pytest.mark.group(1)
187+
@pytest.mark.group("new_relations_tests")
188188
async def test_user_with_extra_roles(ops_test: OpsTest):
189189
"""Test superuser actions and the request for more permissions."""
190190
# Get the connection string to connect to the database.
@@ -205,7 +205,7 @@ async def test_user_with_extra_roles(ops_test: OpsTest):
205205
connection.close()
206206

207207

208-
@pytest.mark.group(1)
208+
@pytest.mark.group("new_relations_tests")
209209
async def test_two_applications_doesnt_share_the_same_relation_data(ops_test: OpsTest):
210210
"""Test that two different application connect to the database with different credentials."""
211211
# 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
259259
psycopg2.connect(connection_string)
260260

261261

262-
@pytest.mark.group(1)
262+
@pytest.mark.group("new_relations_tests")
263263
async def test_an_application_can_connect_to_multiple_database_clusters(ops_test: OpsTest):
264264
"""Test that an application can connect to different clusters of the same database."""
265265
# Relate the application with both database clusters
@@ -290,7 +290,7 @@ async def test_an_application_can_connect_to_multiple_database_clusters(ops_test
290290
assert application_connection_string != another_application_connection_string
291291

292292

293-
@pytest.mark.group(1)
293+
@pytest.mark.group("new_relations_tests")
294294
async def test_an_application_can_connect_to_multiple_aliased_database_clusters(ops_test: OpsTest):
295295
"""Test that an application can connect to different clusters of the same database."""
296296
# Relate the application with both database clusters
@@ -324,7 +324,7 @@ async def test_an_application_can_connect_to_multiple_aliased_database_clusters(
324324
assert application_connection_string != another_application_connection_string
325325

326326

327-
@pytest.mark.group(1)
327+
@pytest.mark.group("new_relations_tests")
328328
async def test_an_application_can_request_multiple_databases(ops_test: OpsTest):
329329
"""Test that an application can request additional databases using the same interface."""
330330
# 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):
345345
assert first_database_connection_string != second_database_connection_string
346346

347347

348-
@pytest.mark.group(1)
348+
@pytest.mark.group("new_relations_tests")
349349
@pytest.mark.abort_on_fail
350350
async def test_relation_data_is_updated_correctly_when_scaling(ops_test: OpsTest):
351351
"""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
424424
psycopg2.connect(primary_connection_string)
425425

426426

427-
@pytest.mark.group(1)
427+
@pytest.mark.group("new_relations_tests")
428428
async def test_relation_with_no_database_name(ops_test: OpsTest):
429429
"""Test that a relation with no database name doesn't block the charm."""
430430
async with ops_test.fast_forward():
@@ -441,7 +441,7 @@ async def test_relation_with_no_database_name(ops_test: OpsTest):
441441
await ops_test.model.wait_for_idle(apps=APP_NAMES, status="active", raise_on_blocked=True)
442442

443443

444-
@pytest.mark.group(1)
444+
@pytest.mark.group("new_relations_tests")
445445
async def test_admin_role(ops_test: OpsTest):
446446
"""Test that the admin role gives access to all the databases."""
447447
all_app_names = [DATA_INTEGRATOR_APP_NAME]
@@ -524,7 +524,7 @@ async def test_admin_role(ops_test: OpsTest):
524524
connection.close()
525525

526526

527-
@pytest.mark.group(1)
527+
@pytest.mark.group("new_relations_tests")
528528
async def test_invalid_extra_user_roles(ops_test: OpsTest):
529529
async with ops_test.fast_forward():
530530
# 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):
586586
)
587587

588588

589-
@pytest.mark.group(2)
589+
@pytest.mark.group("nextcloud_blocked")
590590
@markers.amd64_only # nextcloud charm not available for arm64
591591
async def test_nextcloud_db_blocked(ops_test: OpsTest, charm: str) -> None:
592592
# Deploy Database Charm and Nextcloud

tests/integration/test_backups.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def cloud_configs(github_secrets) -> None:
9797
bucket_object.delete()
9898

9999

100-
@pytest.mark.group(1)
100+
@pytest.mark.group("AWS")
101101
@pytest.mark.abort_on_fail
102102
async def test_backup_aws(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict], charm) -> None:
103103
"""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
188188
await ops_test.model.remove_application(tls_certificates_app_name, block_until_done=True)
189189

190190

191-
@pytest.mark.group(2)
191+
@pytest.mark.group("GCP")
192192
@pytest.mark.abort_on_fail
193193
async def test_backup_gcp(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict], charm) -> None:
194194
"""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
215215
await ops_test.model.remove_application(tls_certificates_app_name, block_until_done=True)
216216

217217

218-
@pytest.mark.group(2)
218+
@pytest.mark.group("GCP")
219219
async def test_restore_on_new_cluster(ops_test: OpsTest, github_secrets, charm) -> None:
220220
"""Test that is possible to restore a backup to another PostgreSQL cluster."""
221221
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)
308308
connection.close()
309309

310310

311-
@pytest.mark.group(2)
311+
@pytest.mark.group("GCP")
312312
async def test_invalid_config_and_recovery_after_fixing_it(
313313
ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict]
314314
) -> None:

tests/integration/test_backups_pitr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ async def pitr_backup_operations(
284284
await ops_test.model.remove_application(tls_certificates_app_name, block_until_done=True)
285285

286286

287-
@pytest.mark.group(1)
287+
@pytest.mark.group("AWS")
288288
@pytest.mark.abort_on_fail
289289
async def test_pitr_backup_aws(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict], charm) -> None:
290290
"""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
304304
)
305305

306306

307-
@pytest.mark.group(2)
307+
@pytest.mark.group("GCP")
308308
@pytest.mark.abort_on_fail
309309
async def test_pitr_backup_gcp(ops_test: OpsTest, cloud_configs: Tuple[Dict, Dict], charm) -> None:
310310
"""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."""

0 commit comments

Comments
 (0)