Skip to content

Commit

Permalink
feedback from PR
Browse files Browse the repository at this point in the history
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
  • Loading branch information
mr-cal committed Jun 15, 2023
1 parent e236924 commit 405edfb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
39 changes: 27 additions & 12 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Configure environment
run: |
echo "::group::Begin snap install"
Expand All @@ -38,7 +39,7 @@ jobs:
snap watch --last=install
echo "::endgroup::"
- name: Run Linters
run: tox run -m lint
run: tox run --skip-pkg-install --no-list-dependencies -m lint
unit-tests:
strategy:
matrix:
Expand All @@ -57,16 +58,20 @@ jobs:
3.10
3.11
3.12-dev
cache: 'pip'
- name: Configure environment
run: |
echo "::group::pip install"
python -m pip install 'tox>=4' tox-gh
python -m pip install 'tox>=4.6' tox-gh
echo "::endgroup::"
mkdir -p results
- name: Setup Tox environments
run: tox run -m unit-tests --notest
- name: Test with tox
run: tox run-parallel --parallel all --parallel-no-spinner --skip-pkg-install --result-json results/tox-${{ matrix.platform }}.json -m unit-tests -- --no-header --quiet -rN
# use `tox` instead of `.tox/.tox/bin/tox` to support Windows
run: tox run --skip-pkg-install --no-list-dependencies --result-json results/tox-${{ matrix.platform }}.json -m unit-tests
env:
PYTEST_ADDOPTS: "--no-header -vv -rN"
- name: Upload code coverage
uses: codecov/codecov-action@v3
with:
Expand Down Expand Up @@ -98,10 +103,11 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python.system-version }}
cache: 'pip'
- name: Configure environment
run: |
echo "::group::pip install"
python -m pip install 'tox>=4'
python -m pip install 'tox>=4.6'
echo "::endgroup::"
echo "::group::Configure LXD"
sudo groupadd --force --system lxd
Expand All @@ -114,13 +120,17 @@ jobs:
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
echo "::endgroup::"
- name: Setup Tox environments
run: tox run -e integration-${{ matrix.python.tox-version }} --notest
- name: Run integration tests on Linux
env:
CRAFT_PROVIDERS_TESTS_ENABLE_SNAP_INSTALL: 1
CRAFT_PROVIDERS_TESTS_ENABLE_LXD_INSTALL: 1
CRAFT_PROVIDERS_TESTS_ENABLE_LXD_UNINSTALL: 1
PYTEST_ADDOPTS: "--no-header -vv -rN"
run: |
export CRAFT_PROVIDERS_TESTS_ENABLE_SNAP_INSTALL=1
export CRAFT_PROVIDERS_TESTS_ENABLE_LXD_INSTALL=1
export CRAFT_PROVIDERS_TESTS_ENABLE_LXD_UNINSTALL=1
sg lxd -c "lxc version"
sg lxd -c "tox run -e integration-${{ matrix.python.tox-version }}"
sg lxd -c ".tox/.tox/bin/tox run --skip-pkg-install --no-list-dependencies -e integration-${{ matrix.python.tox-version }}"
integration-tests-macos:
strategy:
matrix:
Expand All @@ -140,10 +150,11 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python.system-version }}
cache: 'pip'
- name: Configure environment
run: |
echo "::group::pip install"
python -m pip install 'tox>=4'
python -m pip install 'tox>=4.6'
echo "::endgroup::"
echo "::group::Install Multipass"
brew update
Expand All @@ -155,8 +166,12 @@ jobs:
sleep 20
multipass version
echo "::endgroup::"
- name: Setup Tox environments
run: tox run -e integration-${{ matrix.python.tox-version }} --notest
- name: Run integration tests on MacOS
env:
CRAFT_PROVIDERS_TESTS_ENABLE_MULTIPASS_INSTALL: 1
CRAFT_PROVIDERS_TESTS_ENABLE_MULTIPASS_UNINSTALL: 1
PYTEST_ADDOPTS: "--no-header -vv -rN"
run: |
export CRAFT_PROVIDERS_TESTS_ENABLE_MULTIPASS_INSTALL=1
export CRAFT_PROVIDERS_TESTS_ENABLE_MULTIPASS_UNINSTALL=1
tox run -e integration-${{ matrix.python.tox-version }}
.tox/.tox/bin/tox run --skip-pkg-install --no-list-dependencies -e integration-${{ matrix.python.tox-version }}
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tox]
env_list = # Environments to run when called with no parameters.
lint-{black,ruff,pyright,shellcheck,codespell,docs}
lint-{black,ruff,pyright,shellcheck,codespell}
test-{py38,py310,py311}
minversion = 4.5
minversion = 4.6
# Tox will use these requirements to bootstrap a venv if necessary.
# tox-igore-env-name-mismatch allows us to have one virtualenv for all linting.
# By setting requirements here, we make this INI file compatible with older
Expand Down

0 comments on commit 405edfb

Please sign in to comment.