Skip to content

Commit

Permalink
Set controller channel to 3.4 in CI (#40)
Browse files Browse the repository at this point in the history
* Set controller channel to 3.4 in CI

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

* tmp fix until [1] is not resulved

---
[1]: canonical/charmcraft#1640

* drop bootstack-actions for func tests

* define concurrency in CI

* dropping tmp usage of 5.20/stable for LXD

* Switch back to bootstack-actions
  • Loading branch information
rgildein committed Apr 16, 2024
1 parent 14aed5f commit a02ddca
Show file tree
Hide file tree
Showing 4 changed files with 374 additions and 377 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/check.yaml
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,7 +23,6 @@ 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
Expand All @@ -32,9 +35,8 @@ 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"
timeout-minutes: 120
tox-version: "<4"
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 a02ddca

Please sign in to comment.