Skip to content

Commit

Permalink
Set controller channel to 3.4 in CI
Browse files Browse the repository at this point in the history
The functional tests requiered some changes, they were done strangely
and I'm not sure why they worked before. I think it's maybe due [1],
but I did not have time to investigate more.

---
[1]: pytest-dev/pytest-asyncio#706
  • Loading branch information
rgildein committed Apr 11, 2024
1 parent 14aed5f commit d471f97
Show file tree
Hide file tree
Showing 4 changed files with 370 additions and 375 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yaml
Expand Up @@ -32,7 +32,7 @@ jobs:
- command: "FUNC_ARGS='--series jammy' make functional"
with:
command: ${{ matrix.command }}
juju-channel: "3.1/stable"
juju-channel: "3.4/stable"
nested-containers: false
provider: "lxd"
python-version: "3.10"
Expand Down
10 changes: 2 additions & 8 deletions Makefile
@@ -1,7 +1,3 @@
# This is a template `Makefile` file for ops charms
# This file is managed by bootstack-charms-spec and should not be modified
# within individual charm repos. https://launchpad.net/bootstack-charms-spec

PYTHON := /usr/bin/python3

PROJECTPATH=$(dir $(realpath $(MAKEFILE_LIST)))
Expand Down Expand Up @@ -47,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 @@ -77,8 +71,8 @@ unittests:
@tox -e unit -- ${UNIT_ARGS}

functional:
@echo "Executing functional tests using built charm at ${PROJECTPATH}"
@CHARM_LOCATION=${PROJECTPATH} tox -e func -- ${FUNC_ARGS}
@echo "Executing functional tests with args: ${FUNC_ARGS}"
@tox -e func -- ${FUNC_ARGS}

test: lint unittests functional
@echo "Tests completed for charm ${CHARM_NAME}."
Expand Down
11 changes: 8 additions & 3 deletions tests/functional/conftest.py
Expand Up @@ -36,17 +36,17 @@ def series(request):
return request.config.getoption("--series")


@pytest.fixture(scope="class")
@pytest.fixture
def apt_mirror_app(ops_test):
return ops_test.model.applications["apt-mirror"]


@pytest.fixture(scope="class")
@pytest.fixture
def apt_mirror_unit(apt_mirror_app):
return apt_mirror_app.units[0]


@pytest.fixture(scope="class")
@pytest.fixture
def configs(apt_mirror_app):
async def get_config_synced():
return await apt_mirror_app.get_config()
Expand All @@ -59,3 +59,8 @@ async def get_config_synced():
@pytest.fixture(scope="class")
def helper():
return Helper


@pytest.fixture
def base_path(configs):
return configs.get("base-path").get("value")

0 comments on commit d471f97

Please sign in to comment.