Enable Py2 test coverage (#3698)

* Enable Py2 test coverage

* Coverage - exclude XRay as it's throwing errors

* Update requirements-tests.txt

* Revert "Coverage - exclude XRay as it's throwing errors"

This reverts commit bb58e0ef847301af034bee5992966a0474c19f9a.

* Enable coverage for all workflows
This commit is contained in:
Bert Blommers 2021-02-16 17:03:41 +00:00 committed by GitHub
parent cb6606f3f3
commit afdab66218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 18 deletions

View File

@ -105,16 +105,10 @@ jobs:
pip install -r requirements-dev.txt
pip install pytest-cov
- name: Test with pytest
if: ${{ matrix.python-version == 2.7 }}
run: |
make test-only
# Pytest-cov explicitly fails in Py2 for XRay tests
- name: Test with pytest/coverage
if: ${{ matrix.python-version != 2.7 }}
run: |
make test-coverage
- name: "Upload coverage to Codecov"
if: ${{ matrix.python-version != 2.7 && github.repository == 'spulec/moto'}}
if: ${{ github.repository == 'spulec/moto'}}
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
@ -158,20 +152,13 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Test ServerMode
if: ${{ matrix.python-version == 2.7 }}
env:
TEST_SERVER_MODE: ${{ true }}
run: |
make test-only
- name: Test ServerMode/Coverage
if: ${{ matrix.python-version != 2.7 }}
env:
TEST_SERVER_MODE: ${{ true }}
run: |
make test-coverage
- name: "Upload coverage to Codecov"
if: ${{ matrix.python-version != 2.7 && github.repository == 'spulec/moto'}}
if: ${{ github.repository == 'spulec/moto'}}
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true

View File

@ -1,7 +1,7 @@
codecov:
notify:
# Leave a GitHub comment after all Py3 builds have passed
after_n_builds: 6
# Leave a GitHub comment after all builds have passed
after_n_builds: 8
coverage:
status:
project:

View File

@ -1,4 +1,7 @@
pytest
pytest-cov
pytest-cov; python_version >= '3.6'
# https://github.com/aws/aws-xray-sdk-python/issues/196
# Downgrade pytest-cov to the last version that uses coverage < 5
pytest-cov<=2.10.1; python_version < '3.6'
sure==1.4.11
freezegun