From afdab66218c1fd34e645622cb4504023db4a65c1 Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Tue, 16 Feb 2021 17:03:41 +0000 Subject: [PATCH] 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 --- .github/workflows/build.yml | 17 ++--------------- codecov.yml | 4 ++-- requirements-tests.txt | 5 ++++- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f425537c..3710b8e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/codecov.yml b/codecov.yml index a0f8353e..4fe85e33 100644 --- a/codecov.yml +++ b/codecov.yml @@ -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: diff --git a/requirements-tests.txt b/requirements-tests.txt index 847ce539..02bdfdd2 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -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