From f1be6676d1c7b9b801143c77750b0a903840cb07 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sat, 9 Nov 2024 15:28:11 -0600 Subject: [PATCH] Add pytest/coverage file check since pytest-coverage-comment does not error --- .github/workflows/test.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5c11450..8c77c7a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -55,9 +55,16 @@ jobs: cd backend set -o pipefail # otherwise 'tee' will eat the exit code poetry run pytest --color=yes --cov=linkpulse --cov-report=term-missing:skip-covered --junitxml=pytest.xml | tee pytest-coverage.txt + + # pytest-coverage-comment won't error if the files are missing + if [ ! -f backend/pytest-coverage.txt ] || [ ! -f backend/pytest.xml ]; then + echo "::error::Coverage files not found" + exit 1 + fi - name: Pytest coverage comment id: coverageComment + if: steps.check-coverage-files.outputs.success == 'true' uses: MishaKav/pytest-coverage-comment@main with: pytest-coverage-path: backend/pytest-coverage.txt