Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Triggering build on the bundle (#272)
Browse files Browse the repository at this point in the history
* Triggering build on the bundle

* Adding channel to fix PostgreSQL deployment

* Adding trust to PostgreSQL deployments

* Marking redeploy tests with xfail due to a bug in postgres

* Reducing timeout for the tests marked with xfail
  • Loading branch information
Gmerold authored May 30, 2023
1 parent adaa304 commit 9d7e1db
Show file tree
Hide file tree
Showing 46 changed files with 196 additions and 64 deletions.
1 change: 1 addition & 0 deletions nms-magmalte-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ juju run-action nms-magmalte/leader create-nms-admin-user \

Default: ghcr.io/canonical/magma-orc8r-nms-magmalte:1.8.0


41 changes: 24 additions & 17 deletions nms-magmalte-operator/tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ def _find_charm(charm_dir: str, charm_file_name: str) -> Optional[str]:

@staticmethod
async def _deploy_postgresql(ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name=DB_APPLICATION_NAME)
await ops_test.model.deploy(
DB_APPLICATION_NAME,
application_name=DB_APPLICATION_NAME,
channel="14/stable",
trust=True,
)

@staticmethod
async def _deploy_tls_certificates_operator(ops_test):
Expand Down Expand Up @@ -129,22 +134,6 @@ async def test_relate_and_wait_for_idle(self, ops_test, setup, build_and_deploy_
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="active", timeout=1000)

async def test_remove_db_application(self, ops_test, setup, build_and_deploy_charm):
await ops_test.model.remove_application(
DB_APPLICATION_NAME, block_until_done=True, force=True
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="blocked", timeout=1000)

async def test_redeploy_db(self, ops_test, setup, build_and_deploy_charm):
await self._deploy_postgresql(ops_test)
await ops_test.model.add_relation(
relation1=CERTIFIER_APPLICATION_NAME, relation2="postgresql-k8s:db"
)
await ops_test.model.add_relation(
relation1=APPLICATION_NAME, relation2="postgresql-k8s:db"
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="active", timeout=1000)

async def test_scale_up(self, ops_test, setup, build_and_deploy_charm):
await ops_test.model.applications[APPLICATION_NAME].scale(2)

Expand All @@ -159,3 +148,21 @@ async def test_scale_down(self, ops_test, setup, build_and_deploy_charm):
await ops_test.model.wait_for_idle(
apps=[APPLICATION_NAME], status="active", timeout=60, wait_for_exact_units=1
)

@pytest.mark.xfail(reason="Postgrest bug https://warthogs.atlassian.net/browse/DPE-1470")
async def test_remove_db_application(self, ops_test, setup, build_and_deploy_charm):
await ops_test.model.remove_application(
DB_APPLICATION_NAME, block_until_done=True, force=True
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="blocked", timeout=60)

@pytest.mark.xfail(reason="Postgrest bug https://warthogs.atlassian.net/browse/DPE-1470")
async def test_redeploy_db(self, ops_test, setup, build_and_deploy_charm):
await self._deploy_postgresql(ops_test)
await ops_test.model.add_relation(
relation1=CERTIFIER_APPLICATION_NAME, relation2="postgresql-k8s:db"
)
await ops_test.model.add_relation(
relation1=APPLICATION_NAME, relation2="postgresql-k8s:db"
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="active", timeout=60)
1 change: 1 addition & 0 deletions nms-nginx-proxy-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ juju relate nms-nginx-proxy nms-magmalte
## OCI Images

- magma-nms-nginx-proxy-image: `ghcr.io/canonical/nginx:1.23.3`

Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ def _find_charm(charm_dir: str, charm_file_name: str) -> Optional[str]:

@staticmethod
async def _deploy_postgresql(ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name="postgresql-k8s")
await ops_test.model.deploy(
"postgresql-k8s",
application_name="postgresql-k8s",
channel="14/stable",
trust=True,
)

@staticmethod
async def _deploy_tls_certificates_operator(ops_test):
Expand Down
1 change: 1 addition & 0 deletions orc8r-accessd-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ The current setup has only been tested with relation to the `postgresql-k8s` cha

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


7 changes: 6 additions & 1 deletion orc8r-accessd-operator/tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ class TestOrc8rAccessd:
@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
async def setup(self, ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name="postgresql-k8s")
await ops_test.model.deploy(
"postgresql-k8s",
application_name="postgresql-k8s",
channel="14/stable",
trust=True,
)

@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
Expand Down
1 change: 1 addition & 0 deletions orc8r-analytics-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ juju deploy magma-orc8r-analytics orc8r-analytics

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


1 change: 1 addition & 0 deletions orc8r-bootstrapper-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ juju relate orc8r-bootstrapper:cert-root-ca orc8r-certifier:cert-root-ca

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


41 changes: 24 additions & 17 deletions orc8r-bootstrapper-operator/tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ def _find_charm(charm_dir: str, charm_file_name: str) -> Optional[str]:

@staticmethod
async def _deploy_postgresql(ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name=DB_APPLICATION_NAME)
await ops_test.model.deploy(
DB_APPLICATION_NAME,
application_name=DB_APPLICATION_NAME,
channel="14/stable",
trust=True,
)

@staticmethod
async def _deploy_tls_certificates_operator(ops_test):
Expand Down Expand Up @@ -106,22 +111,6 @@ async def test_relate_and_wait_for_idle(self, ops_test, setup, build_and_deploy)
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="active", timeout=1000)

async def test_remove_db_application(self, ops_test, setup, build_and_deploy):
await ops_test.model.remove_application(
DB_APPLICATION_NAME, block_until_done=True, force=True
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="blocked", timeout=1000)

async def test_redeploy_db(self, ops_test, setup, build_and_deploy):
await self._deploy_postgresql(ops_test)
await ops_test.model.add_relation(
relation1=CERTIFIER_APPLICATION_NAME, relation2="postgresql-k8s:db"
)
await ops_test.model.add_relation(
relation1=APPLICATION_NAME, relation2="postgresql-k8s:db"
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="active", timeout=1000)

async def test_scale_up(self, ops_test, setup, build_and_deploy):
await ops_test.model.applications[APPLICATION_NAME].scale(2)

Expand All @@ -136,3 +125,21 @@ async def test_scale_down(self, ops_test, setup, build_and_deploy):
await ops_test.model.wait_for_idle(
apps=[APPLICATION_NAME], status="active", timeout=60, wait_for_exact_units=1
)

@pytest.mark.xfail(reason="Postgrest bug https://warthogs.atlassian.net/browse/DPE-1470")
async def test_remove_db_application(self, ops_test, setup, build_and_deploy):
await ops_test.model.remove_application(
DB_APPLICATION_NAME, block_until_done=True, force=True
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="blocked", timeout=60)

@pytest.mark.xfail(reason="Postgrest bug https://warthogs.atlassian.net/browse/DPE-1470")
async def test_redeploy_db(self, ops_test, setup, build_and_deploy):
await self._deploy_postgresql(ops_test)
await ops_test.model.add_relation(
relation1=CERTIFIER_APPLICATION_NAME, relation2="postgresql-k8s:db"
)
await ops_test.model.add_relation(
relation1=APPLICATION_NAME, relation2="postgresql-k8s:db"
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="active", timeout=60)
1 change: 1 addition & 0 deletions orc8r-bundle/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Placeholder

1 change: 1 addition & 0 deletions orc8r-certifier-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ user and vault-k8s (for self-signed certificates)

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


40 changes: 26 additions & 14 deletions orc8r-certifier-operator/tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ class TestOrc8rCertifier:
@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
async def setup(self, ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name=DB_APPLICATION_NAME)
await ops_test.model.deploy(
DB_APPLICATION_NAME,
application_name=DB_APPLICATION_NAME,
channel="14/stable",
trust=True,
)
await self._deploy_tls_certificates_operator(ops_test)

@staticmethod
Expand Down Expand Up @@ -64,19 +69,6 @@ async def test_build_and_deploy(self, ops_test, setup, build_and_deploy):
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="active", timeout=1000)

async def test_remove_db_application(self, ops_test, setup, build_and_deploy):
await ops_test.model.remove_application(
DB_APPLICATION_NAME, block_until_done=True, force=True
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="blocked", timeout=1000)

async def test_redeploy_db(self, ops_test, setup, build_and_deploy):
await ops_test.model.deploy("postgresql-k8s", application_name=DB_APPLICATION_NAME)
await ops_test.model.add_relation(
relation1=APPLICATION_NAME, relation2="postgresql-k8s:db"
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="active", timeout=1000)

async def test_build_and_deploy_and_scale_up(self, ops_test, setup, build_and_deploy):
await ops_test.model.applications[APPLICATION_NAME].scale(2)

Expand All @@ -91,3 +83,23 @@ async def test_build_and_deploy_and_scale_down(self, ops_test, setup, build_and_
await ops_test.model.wait_for_idle(
apps=[APPLICATION_NAME], status="active", timeout=60, wait_for_exact_units=1
)

@pytest.mark.xfail(reason="Postgrest bug https://warthogs.atlassian.net/browse/DPE-1470")
async def test_remove_db_application(self, ops_test, setup, build_and_deploy):
await ops_test.model.remove_application(
DB_APPLICATION_NAME, block_until_done=True, force=True
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="blocked", timeout=60)

@pytest.mark.xfail(reason="Postgrest bug https://warthogs.atlassian.net/browse/DPE-1470")
async def test_redeploy_db(self, ops_test, setup, build_and_deploy):
await ops_test.model.deploy(
DB_APPLICATION_NAME,
application_name=DB_APPLICATION_NAME,
channel="14/stable",
trust=True,
)
await ops_test.model.add_relation(
relation1=APPLICATION_NAME, relation2="postgresql-k8s:db"
)
await ops_test.model.wait_for_idle(apps=[APPLICATION_NAME], status="active", timeout=60)
1 change: 1 addition & 0 deletions orc8r-configurator-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ The current setup has only been tested with relation to the `postgresql-k8s` cha

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ class TestOrc8rConfigurator:
@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
async def setup(self, ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name="postgresql-k8s")
await ops_test.model.deploy(
"postgresql-k8s",
application_name="postgresql-k8s",
channel="14/stable",
trust=True,
)

@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
Expand Down
1 change: 1 addition & 0 deletions orc8r-ctraced-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ The current setup has only been tested with relation to the `postgresql-k8s` cha

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


7 changes: 6 additions & 1 deletion orc8r-ctraced-operator/tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ class TestOrc8rCtraced:
@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
async def setup(self, ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name="postgresql-k8s")
await ops_test.model.deploy(
"postgresql-k8s",
application_name="postgresql-k8s",
channel="14/stable",
trust=True,
)

@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
Expand Down
1 change: 1 addition & 0 deletions orc8r-device-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ The current setup has only been tested with relation to the `postgresql-k8s` cha

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


7 changes: 6 additions & 1 deletion orc8r-device-operator/tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ class TestOrc8rDevice:
@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
async def setup(self, ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name="postgresql-k8s")
await ops_test.model.deploy(
"postgresql-k8s",
application_name="postgresql-k8s",
channel="14/stable",
trust=True,
)

@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
Expand Down
1 change: 1 addition & 0 deletions orc8r-directoryd-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ The current setup has only been tested with relation to the `postgresql-k8s` cha

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ class TestOrc8rDirectoryd:
@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
async def setup(self, ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name="postgresql-k8s")
await ops_test.model.deploy(
"postgresql-k8s",
application_name="postgresql-k8s",
channel="14/stable",
trust=True,
)

@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
Expand Down
1 change: 1 addition & 0 deletions orc8r-dispatcher-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ juju deploy magma-orc8r-dispatcher orc8r-dispatcher

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


1 change: 1 addition & 0 deletions orc8r-eventd-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ charmcraft pack

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


1 change: 1 addition & 0 deletions orc8r-ha-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ juju deploy magma-orc8r-ha orc8r-ha
## OCI Images

Default: ghcr.io/canonical/magma-lte-controller:1.8.0

1 change: 1 addition & 0 deletions orc8r-lte-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ The current setup has only been tested with relation to the `postgresql-k8s` cha
## OCI Images

Default: ghcr.io/canonical/magma-lte-controller:1.8.0

7 changes: 6 additions & 1 deletion orc8r-lte-operator/tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ class TestOrc8rLte:
@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
async def setup(self, ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name="postgresql-k8s")
await ops_test.model.deploy(
"postgresql-k8s",
application_name="postgresql-k8s",
channel="14/stable",
trust=True,
)

@pytest.fixture(scope="module")
@pytest.mark.abort_on_fail
Expand Down
1 change: 1 addition & 0 deletions orc8r-metricsd-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ juju deploy magma-orc8r-metricsd orc8r-metricsd

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ def _find_charm(charm_dir: str, charm_file_name: str) -> Union[str, None]:

@staticmethod
async def _deploy_postgresql(ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name="postgresql-k8s")
await ops_test.model.deploy(
"postgresql-k8s",
application_name="postgresql-k8s",
channel="14/stable",
trust=True,
)

@staticmethod
async def _deploy_alertmanager(ops_test):
Expand Down
1 change: 1 addition & 0 deletions orc8r-nginx-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ juju relate orc8r-nginx:cert-controller orc8r-certifier:cert-controller
## OCI Images

Default: ghcr.io/canonical/nginx:1.23.3

7 changes: 6 additions & 1 deletion orc8r-nginx-operator/tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ def _find_charm(charm_dir: str, charm_file_name: str) -> Optional[str]:

@staticmethod
async def _deploy_postgresql(ops_test):
await ops_test.model.deploy("postgresql-k8s", application_name="postgresql-k8s")
await ops_test.model.deploy(
"postgresql-k8s",
application_name="postgresql-k8s",
channel="14/stable",
trust=True,
)

async def _deploy_orc8r_certifier(self, ops_test):
certifier_charm = self._find_charm(
Expand Down
1 change: 1 addition & 0 deletions orc8r-obsidian-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ juju deploy magma-orc8r-obsidian orc8r-obsidian

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


1 change: 1 addition & 0 deletions orc8r-orchestrator-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ The default log level is 0 and the full log level is 10.

Default: ghcr.io/canonical/magma-orc8r-controller:1.8.0


Loading

0 comments on commit 9d7e1db

Please sign in to comment.