Skip to content

Commit

Permalink
[MISC] Update bundle and disable tests (#78)
Browse files Browse the repository at this point in the history
* Update bundle and disable tests

* Add empty test

* Bump lock

* No deps for empty test

* Forgotten test
  • Loading branch information
dragomirp authored May 21, 2024
1 parent 817e190 commit 90a9af2
Show file tree
Hide file tree
Showing 10 changed files with 596 additions and 541 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
bootstrap-options: "--agent-version 2.9.45" # renovate: latest
bootstrap-options: "--agent-version 3.5.0" # renovate: latest
- name: Select tests
id: select-tests
run: |
Expand Down
1,042 changes: 510 additions & 532 deletions poetry.lock

Large diffs are not rendered by default.

46 changes: 38 additions & 8 deletions releases/latest/postgresql-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,52 @@ applications:
pgbouncer:
channel: 1/edge
charm: pgbouncer
revision: 67
revision: 178
series: jammy
postgresql:
channel: 14/edge
charm: postgresql
constraints: arch=amd64
num_units: 2
revision: 324
revision: 405
series: jammy
to:
- '0'
- '1'
tls-certificates-operator:
channel: latest/stable
charm: tls-certificates-operator
self-signed-certificates:
channel: latest/edge
charm: self-signed-certificates
constraints: arch=amd64
num_units: 1
options:
ca-common-name: postgresql_bundle_ca
generate-self-signed-certificates: true
revision: 22
revision: 140
series: jammy
to:
- '2'
data-integrator:
channel: latest/edge
charm: data-integrator
constraints: arch=amd64
revision: 26
series: jammy
num_units: 1
to:
- '3'
s3-integrator:
channel: latest/edge
charm: s3-integrator
constraints: arch=amd64
revision: 17
series: jammy
num_units: 1
to:
- '4'
grafana-agent:
channel: latest/edge
charm: grafana-agent
series: jammy
revision: 136
machines:
'0':
constraints: arch=amd64
Expand All @@ -36,11 +58,19 @@ machines:
'2':
constraints: arch=amd64
series: jammy
'3':
constraints: arch=amd64
series: jammy
'4':
constraints: arch=amd64
series: jammy
name: postgresql-bundle
relations:
- - pgbouncer:backend-database
- postgresql:database
- - postgresql:certificates
- tls-certificates-operator:certificates
- self-signed-certificates:certificates
- - pgbouncer:certificates
- self-signed-certificates:certificates
series: jammy
type: bundle
7 changes: 7 additions & 0 deletions tests/integration/bundle/test_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
TEST_DBNAME = "postgresql_test_app_first_database"


async def test_none():
pass


@pytest.mark.unstable
@pytest.mark.abort_on_fail
async def test_setup(ops_test: OpsTest):
"""Deploy bundle and set up mailman for testing.
Expand Down Expand Up @@ -52,6 +57,7 @@ async def test_setup(ops_test: OpsTest):
await check_databases_creation(ops_test, [TEST_DBNAME], pgb_user, pgb_pass)


@pytest.mark.unstable
async def test_kill_pg_primary(ops_test: OpsTest):
"""Kill primary, check that all proxy instances switched traffic for a new primary."""
# Get postgres primary through action
Expand Down Expand Up @@ -84,6 +90,7 @@ async def test_kill_pg_primary(ops_test: OpsTest):
assert unit_cfg["databases"][TEST_DBNAME]["host"] == new_primary_ip


@pytest.mark.unstable
async def test_discover_dbs(ops_test: OpsTest):
"""Check that proxy discovers new members when scaling up postgres charm."""
await scale_application(ops_test, PG, 3)
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/bundle/test_read_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
PSQL = "psql"


async def test_none():
pass


# This test is being skipped until pbouncer 1.17 is implemented in a snap next cycle
@pytest.mark.skip
async def test_read_distribution(ops_test: OpsTest):
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/bundle/test_tls_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import logging

import pytest
from pytest_operator.plugin import OpsTest

from constants import PG, PGB
Expand All @@ -24,6 +25,11 @@
MAILMAN3_CORE_APP_NAME = "mailman3-core"


async def test_none():
pass


@pytest.mark.unstable
async def test_tls(ops_test: OpsTest):
await deploy_postgres_bundle(ops_test, focal=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
MULTIPLE_DATABASE_CLUSTERS_RELATION_NAME = "multiple-database-clusters"


async def test_none():
pass


@pytest.mark.unstable
@pytest.mark.abort_on_fail
async def test_database_relation_with_charm_libraries(ops_test: OpsTest):
"""Test basic functionality of database relation interface."""
Expand Down Expand Up @@ -75,6 +80,7 @@ async def test_database_relation_with_charm_libraries(ops_test: OpsTest):
)


@pytest.mark.unstable
async def test_database_version(ops_test: OpsTest):
"""Check version is accurate."""
version_query = "SELECT version();"
Expand All @@ -94,6 +100,7 @@ async def test_database_version(ops_test: OpsTest):
assert version in json.loads(run_version_query["results"])[0][0]


@pytest.mark.unstable
async def test_database_admin_permissions(ops_test: OpsTest):
"""Test admin permissions."""
create_database_query = "CREATE DATABASE another_database;"
Expand All @@ -117,6 +124,7 @@ async def test_database_admin_permissions(ops_test: OpsTest):
assert "no results to fetch" in json.loads(run_create_user_query["results"])


@pytest.mark.unstable
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."""
await scale_application(ops_test, CLIENT_APP_NAME, 1)
Expand All @@ -134,6 +142,7 @@ async def test_no_read_only_endpoint_in_standalone_cluster(ops_test: OpsTest):
), f"read-only-endpoints in pgb databag: {databag}"


@pytest.mark.unstable
async def test_no_read_only_endpoint_in_scaled_up_cluster(ops_test: OpsTest):
"""Test that there is read-only endpoint in a scaled up cluster."""
await scale_application(ops_test, CLIENT_APP_NAME, 2)
Expand All @@ -151,6 +160,7 @@ async def test_no_read_only_endpoint_in_scaled_up_cluster(ops_test: OpsTest):
), f"read-only-endpoints in pgb databag: {databag}"


@pytest.mark.unstable
async def test_two_applications_cant_relate_to_the_same_pgb(ops_test: OpsTest):
"""Test that two different application connect to the database with different credentials."""
# Set some variables to use in this test.
Expand All @@ -175,6 +185,7 @@ async def test_two_applications_cant_relate_to_the_same_pgb(ops_test: OpsTest):
pass


@pytest.mark.unstable
async def test_an_application_can_request_multiple_databases(ops_test: OpsTest):
"""Test that an application can request additional databases using the same interface.
Expand Down Expand Up @@ -207,6 +218,7 @@ async def test_an_application_can_request_multiple_databases(ops_test: OpsTest):
assert first_database_connection_string != second_database_connection_string


@pytest.mark.unstable
async def test_scaling(ops_test: OpsTest):
"""Check these relations all work when scaling pgbouncer."""
await scale_application(ops_test, CLIENT_APP_NAME, 1)
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/relations/test_backend_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import asyncio
import logging

import pytest
from pytest_operator.plugin import OpsTest
from tenacity import RetryError, Retrying, stop_after_delay, wait_fixed

Expand All @@ -24,6 +25,11 @@
logger = logging.getLogger(__name__)


async def test_none():
pass


@pytest.mark.unstable
async def test_relate_pgbouncer_to_postgres(ops_test: OpsTest):
"""Test that the pgbouncer and postgres charms can relate to one another."""
# Build, deploy, and relate charms.
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/relations/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# See LICENSE file for licensing details.
import logging

import pytest
from mailmanclient import Client
from pytest_operator.plugin import OpsTest

Expand All @@ -26,6 +27,11 @@
APPLICATION_UNITS = 1


async def test_none():
pass


@pytest.mark.unstable
async def test_mailman3_core_db(ops_test: OpsTest) -> None:
"""Deploy Mailman3 Core to test the 'db' relation."""
await deploy_postgres_bundle(ops_test, focal=True)
Expand Down
6 changes: 6 additions & 0 deletions tests/integration/relations/test_db_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# See LICENSE file for licensing details.
import logging

import pytest
from pytest_operator.plugin import OpsTest

from constants import DB_ADMIN_RELATION_NAME, PG, PGB
Expand All @@ -20,6 +21,11 @@
PSQL = "psql"


async def test_none():
pass


@pytest.mark.unstable
async def test_db_admin_with_psql(ops_test: OpsTest) -> None:
# Deploy application.
await ops_test.model.deploy(
Expand Down

0 comments on commit 90a9af2

Please sign in to comment.