Skip to content

feat: add Python test failure notification#61

Open
paul-dave80 wants to merge 2 commits intoFullStackWithLawrence:mainfrom
paul-dave80:feat/python-test-failure-notification
Open

feat: add Python test failure notification#61
paul-dave80 wants to merge 2 commits intoFullStackWithLawrence:mainfrom
paul-dave80:feat/python-test-failure-notification

Conversation

@paul-dave80
Copy link
Copy Markdown

Summary

This PR updates the Python Unit Tests GitHub Actions workflow to create a GitHub Issue notification when the python-unit-tests job fails.

Changes

  • Adds a dedicated notification job for Python unit test failures.
  • Uses if: ${{ always() }} so the notification job still runs even when the test job fails.
  • Uses needs.python-unit-tests.result to check whether the test job failed.
  • Creates a GitHub Issue using gh issue create.
  • Includes useful failure context such as repository, workflow, run number, branch, commit SHA, triggering user, job result, and failed run URL.
  • Allows the notification addressee to be parameterized using the NOTIFY_USER repository variable, with github.actor as the fallback.

Testing

  • Verified the workflow file was modified on the feature branch.
  • Ran git diff --check successfully.
  • Confirmed the branch was pushed to the forked repository.
  • Confirmed the updated testsPython.yml file is visible on GitHub.

Notes

No new external dependencies were added.

@paul-dave80
Copy link
Copy Markdown
Author

Validation Update

I manually triggered the Python Unit Tests workflow from the feat/python-test-failure-notification branch after correcting the workflow YAML structure.

The workflow result confirmed the intended notification behavior:

  • python-unit-tests failed because required environment/secrets such as MYSQL_PORT are not configured in my fork.
  • Notify on Python test failure succeeded.
  • The notification job created GitHub Issue chore(deps): bump pydantic from 2.10.0 to 2.11.9 #1: CI failure: Python Unit Tests #2.
  • I also received the GitHub email notification generated from that issue.

This confirms that the failure-notification workflow runs after the test job fails and successfully creates a trackable GitHub Issue notification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant