Skip to content

Conversation

@willianpaixao
Copy link
Contributor

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.

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]>
Copilot AI review requested due to automatic review settings November 18, 2025 16:12
Copy link

Copilot AI left a 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.go covering template creation, formatting, and error handling
  • Added 8 new test functions for pkg/services/slack.go covering 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.

Copy link

Copilot AI left a 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.

Copy link
Member

@pasha-codefresh pasha-codefresh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@pasha-codefresh pasha-codefresh merged commit e2e7fe1 into argoproj:master Nov 29, 2025
9 checks passed
@willianpaixao willianpaixao deleted the willianpaixao-codecov branch November 30, 2025 13:21
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 <[email protected]>

* test: addressed all three Copilot review comments

Signed-off-by: Willian Paixao <[email protected]>

---------

Signed-off-by: Willian Paixao <[email protected]>
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.

2 participants