Skip to content

Commit

Permalink
refactor: Change the way how we get TEST_JUJU_CHANNEL
Browse files Browse the repository at this point in the history
- Now it's pass from the workflow command, not from the Makefile
- Default set to 3.3/stable
  • Loading branch information
jneo8 committed Apr 11, 2024
1 parent 0ce608d commit f0df26b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ jobs:
- juju-channel: '2.9/stable'
command: 'make functional'
- juju-channel: '3.1/stable'
command: 'make functional31'
command: 'TEST_JUJU_CHANNEL=3.1/stable make functional3'
- juju-channel: '3.2/stable'
command: 'make functional32'
command: 'TEST_JUJU_CHANNEL=3.2/stable make functional3'
- juju-channel: '3.3/stable'
command: 'make functional33'
command: 'TEST_JUJU_CHANNEL=3.3/stable make functional3'

with:
command: ${{ matrix.command }}
juju-channel: ${{ matrix.juju-channel }}
Expand Down
21 changes: 6 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ PROJECTPATH=$(dir $(realpath $(MAKEFILE_LIST)))
RELEASE_CHANNEL:=edge
METADATA_FILE="metadata.yaml"
CHARM_NAME=$(shell cat ${PROJECTPATH}/${METADATA_FILE} | grep -E '^name:' | awk '{print $$2}')
TEST_JUJU_CHANNEL ?= "3.3/stable"

help:
@echo "This project supports the following targets"
Expand All @@ -24,9 +25,7 @@ help:
@echo " make reformat - run lint tools to auto format code"
@echo " make unittests - run the tests defined in the unittest subdirectory"
@echo " make functional - run the tests defined in the functional subdirectory"
@echo " make functional31 - run the tests defined in the functional subdirectory with juju 3.1 requirements"
@echo " make functional32 - run the tests defined in the functional subdirectory with juju 3.2 requirements"
@echo " make functional33 - run the tests defined in the functional subdirectory with juju 3.3 requirements"
@echo " make functional3 - run the tests defined in the functional subdirectory with juju 3.x requirements"
@echo " make test - run lint, unittests and functional targets"
@echo ""

Expand Down Expand Up @@ -79,20 +78,12 @@ functional: build
@echo "Executing functional tests using built charm at ${PROJECTPATH}"
@TEST_JUJU_CHANNEL=2.9/stable CHARM_LOCATION=${PROJECTPATH} tox -e func -- ${FUNC_ARGS}

functional31: build
@echo "Executing functional tests using built charm at ${PROJECTPATH} with juju 3.1 requirements"
@TEST_JUJU_CHANNEL=3.1/stable CHARM_LOCATION=${PROJECTPATH} tox -e func3 -- ${FUNC_ARGS}

functional32: build
@echo "Executing functional tests using built charm at ${PROJECTPATH} with juju 3.2 requirements"
@TEST_JUJU_CHANNEL=3.2/stable CHARM_LOCATION=${PROJECTPATH} tox -e func3 -- ${FUNC_ARGS}

functional33: build
@echo "Executing functional tests using built charm at ${PROJECTPATH} with juju 3.3 requirements"
@TEST_JUJU_CHANNEL=3.3/stable CHARM_LOCATION=${PROJECTPATH} tox -e func3 -- ${FUNC_ARGS}
functional3: build
@echo "Executing functional tests using built charm at ${PROJECTPATH} with juju 3.x requirements"
@TEST_JUJU_CHANNEL=${TEST_JUJU_CHANNEL} TEST_JUJU3=1 CHARM_LOCATION=${PROJECTPATH} tox -e func3 -- ${FUNC_ARGS}

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 functional31 functional32 functional33
.PHONY: help dev-environment pre-commit submodules submodules-update clean build lint reformat unittests functional functional3
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ deps =
changedir = {toxinidir}/tests/functional
commands = functest-run-suite {posargs:--keep-faulty-model}
deps =
git+https://github.com/openstack-charmers/zaza.git@libjuju-3.1#egg=zaza
git+https://github.com/openstack-charmers/zaza.git#egg=zaza
-r {toxinidir}/tests/functional/requirements.txt

0 comments on commit f0df26b

Please sign in to comment.