summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Kario <hkario@redhat.com>2021-01-22 22:05:15 +0100
committerHubert Kario <hkario@redhat.com>2021-01-25 13:36:32 +0100
commit212da4281ed8ba415731f5ac9d6267cfd4ae0d37 (patch)
tree7655efa4f381d6387ca257a0f9ae73fd321d3fca
parentb082184d69085dfb5b5caae3d1d290e170abdf51 (diff)
downloadecdsa-more-tests.tar.gz
add testing condition coveragemore-tests
-rw-r--r--.github/workflows/ci.yml29
1 files changed, 26 insertions, 3 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b707c3d..65a209b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -166,16 +166,16 @@ jobs:
pip list
pip install setuptools==28.8.0 wheel==0.30.0a0
- name: Install instrumental
- if: ${{ contains(matrix.tox-env, 'instrumental') }}
+ if: ${{ contains(matrix.opt-deps, 'instrumental') }}
run: pip install instrumental
- name: Install gmpy
if: ${{ contains(matrix.tox-env, 'gmpyp') }}
run: pip install gmpy
- name: Install gmpy2 dependencies
- if: ${{ contains(matrix.tox-env, 'gmpy2') }}
+ if: ${{ contains(matrix.tox-env, 'gmpy2') || contains(matrix.tox-env, 'instrumental') }}
run: sudo apt-get install -y libmpfr-dev libmpc-dev
- name: Install gmpy2
- if: ${{ contains(matrix.tox-env, 'gmpy2') }}
+ if: ${{ contains(matrix.tox-env, 'gmpy2') || contains(matrix.tox-env, 'instrumental') }}
run: pip install gmpy2
- name: Install build dependencies
run: |
@@ -200,6 +200,29 @@ jobs:
- name: Run unit tests
if: ${{ matrix.tox-env }}
run: tox -e ${{ matrix.tox-env }}
+ - name: instrumental test coverage on PR
+ if: ${{ contains(matrix.opt-deps, 'instrumental') && github.event.pull_request }}
+ env:
+ BASE_REF: ${{ github.event.pull_request.base.ref }}
+ run: |
+ git fetch origin $BASE_REF
+ MERGE_BASE=$(git merge-base origin/$BASE_REF HEAD)
+ echo "MERGE_BASE:" $MERGE_BASE
+ git checkout $MERGE_BASE
+ instrumental -t ecdsa -i 'test.*|.*_version|.*_compat' `which pytest` src/ecdsa/test*.py
+ instrumental -f .instrumental.cov -s
+ instrumental -f .instrumental.cov -s | python diff-instrumental.py --save .diff-instrumental
+ git checkout $GITHUB_SHA
+ instrumental -t ecdsa -i 'test.*|.*_version|.*_compat' `which pytest` src/ecdsa/test*.py
+ instrumental -f .instrumental.cov -sr
+ instrumental -f .instrumental.cov -s | python diff-instrumental.py --read .diff-instrumental --fail-under 70 --max-difference -0.1
+ - name: instrumental test coverage on push
+ if: ${{ contains(matrix.opt-deps, 'instrumental') && !github.event.pull_request }}
+ run: |
+ instrumental -t ecdsa -i 'test.*|.*_version|.*_compat' `which pytest` src/ecdsa
+ instrumental -f .instrumental.cov -s
+ # just log the values when merging
+ instrumental -f .instrumental.cov -s | python diff-instrumental.py
- name: Publish coverage to Coveralls
if: ${{ !matrix.opt-deps && matrix.tox-env != 'codechecks' }}
env: