-
Notifications
You must be signed in to change notification settings - Fork 236
Improve test coverage for user package #713
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
base: main
Are you sure you want to change the base?
Conversation
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 user and organization unit management packages. The changes include new test files for store and handler layers in the user package, and store and service layers in the ou package. The production code has been refactored to enable testability through dependency injection while maintaining the existing API contracts.
Key changes:
- Added extensive test suites for user store, handler, and service layers
- Added comprehensive test coverage for ou store and service layers
- Refactored store implementations to use dependency injection for database providers
- Added testability hooks in service layer for resource fetching
- Added mock configuration for the ou package
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| backend/internal/user/store_test.go | Adds comprehensive store layer tests for user management operations |
| backend/internal/user/handler_test.go | Adds extensive handler layer tests with test suite pattern |
| backend/internal/user/service_test.go | Renames test functions to follow naming conventions |
| backend/internal/user/store.go | Refactors store to use dependency injection for testability |
| backend/internal/ou/store_test.go | Adds comprehensive store layer tests for organization units |
| backend/internal/ou/service_test.go | Adds extensive service layer tests with helper functions |
| backend/internal/ou/service.go | Adds testability hooks for resource fetching |
| backend/internal/ou/organizationUnitStoreInterface_mock_test.go | Generated mock file for store interface |
| backend/.mockery.private.yml | Adds mock configuration for ou package |
20f753f to
cf90b42
Compare
cf90b42 to
cccd614
Compare
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 11 out of 11 changed files in this pull request and generated no new comments.
cccd614 to
0235819
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #713 +/- ##
==========================================
+ Coverage 78.41% 80.03% +1.61%
==========================================
Files 239 239
Lines 20147 20149 +2
Branches 334 334
==========================================
+ Hits 15799 16126 +327
+ Misses 3206 2999 -207
+ Partials 1142 1024 -118
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0235819 to
e5df1cc
Compare
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 12 out of 12 changed files in this pull request and generated no new comments.
e5df1cc to
a5ee17a
Compare
a5ee17a to
725d7f0
Compare
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 5 out of 5 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
backend/internal/user/service_test.go:1
- The test case 'removes credential fields' in
TestExtractCredentialsis commented out. This test validates important credential extraction behavior and should be uncommented to ensure proper test coverage.
/*
|
|
||
| oupkg "github.com/asgardeo/thunder/internal/ou" | ||
| "github.com/asgardeo/thunder/internal/system/error/serviceerror" | ||
| // "github.com/asgardeo/thunder/internal/system/hash" |
Copilot
AI
Nov 10, 2025
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.
Commented import that appears to be leftover from development. This should either be removed entirely or uncommented if needed by the commented-out test cases.
| // "github.com/asgardeo/thunder/internal/system/hash" |
Purpose
$subject