Skip to content

Commit

Permalink
Pick the right charm for the series
Browse files Browse the repository at this point in the history
  • Loading branch information
sed-i committed Oct 6, 2023
1 parent 6666926 commit fe9549b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion tests/integration/test_juju_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,16 @@ async def test_build_and_deploy(ops_test: OpsTest, grafana_agent_charm):
await ops_test.model.deploy(
principal.charm, application_name=principal.name, num_units=2, series="jammy"
)

# Workaround: `charmcraft pack` produces two files, but `ops_test.build_charm` returns the
# first one. Since primary is jammy, we know we need to deploy the jammy grafana agent charm,
# otherwise we'd get an error such as:
# ImportError: libssl.so.1.1: cannot open shared object file: No such file or directory
jammy_charm_path = grafana_agent_charm.parent / "grafana-agent_ubuntu-22.04-amd64.charm"

# Subordinate
await ops_test.model.deploy(
grafana_agent_charm, application_name=agent.name, num_units=0, series="jammy"
jammy_charm_path, application_name=agent.name, num_units=0, series="jammy"
)

# Placeholder for o11y relations (otherwise grafana agent charm is in blocked status)
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ deps =
juju ~= 3.1.0
pytest
prometheus-api-client
pytest-operator
#pytest-operator
# https://github.com/charmed-kubernetes/pytest-operator/pull/115
pytest-operator @ git+https://github.com/sed-i/pytest-operator@patch-1
commands =
pytest -v --tb native --log-cli-level=INFO -s {posargs} {[vars]tst_path}/integration

Expand Down

0 comments on commit fe9549b

Please sign in to comment.