Skip to content

Commit

Permalink
CI - Run codecov on all tests, not just Py3.7 (getmoto#3654)
Browse files Browse the repository at this point in the history
* CI - Run codecov on all tests, not just Py3.7

* Update build.yml

* Update build.yml
  • Loading branch information
bblommers authored Feb 2, 2021
1 parent 737636f commit 4ce936a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,20 @@ jobs:
pip install -r requirements-dev.txt
pip install pytest-cov
- name: Test with pytest
if: ${{ matrix.python-version != 3.7 }}
if: ${{ matrix.python-version == 2.7 }}
run: |
make test-only
# Only need to configure coverage once
# Pytest-cov explicitly fails in Py2 for XRay tests
- name: Test with pytest/coverage
if: ${{ matrix.python-version == 3.7 }}
if: ${{ matrix.python-version != 2.7 }}
run: |
make test-coverage
- name: "Upload coverage to Codecov"
if: ${{ matrix.python-version == 3.7 && github.repository == 'spulec/moto'}}
if: ${{ matrix.python-version != 2.7 && github.repository == 'spulec/moto'}}
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
flags: unittests

testserver:
name: Unit tests in Server Mode
Expand Down Expand Up @@ -157,10 +157,23 @@ jobs:
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'}}
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
flags: servertests

deploy:
name: Deploy
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test-coverage:
test: lint test-only

test_server:
@TEST_SERVER_MODE=true pytest -sv --cov=moto --cov-report html ./tests/
@TEST_SERVER_MODE=true pytest -sv --cov=moto --cov-report xml ./tests/

aws_managed_policies:
scripts/update_managed_policies.py
Expand Down

0 comments on commit 4ce936a

Please sign in to comment.