Skip to content

Commit

Permalink
test: Combine coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed May 31, 2022
1 parent 3596977 commit 999e10b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -56,3 +56,49 @@ jobs:
- name: Run tox
run: |
poetry run tox -e ${{ matrix.tox-env }} -- ${{ matrix.external && ' -m "external"' || '' }}
- name: Upload coverage data
if: always() && (matrix.tox-env == 'py')
uses: actions/upload-artifact@v3.1.0
with:
name: coverage-data
path: ".coverage.*"

coverage:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Check out the repository
uses: actions/checkout@v3.0.2

- name: Set up Python
uses: actions/setup-python@v3.1.2
with:
python-version: "3.10"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry
poetry --version
- name: Download coverage data
uses: actions/download-artifact@v3.0.0
with:
name: coverage-data

- name: Combine coverage data and display human readable report
run: |
tox -e combine_coverage
- name: Create coverage report
run: |
tox -e coverage_xml
# TODO: requires setup in codecov.io. Doesn't need a token :)
# - name: Upload coverage report
# uses: codecov/codecov-action@v3.1.0
11 changes: 9 additions & 2 deletions tox.ini
Expand Up @@ -15,8 +15,6 @@ commands_pre =
poetry install --no-root
commands =
poetry run coverage run -m pytest -x -v {posargs}
poetry run coverage report --show-missing
poetry run codecov -e TOXENV

[testenv:test]
# Use default py interpreter
Expand All @@ -40,6 +38,15 @@ commands =
poetry run flake8 singer_sdk tests samples
poetry run mypy singer_sdk --exclude='tests'

[testenv:combine_coverage]
commands =
poetry run coverage combine
poetry run coverage report --show-missing

[testenv:combine_xml]
commands =
poetry run coverage xml

[flake8]
ignore = W503, C901, ANN101
max-line-length = 88
Expand Down

0 comments on commit 999e10b

Please sign in to comment.