Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pytest] Add warning for PRs missing unit test file changes #3875

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/commitflow-py3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@ jobs:
name: test-reports-${{ matrix.python-version }}
path: test-reports

- name: Check and comment if no unit test files are modified
if: matrix.python-version == '3.11'
run: |
git fetch origin master
changed_files=$(git diff --name-only origin/master)
agl29 marked this conversation as resolved.
Show resolved Hide resolved
if echo "$changed_files" | grep -qE '(^test|_test\.py|^tests|_tests\.py|.test)'; then
echo "✅ Unit test files were modified."
else
echo "⚠️ No unit test files modified."
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"body":"⚠️ No unit test files modified. Please ensure that changes are properly tested. ⚠️"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
fi
- name: run python lints
run: |
PYTHONWARNINGS=always ./build/env/bin/hue runruff check
Expand Down