Skip to content

Commit

Permalink
Add support 18.04
Browse files Browse the repository at this point in the history
- Add 18.04 to charmcraft
- Change dependency libjuju to <3.0 to support bionic
- Change github ci to support juju 2.9
- fixed ruff issue

Signed-off-by: Seyeong Kim <[email protected]>
  • Loading branch information
xtrusia committed Jul 11, 2024
1 parent 2e86396 commit 380e394
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ jobs:
fail-fast: true
matrix:
bases:
- [email protected]
- [email protected]
- bionic
- focal
- jammy
name: Integration tests (LXD) | ${{ matrix.bases }}
runs-on: ubuntu-latest
needs:
Expand All @@ -83,6 +84,6 @@ jobs:
uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: 3/stable
juju-channel: 2.9/stable
- name: Run tests
run: tox run -e integration -- --charm-base=${{ matrix.bases }}
16 changes: 16 additions & 0 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,19 @@ bases:
- name: "ubuntu"
channel: "20.04"
architectures: [arm64]
- build-on:
- name: "ubuntu"
channel: "20.04"
architectures: [amd64]
run-on:
- name: "ubuntu"
channel: "18.04"
architectures: [amd64]
- build-on:
- name: "ubuntu"
channel: "20.04"
architectures: [arm64]
run-on:
- name: "ubuntu"
channel: "18.04"
architectures: [arm64]
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ops >= 1.4.0
ops >= 1.4.0, <= 1.5.5
websocket_client <= 1.6.4
2 changes: 2 additions & 0 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def pytest_addoption(parser) -> None:
@pytest.fixture(scope="module")
def charm_base(request) -> str:
"""Get the lldp charm base to use."""
#if request.config.option.charm_base == "[email protected]":
# return "bionic"
return request.config.option.charm_base


Expand Down
4 changes: 2 additions & 2 deletions tests/integration/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ async def test_build_and_deploy(
),
)

# Integrate lldpd with ubuntu
await ops_test.model.integrate("ubuntu:juju-info", "lldpd:juju-info")
# Relate lldpd with ubuntu
await ops_test.model.relate("ubuntu:juju-info", "lldpd:juju-info")
async with ops_test.fast_forward():
await ops_test.model.wait_for_idle(
apps=["lldpd", "ubuntu"], status="active", timeout=1800
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ deps =
codespell
commands =
codespell --skip .git --skip .tox --skip build --skip lib --skip venv --skip .mypy_cache {toxinidir}
ruff {[vars]all_path}
ruff check {[vars]all_path}
black --check --diff {[vars]all_path}

[testenv:static-{charm,lib}]
Expand Down Expand Up @@ -74,9 +74,10 @@ commands =
coverage report

[testenv:integration]
# To support bionic, juju should be below libjuju 3.0
description = Run integration tests
deps =
juju<=3.3.0,>=3.0
juju < 3.0.0
pytest
pytest-operator
pytest-order
Expand Down

0 comments on commit 380e394

Please sign in to comment.