From c208abb39023d733cf2b067ecf8753bf67c666de Mon Sep 17 00:00:00 2001 From: Stavros Ntentos <133706+stdedos@users.noreply.github.com> Date: Wed, 18 Oct 2023 23:23:34 +0300 Subject: [PATCH] Fix testing + coverage * Drop `py312` to combat https://github.com/pylint-dev/pylint-pytest/issues/16 * Install `--editable`, so that Python uses the correct source files for coverage * Ignore `tests/input/**/*.py` from coverage - they are not ran properly * Again improve on artifact naming Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com> --- .codecov.yml | 2 ++ .github/workflows/run-tests.yaml | 5 ++++- tox.ini | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000..f6947b3 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,2 @@ +ignore: + - tests/input/**/*.py diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index c0948ce..d44d33e 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -41,6 +41,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Slugify GITHUB_REPOSITORY + run: echo "GITHUB_REPOSITORY_SLUG=${GITHUB_REPOSITORY////_}" >> $GITHUB_ENV + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -71,5 +74,5 @@ jobs: uses: actions/upload-artifact@v3 if: ${{ !cancelled() }} with: - name: test-artifacts_${{ matrix.os }}_${{ matrix.python-version }} + name: ${{ env.GITHUB_REPOSITORY_SLUG }}_test-artifacts_${{ github.event_name }}_${{ github.event.pull_request.number || github.sha }}_${{ matrix.os }}_py${{ matrix.python-version }} path: test_artifacts/ diff --git a/tox.ini b/tox.ini index 59810ac..09dd02e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,py38,py39,py310,py311,py312 +envlist = py36,py37,py38,py39,py310,py311 skipsdist = True passenv = FORCE_COLOR @@ -9,5 +9,5 @@ deps = pytest pytest-cov commands = - pip install --upgrade . + pip install --upgrade --editable . pytest --cov --cov-append {env:PYTEST_CI_ARGS:} {tty:--color=yes} {posargs:tests}