Skip to content

Commit

Permalink
Add Juju 3.4 support (#12)
Browse files Browse the repository at this point in the history
* Add Juju 3.4 support

Add symble bundle for func test to verify, that charm can be
deployed. Sanitazied the Makefile and add Juju 3.4 to CI.

* Use concurrency for GH workflow
  • Loading branch information
rgildein authored Apr 23, 2024
1 parent f579b06 commit 7547f30
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 13 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
- "**.md"
- "**.rst"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
lint-unit:
uses: canonical/bootstack-actions/.github/workflows/lint-unit.yaml@v2
Expand All @@ -19,15 +23,17 @@ jobs:
python-version: ["3.8", "3.10"]
with:
python-version: ${{ matrix.python-version }}
tox-version: "<4"

func:
uses: canonical/bootstack-actions/.github/workflows/func.yaml@v2
needs: lint-unit
strategy:
fail-fast: false
matrix:
command: ["TEST_JUJU3=1 make functional"] # TEST_JUJU3 needed due https://github.com/openstack-charmers/zaza/blob/b22c2eed4c322f1dfc14ffb2d31e0dd18c911a40/setup.py#L47 to support Juju3+
juju-channel: ["3.4/stable"]
with:
command: tox -e func
juju-channel: "3.1/stable"
nested-containers: true
command: ${{ matrix.command }}
juju-channel: ${{ matrix.juju-channel }}
nested-containers: false
python-version: "3.10"
timeout-minutes: 120
tox-version: "<4"
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ submodules-update:
@git submodule update --init --recursive --remote --merge

clean:
@echo "Cleaning files"
@git clean -ffXd -e '!.idea' -e '!.vscode'
@echo "Cleaning existing build"
@rm -rf ${PROJECTPATH}/${CHARM_NAME}*.charm
@echo "Cleaning charmcraft"
Expand Down Expand Up @@ -80,4 +78,4 @@ test: lint unittests functional
@echo "Tests completed for charm ${CHARM_NAME}."

# The targets below don't depend on a file
.PHONY: help dev-environment pre-commit submodules submodules-update clean build lint reformat unittests functional
.PHONY: help dev-environment pre-commit submodules submodules-update clean build lint reformat unittests functional
1 change: 1 addition & 0 deletions tests/functional/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Zaza tests."""
5 changes: 5 additions & 0 deletions tests/functional/tests/bundles/base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
applications:
nginx:
charm: nginx
num_units: 1

1 change: 1 addition & 0 deletions tests/functional/tests/bundles/focal.yaml
1 change: 1 addition & 0 deletions tests/functional/tests/bundles/jammy.yaml
1 change: 1 addition & 0 deletions tests/functional/tests/bundles/overlays/focal.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
series: focal
1 change: 1 addition & 0 deletions tests/functional/tests/bundles/overlays/jammy.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
series: jammy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
applications:
{{ charm_name }}:
charm: "{{ CHARM_LOCATION }}/{{ charm_name }}.charm"
12 changes: 12 additions & 0 deletions tests/functional/tests/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
charm_name: nginx
gate_bundles:
- focal
- jammy
smoke_bundles:
- focal
dev_bundles:
- focal
target_deploy_status:
nginx:
workload-status: unknown
workload-status-message-prefix: ""
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ deps =

[testenv:func]
changedir = {toxinidir}/tests/functional
commands = echo "Functional tests are under development"
whitelist_externals = echo
commands = functest-run-suite {posargs:--keep-faulty-model}
deps =
git+https://github.com/openstack-charmers/zaza.git#egg=zaza
-r {toxinidir}/tests/functional/requirements.txt
git+https://github.com/openstack-charmers/zaza.git@master#egg=zaza
-r {toxinidir}/tests/functional/requirements.txt

0 comments on commit 7547f30

Please sign in to comment.