Skip to content

Commit

Permalink
Update codecov and add flag for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amontanez24 committed Jan 13, 2025
1 parent ecbda28 commit 3ebc288
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@ jobs:
python -m pip install invoke .[test]
- name: Run integration tests
run: invoke integration
- if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12
name: Upload integration codecov report
uses: codecov/codecov-action@v4
with:
flags: integration
file: ${{ github.workspace }}/integration_cov.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
9 changes: 7 additions & 2 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ jobs:
python -m pip install invoke .[test]
- name: Run unit tests
run: invoke unit
- if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.8
name: Upload codecov report
- if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12
name: Upload unit codecov report
uses: codecov/codecov-action@v4
with:
flags: unit
file: ${{ github.workspace }}/unit_cov.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ coverage.xml
*.cover
.hypothesis/
.pytest_cache/
*_cov.xml

# Translations
*.mo
Expand Down
8 changes: 8 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage:
precision: 2
range: "90...100"
status:
project:
default: false
patch:
default: false
4 changes: 2 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def check_dependencies(c):

@task
def unit(c):
c.run('python -m pytest ./tests/unit --cov=sdgym --cov-report=xml')
c.run('python -m pytest ./tests/unit --cov=sdgym --cov-report=xml:./unit_cov.xml')


@task
def integration(c):
c.run('python -m pytest ./tests/integration')
c.run('python -m pytest ./tests/integration --cov=sdgym --cov-report=xml:./integration_cov.xml')


@task
Expand Down

0 comments on commit 3ebc288

Please sign in to comment.