Skip to content

Commit

Permalink
fix: make the Test action fail in case of missing pytest dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrounine authored and armand-sauzay committed Aug 19, 2024
1 parent 50301aa commit bc3ac08
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ runs:
elif [[ -f setup.py ]]; then
python setup.py test -- ${{ inputs.test-flags }}
else
pip install pytest pytest-cov
pytest ${{ inputs.test-flags }}
echo "::error::pytest not found in the dependencies, cannot run tests"
exit 1
fi
# If we do have a poetry.lock, we use a poetry based workflow
- name: install poetry
Expand All @@ -92,7 +92,8 @@ runs:
if poetry show pytest &>/dev/null; then
poetry run pytest ${{ inputs.test-flags }}
else
echo "::warning::pytest not found in poetry.lock"
echo "::error::pytest not found in poetry.lock, cannot run tests"
exit 1
fi
- name: Upload coverage
if: inputs.upload-coverage != 'false'
Expand Down

0 comments on commit bc3ac08

Please sign in to comment.