test: increase code coverage for templates and slack services#412
Merged
pasha-codefresh merged 2 commits intoargoproj:masterfrom Nov 29, 2025
Merged
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 <willian@ufpa.br>
There was a problem hiding this comment.
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 <willian@ufpa.br>
There was a problem hiding this comment.
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.
willianpaixao
added a commit
to willianpaixao/notifications-engine
that referenced
this pull request
Dec 3, 2025
…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 <willian@ufpa.br> * test: addressed all three Copilot review comments Signed-off-by: Willian Paixao <willian@ufpa.br> --------- Signed-off-by: Willian Paixao <willian@ufpa.br>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.