From 1605a793201f08fe31b7eab735747f24fe3def3d Mon Sep 17 00:00:00 2001 From: Xevion Date: Sat, 9 Nov 2024 14:18:58 -0600 Subject: [PATCH] Add pytest-coverage-comment, use color --- .github/workflows/test.yaml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5cc0cff..06e31d1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -35,4 +35,30 @@ jobs: - name: Install library run: cd backend && poetry install --no-interaction - - run: cd backend && poetry run pytest \ No newline at end of file + - name: Pytest + run: | + cd backend + poetry run pytest --color=yes --cov-report=term-missing:skip-covered --cov=app tests/ | tee pytest-coverage.txt + + - name: Pytest coverage comment + id: coverageComment + uses: MishaKav/pytest-coverage-comment@main + with: + pytest-coverage-path: ./pytest-coverage.txt + junitxml-path: ./pytest.xml + + - name: Check the output coverage + run: | + echo "Coverage Percentage - ${{ steps.coverageComment.outputs.coverage }}" + echo "Coverage Color - ${{ steps.coverageComment.outputs.color }}" + echo "Coverage Html - ${{ steps.coverageComment.outputs.coverageHtml }}" + echo "Summary Report - ${{ steps.coverageComment.outputs.summaryReport }}" + + echo "Coverage Warnings - ${{ steps.coverageComment.outputs.warnings }}" + + echo "Coverage Errors - ${{ steps.coverageComment.outputs.errors }}" + echo "Coverage Failures - ${{ steps.coverageComment.outputs.failures }}" + echo "Coverage Skipped - ${{ steps.coverageComment.outputs.skipped }}" + echo "Coverage Tests - ${{ steps.coverageComment.outputs.tests }}" + echo "Coverage Time - ${{ steps.coverageComment.outputs.time }}" + echo "Not Success Test Info - ${{ steps.coverageComment.outputs.notSuccessTestInfo }}" \ No newline at end of file