-
Notifications
You must be signed in to change notification settings - Fork 189
test: increase code coverage for templates and slack services #412
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
test: increase code coverage for templates and slack services #412
Conversation
Add comprehensive test coverage for pkg/templates/service.go and pkg/services/slack.go, improving overall project coverage from 63.8% to 64.5%. Signed-off-by: Willian Paixao <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive test coverage for the template service and Slack notification service, increasing overall project coverage from 63.8% to 64.5%. The tests cover success scenarios, error cases, template validation, and edge cases for both services.
Key Changes
- Added 9 new test functions for
pkg/templates/service.gocovering template creation, formatting, and error handling - Added 8 new test functions for
pkg/services/slack.gocovering template validation, message options, client creation, and error scenarios - Improved test organization using table-driven tests and subtests
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| pkg/templates/service_test.go | Adds comprehensive test coverage for NewService and FormatNotification functions, including success paths, invalid templates, and error handling |
| pkg/services/slack_test.go | Adds test coverage for template validation, delivery policies, message options, API client creation, and JSON parsing errors |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Willian Paixao <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pasha-codefresh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you
…oj#412) * test: increase code coverage for templates and slack services Add comprehensive test coverage for pkg/templates/service.go and pkg/services/slack.go, improving overall project coverage from 63.8% to 64.5%. Signed-off-by: Willian Paixao <[email protected]> * test: addressed all three Copilot review comments Signed-off-by: Willian Paixao <[email protected]> --------- Signed-off-by: Willian Paixao <[email protected]>
Add comprehensive test coverage for pkg/templates/service.go and pkg/services/slack.go, improving overall project coverage from 63.8% to 64.5%.
I needed a better way for testing #410 and #411.