Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions tests/integration/new_relations/test_new_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
INVALID_EXTRA_USER_ROLE_BLOCKING_MESSAGE = "invalid role(s) for extra user roles"


@pytest.mark.group(1)
@pytest.mark.group("main_tests")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like high availability might be a more meaningful label.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha_tests?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, this is different from K8s: we're on test_new_relations, not self_healing - what about new_relations_tests?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging this so it gets out of the way - we can always create follow ups if better ideas come!

@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."""
Expand Down Expand Up @@ -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("main_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():
Expand Down Expand Up @@ -118,7 +118,7 @@ async def test_no_read_only_endpoint_in_standalone_cluster(ops_test: OpsTest):
)


@pytest.mark.group(1)
@pytest.mark.group("main_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():
Expand All @@ -136,7 +136,7 @@ async def test_read_only_endpoint_in_scaled_up_cluster(ops_test: OpsTest):
)


@pytest.mark.group(1)
@pytest.mark.group("main_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.
Expand Down Expand Up @@ -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("main_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.
Expand All @@ -205,7 +205,7 @@ async def test_user_with_extra_roles(ops_test: OpsTest):
connection.close()


@pytest.mark.group(1)
@pytest.mark.group("main_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.
Expand Down Expand Up @@ -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("main_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
Expand Down Expand Up @@ -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("main_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
Expand Down Expand Up @@ -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("main_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.
Expand All @@ -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("main_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."""
Expand Down Expand Up @@ -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("main_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():
Expand All @@ -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("main_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]
Expand Down Expand Up @@ -524,7 +524,7 @@ async def test_admin_role(ops_test: OpsTest):
connection.close()


@pytest.mark.group(1)
@pytest.mark.group("main_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.
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/test_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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."""
Expand All @@ -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"
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_backups_pitr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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."""
Expand Down
Loading