fix: improve unexpected event filtering in tests#2688
fix: improve unexpected event filtering in tests#2688chmouel wants to merge 1 commit intotektoncd:mainfrom
Conversation
Refactored the event checking logic to specifically target and report warning events instead of filtering out individual event reasons. This ensures that unexpected errors are correctly identified during test validation.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2688 +/- ##
=======================================
Coverage 58.85% 58.85%
=======================================
Files 204 204
Lines 20149 20149
=======================================
Hits 11859 11859
Misses 7525 7525
Partials 765 765 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
made watcher in debug pipelines-as-code/startpaac#24 so this may be needed, |
There was a problem hiding this comment.
Code Review
This pull request refactors the event checking logic in test/pkg/gitea/test.go by introducing a new unexpectedEvents helper function. This helper filters for non-normal events, replacing the previous logic that specifically excluded 'CancelInProgress' reasons. The checkEvents function now logs all event reasons before failing if any unexpected events are detected. I have no feedback to provide.
📝 Description of the Change
Refactored the event checking logic to specifically target and report
warning events instead of filtering out individual event reasons. This
ensures that unexpected errors are correctly identified during test
validation.
🔗 Linked GitHub Issue
Fixes #
🧪 Testing Strategy
🤖 AI Assistance
AI assistance can be used for various tasks, such as code generation,
documentation, or testing.
Please indicate whether you have used AI assistance
for this PR and provide details if applicable.
Important
Slop will be simply rejected, if you are using AI assistance you need to make sure you
understand the code generated and that it meets the project's standards. you
need at least know how to run the code and deploy it (if needed). See
startpaac to make it easy
to deploy and test your code changes.
If the majority of the code in this PR was generated by an AI, please add a
Co-authored-bytrailer to your commit message.For example:
Co-authored-by: Claude noreply@anthropic.com
✅ Submitter Checklist
fix:,feat:) matches the "Type of Change" I selected above.make testandmake lintlocally to check for and fix anyissues. For an efficient workflow, I have considered installing
pre-commit and running
pre-commit installtoautomate these checks.