diff --git a/.github/workflows/smoke.yaml b/.github/workflows/smoke.yaml index 93513d606..9e04042a3 100644 --- a/.github/workflows/smoke.yaml +++ b/.github/workflows/smoke.yaml @@ -12,8 +12,7 @@ jobs: strategy: matrix: # pylibjuju does not currently support Juju 4.x - # The smoke tests do not yet work on Juju 2.9. - juju-channel: ['3/stable'] + juju-channel: ['2.9/stable', '3/stable'] charmcraft-channel: ['2.x/stable', '3.x/stable'] preset: ['machine', 'microk8s'] diff --git a/tox.ini b/tox.ini index 8a167f1bc..b550a6d66 100644 --- a/tox.ini +++ b/tox.ini @@ -174,7 +174,6 @@ description = Run a smoke test against a Juju controller. allowlist_externals = juju charmcraft bash -passenv = JUJU_VERSION deps = build coverage[toml]~=7.0 @@ -186,8 +185,8 @@ commands = python -m build --sdist --outdir={toxinidir}/test/charms/test_smoke/ # Inject the tarball into the smoke test charm's requirements. bash -c 'echo "./$(ls -1 ./test/charms/test_smoke/ | grep tar.gz)" > ./test/charms/test_smoke/requirements.txt' - # If a specific Juju version is set, then make sure we are using that version of pylibjuju. - bash -c 'if [ -n "$JUJU_VERSION" ]; then pip install "juju ~= $JUJU_VERSION"; fi' + # Make sure we are using the appropriate version of pylibjuju. + bash -c 'JUJU_VERSION=$(juju --version | awk -F. "{print \$1 \".\" \$2}"); if [ -n "$JUJU_VERSION" ]; then pip install "juju ~= $JUJU_VERSION"; fi' # Run our smoke tests (this will build the charm, then run the tests). pytest -v --tb native --log-cli-level=INFO -s {posargs} {toxinidir}/test/smoke/