Skip to content

Commit 5b28fc5

Browse files
authored
Enable Allure for integration tests (#66)
* Enable Allure for integration tests * Remove %s from log message * Fix relation in helpers.py for matrix-auth Updated the relation in the integration helper to use the correct interface. * Format add_relation call for better readability * Fix typo in relation addition for matrix-auth
1 parent a03e156 commit 5b28fc5

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/integration_test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ jobs:
1111
juju-channel: 3.4/stable
1212
provider: lxd
1313
modules: '["test_charm.py", "test_ingress.py"]'
14+
allure-report:
15+
if: always() && !cancelled()
16+
needs:
17+
- integration-tests
18+
uses: canonical/operator-workflows/.github/workflows/allure_report.yaml@main

src/irc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def _generate_app_registration_local(self) -> None:
254254
def _generate_media_proxy_key(self) -> None:
255255
"""Generate the content of the media proxy key."""
256256
if IRC_BRIDGE_SIGNING_KEY_FILE_PATH.exists():
257-
logger.info("Media proxy key file %s already exists, skipping")
257+
logger.info("Media proxy key file already exists, skipping")
258258
return
259259
media_proxy_key_command = [
260260
"/bin/bash",

tests/integration/helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ async def generate_anycharm_relation(
184184
to=machine,
185185
)
186186
await ops_test.model.wait_for_idle(apps=[any_charm.name])
187-
await ops_test.model.add_relation(f"{any_charm.name}", f"{app.name}")
187+
await ops_test.model.add_relation(
188+
f"{any_charm.name}:provide-matrix-auth", f"{app.name}:matrix-auth"
189+
)
188190

189191

190192
async def get_unit_address(application: Application) -> str:

tox.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ commands =
102102
[testenv:integration]
103103
description = Run integration tests
104104
deps =
105+
-r{toxinidir}/requirements.txt
106+
allure-pytest>=2.8.18
107+
git+https://github.com/canonical/data-platform-workflows@v24.0.0\#subdirectory=python/pytest_plugins/allure_pytest_collection_report
105108
juju
106109
pytest
107110
pytest-asyncio
108111
pytest-operator
109-
-r{toxinidir}/requirements.txt
110112
commands =
111113
pytest -v --tb native --ignore={[vars]tst_path}unit --log-cli-level=INFO -s {posargs}
112114

0 commit comments

Comments
 (0)