forked from openwallet-foundation/acapy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from jamshale/code-coverage
Add unit tests coverage reporting on PR
- Loading branch information
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,13 +25,39 @@ jobs: | |
- name: Install the project dependencies | ||
run: | | ||
pip install poetry | ||
poetry install -E "askar bbs" | ||
poetry install --all-extras | ||
- name: Tests | ||
run: | | ||
poetry run pytest 2>&1 | tee pytest.log | ||
poetry run pytest --cov --cov-report lcov --cov-report=term-missing:skip-covered 2>&1 | tee pytest.log | ||
PYTEST_EXIT_CODE=${PIPESTATUS[0]} | ||
if grep -Eq "RuntimeWarning: coroutine .* was never awaited" pytest.log; then | ||
echo "Failure: Detected unawaited coroutine warning in pytest output." | ||
exit 1 | ||
fi | ||
exit $PYTEST_EXIT_CODE | ||
- name: Coveralls Parrallel | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
parallel: true | ||
flag-name: python-${{ inputs.python-version }} | ||
- name: Pytest coverage comment | ||
uses: MishaKav/[email protected] | ||
with: | ||
pytest-coverage-path: pytest.log | ||
title: Coverage Report - See coveralls report in PR Tests action for full ui and details | ||
badge-title: Unit Test Coverage | ||
report-only-changed-files: true | ||
code-coverage: | ||
name: Generate code coverage report | ||
runs-on: ${{ inputs.os }} | ||
permissions: | ||
pull-requests: write | ||
needs: tests | ||
if: ${{ always() }} | ||
steps: | ||
- name: Coveralls Finished | ||
id: coveralls-finished | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
parallel-finished: true | ||
carryforward: "python-${{ inputs.python-version }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ coverage.xml | |
.hypothesis/ | ||
.pytest_cache/ | ||
test-reports/ | ||
coverage.lcov | ||
|
||
# Translations | ||
*.mo | ||
|