From 659ead0c2e2c792f4c747f21396937bca0a11bdd Mon Sep 17 00:00:00 2001 From: znerol Date: Tue, 7 May 2024 15:11:00 +0200 Subject: [PATCH 1/2] Reliably enable code coverage reporting --- .coveragerc | 11 ++++-- .github/workflows/python-package.yml | 50 ++++++++++++++++++++++++++++ .travis.yml | 15 --------- test-requirements.txt | 1 + 4 files changed, 60 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/python-package.yml delete mode 100644 .travis.yml diff --git a/.coveragerc b/.coveragerc index d21dd00..d0637c2 100644 --- a/.coveragerc +++ b/.coveragerc @@ -3,6 +3,13 @@ [run] branch = True -source = spreadflow_xslt +source_pkgs = + spreadflow_xslt omit = - spreadflow_xslt/test/* + /tmp/** + spreadflow_xslt/test/** + +[report] +omit = + /tmp/** + spreadflow_xslt/test/** diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..cb8e82c --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,50 @@ +--- +name: Python package + +on: + push: + branches: [ "stable" ] + pull_request: + branches: [ "stable" ] + +jobs: + test: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.7", "3.9", "3.11"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip wheel + python -m pip install --requirement test-requirements.txt + python -m pip install --editable .[tests] + - name: Test with trial + run: | + coverage run `which trial` spreadflow_xslt + coverage xml + - name: Coveralls Parallel + uses: coverallsapp/github-action@v2 + with: + flag-name: run-${{ join(matrix.*, '-') }} + format: cobertura + parallel: true + + finish: + needs: test + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v2 + with: + parallel-finished: true + carryforward: "run-3.7,run-3.9,run-3.11" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a5def77..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: python -python: - - 2.7 - - 3.4 -cache: - directories: - - $HOME/.cache/pip -install: - - pip install -U pip wheel - - pip install -r test-requirements.txt - - pip install -e .[tests] -script: - - coverage run `which trial` spreadflow_xslt -after_success: - - coveralls diff --git a/test-requirements.txt b/test-requirements.txt index 426b28b..9a0c096 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,2 +1,3 @@ -e git+https://github.com/znerol/spreadflow-core#egg=SpreadFlowCore -e git+https://github.com/znerol/spreadflow-delta#egg=SpreadFlowDelta +coveralls From e86cdb647befdfae4a4cea713ccb33b3d947ccb6 Mon Sep 17 00:00:00 2001 From: znerol Date: Tue, 7 May 2024 15:16:41 +0200 Subject: [PATCH 2/2] Fix test requirements --- setup.py | 3 ++- test-requirements.txt | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 74f801e..a95d86f 100644 --- a/setup.py +++ b/setup.py @@ -3,8 +3,9 @@ tests_require = [ 'SpreadFlowDelta[tests]', 'coveralls', + 'fixtures', 'mock', - 'testtools' + 'testtools', ] setup( diff --git a/test-requirements.txt b/test-requirements.txt index 9a0c096..426b28b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,2 @@ -e git+https://github.com/znerol/spreadflow-core#egg=SpreadFlowCore -e git+https://github.com/znerol/spreadflow-delta#egg=SpreadFlowDelta -coveralls