Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to support juju 3.1 #179

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ jobs:
strategy:
fail-fast: false
with:
command: "make functional"
juju-channel: "2.9/stable"
command: "TEST_JUJU3=1 make functional"
juju-channel: "3.1/stable"
provider: "lxd"
python-version: "3.10"
timeout-minutes: 120
tox-version: "<4"
runs-on: "['self-hosted', 'runner-nrpe']"
action-operator: false
external-controller: true
juju-controller: soleng-ci-ctrl-29
zaza-yaml: "LS0tCm1vZGVsX3NldHRpbmdzOgogIGltYWdlLXN0cmVhbTogcmVsZWFzZWQKcmVnaW9uOiBwcm9kc3RhY2s2CmNsb3VkOiBidWlsZGVyLWNsb3VkLTI5CmNyZWRlbnRpYWw6IGJ1aWxkZXItY2xvdWQtMjktY3JlZAo="
juju-controller: soleng-ci-ctrl
zaza-yaml: "LS0tCm1vZGVsX3NldHRpbmdzOgogIGltYWdlLXN0cmVhbTogcmVsZWFzZWQKcmVnaW9uOiBwcm9kc3RhY2s2CmNsb3VkOiBidWlsZGVyLWNsb3VkCmNyZWRlbnRpYWw6IGJ1aWxkZXItY2xvdWQtY3JlZAo="
secrets:
juju-controllers-yaml: ${{ secrets.JUJU_CONTROLLERS_YAML }}
juju-accounts-yaml: ${{ secrets.JUJU_ACCOUNTS_YAML }}
Expand Down
19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
PYTHON := /usr/bin/python3

PROJECTPATH=$(dir $(realpath $(MAKEFILE_LIST)))
ifndef CHARM_BUILD_DIR
CHARM_BUILD_DIR=${PROJECTPATH}
endif
METADATA_FILE="metadata.yaml"
CHARM_NAME=$(shell cat ${PROJECTPATH}/${METADATA_FILE} | grep -E '^name:' | awk '{print $$2}')

Expand All @@ -25,10 +22,10 @@ help:
@echo ""

clean:
@echo "Cleaning files"
@git clean -ffXd -e '!.idea'
@echo "Cleaning existing build"
@rm -rf ${CHARM_BUILD_DIR}/${CHARM_NAME}
@rm -rf ${PROJECTPATH}/${CHARM_NAME}*.charm
@echo "Cleaning charmcraft"
@charmcraft clean

submodules:
@echo "Cloning submodules"
Expand All @@ -39,10 +36,11 @@ submodules-update:
@git submodule update --init --recursive --remote --merge

build:
@echo "Building charm to base directory ${CHARM_BUILD_DIR}/${CHARM_NAME}.charm"
@echo "Building charm to base directory ${PROJECTPATH}/${CHARM_NAME}.charm"
@-git rev-parse --abbrev-ref HEAD > ./repo-info
@-git describe --always > ./version
@tox -e build
@charmcraft -v pack ${BUILD_ARGS}
@bash -c ./rename.sh

release: clean build
@charmcraft upload nrpe.charm --release edge
Expand All @@ -64,8 +62,9 @@ unittests:
@tox -e unit

functional: build
@echo "Executing functional tests in ${CHARM_BUILD_DIR}"
@CHARM_BUILD_DIR=${CHARM_BUILD_DIR} tox -e func
@echo "Executing functional tests with ${PROJECTPATH}/${CHARM_NAME}.charm"
@CHARM_LOCATION=${PROJECTPATH} tox -e func -- ${FUNC_ARGS}


test: lint proof unittests functional
@echo "Charm ${CHARM_NAME} has been tested"
Expand Down
7 changes: 0 additions & 7 deletions build-requirements.txt

This file was deleted.

4 changes: 0 additions & 4 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,3 @@ requires:
local-monitors:
interface: local-monitors
scope: container
series:
- jammy
- focal
- bionic
2 changes: 1 addition & 1 deletion tests/functional/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
git+https://github.com/openstack-charmers/zaza.git@master#egg=zaza
git+https://github.com/rgildein/zaza.git@chore/no-ref/fix-action-object#egg=zaza
python-openstackclient
2 changes: 2 additions & 0 deletions tests/functional/tests/bundles/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ applications:
charm: ch:nagios
num_units: 1
series: bionic
nrpe:
charm: nrpe
relations:
- - rabbitmq-server:nrpe-external-master
- nrpe:nrpe-external-master
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
applications:
nrpe:
charm: "{{ CHARM_BUILD_DIR }}/{{ charm_name }}.charm"
{{ charm_name }}:
charm: "{{ CHARM_LOCATION }}/{{ charm_name }}.charm"
14 changes: 3 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ setenv =
passenv =
HOME
PATH
CHARM_BUILD_DIR
CHARM_LOCATION
PYTEST_KEEP_MODEL
PYTEST_CLOUD_NAME
PYTEST_CLOUD_REGION
Expand Down Expand Up @@ -79,13 +79,5 @@ deps = -r{toxinidir}/tests/unit/requirements.txt

[testenv:func]
changedir = {toxinidir}/tests/functional
commands = functest-run-suite --keep-faulty-model {posargs}
deps = -r{toxinidir}/tests/functional/requirements.txt

[testenv:build]
basepython = python3
deps = -r{toxinidir}/build-requirements.txt
commands =
charmcraft clean
charmcraft -v pack
{toxinidir}/rename.sh
commands = functest-run-suite {posargs:--keep-faulty-model}
deps = -r {toxinidir}/tests/functional/requirements.txt
Loading