Skip to content

Commit

Permalink
Chores(): address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alithethird committed Feb 28, 2025
1 parent 4f46589 commit acc491c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
10 changes: 7 additions & 3 deletions tests/integration/integrations/test_smtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pytest
import requests
from juju.application import Application
from juju.errors import JujuError
from juju.model import Model
from pytest_operator.plugin import OpsTest

Expand Down Expand Up @@ -51,9 +52,12 @@ async def test_smtp_integrations(
channel="latest/edge",
config=smtp_config,
)
except Exception as e:
logger.info(f"smtp-integrator is already deployed {e}")
smtp_integrator_app = model.applications["smtp-integrator"]
except JujuError as e:
if "application already exists" in str(e):
logger.info(f"smtp-integrator is already deployed {e}")
smtp_integrator_app = model.applications["smtp-integrator"]
else:
raise e

smtp_app = request.getfixturevalue(smtp_app_fixture)
await model.wait_for_idle()
Expand Down
11 changes: 7 additions & 4 deletions tests/integration/integrations/test_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import aiohttp
import pytest
from juju.errors import JujuError
from juju.model import Model
from pytest_operator.plugin import OpsTest

Expand Down Expand Up @@ -41,10 +42,12 @@ async def test_workload_tracing(
"""
try:
tempo_app = request.getfixturevalue("tempo_app")
except Exception as e:
logger.info(f"Tempo is already deployed {e}")
tempo_app = model.applications["tempo"]

except JujuError as e:
if "application already exists" in str(e):
logger.info(f"Tempo is already deployed {e}")
tempo_app = model.applications["tempo"]
else:
raise e
tracing_app = request.getfixturevalue(tracing_app_fixture)

await ops_test.model.integrate(f"{tracing_app.name}:tracing", f"{tempo_app.name}:tracing")
Expand Down

0 comments on commit acc491c

Please sign in to comment.