Skip to content

test(): add unit tests for common.go (0% ➝ 100% coverage) #74

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yuvraj-kolkar17
Copy link

@yuvraj-kolkar17 yuvraj-kolkar17 commented Jul 28, 2025

Description

Added comprehensive unit tests for the cmd/common.go file to achieve 100% test coverage.
This ensures the core utility functions in the common.go file behave as expected across various edge cases.

Part of #46

How Has This Been Tested?

go test ./cmd -coverprofile=coverage.out
go tool cover -func=coverage.out

Before vs After:

Before After

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit test cases.

Does this PR introduce a breaking change?


yuvraj-kolkar17 and others added 5 commits July 28, 2025 22:24
Signed-off-by: yuvraj Kolkar <[email protected]>
Signed-off-by: yuvraj Kolkar <[email protected]>
Signed-off-by: yuvraj Kolkar <[email protected]>
Signed-off-by: yuvraj Kolkar <[email protected]>
@yuvraj-kolkar17
Copy link
Author

yuvraj-kolkar17 commented Jul 28, 2025

Hi @priyank-upadhyay @narmidm @gourishkb @Rahul-D78

Can you please review this PR !

@yuvraj-kolkar17 yuvraj-kolkar17 changed the title test(): added 0% to 100% unit test coverage for cmd/common.go test(): Added100% unit test coverage for cmd/common.go Jul 28, 2025
@yuvraj-kolkar17 yuvraj-kolkar17 changed the title test(): Added100% unit test coverage for cmd/common.go test(): Added 100% unit test coverage for cmd/common.go Jul 28, 2025
@narmidm narmidm assigned narmidm and yuvraj-kolkar17 and unassigned narmidm Jul 28, 2025
@narmidm narmidm self-requested a review July 28, 2025 20:24
@yuvraj-kolkar17
Copy link
Author

yuvraj-kolkar17 commented Jul 28, 2025

Hello @narmidm sir, should I write unit tests, integration tests, or both for the other files in /cmd/? or shift to the /pkg?
Also, PTAL and review this PR and #75 when you have a chance. Thanks a lot!

@yuvraj-kolkar17 yuvraj-kolkar17 changed the title test(): Added 100% unit test coverage for cmd/common.go test(): add unit tests for common.go (0% ➝ 100% coverage) Jul 31, 2025
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