fix: some bugs when adding test cases for v1.16#980
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #980 +/- ##
==========================================
+ Coverage 69.10% 70.04% +0.94%
==========================================
Files 168 168
Lines 11340 11353 +13
==========================================
+ Hits 7836 7952 +116
+ Misses 3152 3050 -102
+ Partials 352 351 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issues related to test case execution and module refreshing in version 1.16 by updating method signatures, renaming Refresh to Fresh, and refining mock implementations. Key changes include:
- Updated Shutdown to return an error value and adjusted related mocks.
- Renamed Refresh methods to Fresh across multiple modules with corresponding updates in tests.
- Converted configuration values (e.g., HTTP timeout) and updated interface signatures (e.g. SetFiles).
Reviewed Changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| mocks/grpc/Grpc.go | Updated Shutdown method to return error and modified mock call return handling. |
| mocks/foundation/Application.go | Introduced Fresh method replacing Refresh and updated corresponding mocks. |
| mocks/database/orm/Orm.go | Removed Refresh mocks in favor of Fresh. |
| http/service_provider.go | Adjusted HTTP client timeout conversion from duration getter to integer with multiplier. |
| grpc/application.go | Updated Shutdown method signature and test assertions to check for errors. |
| foundation/container.go | Replaced Refresh with Fresh for clearing container instances. |
| foundation/application.go | Modified several helper methods to use new Fresh method; added Refresh to compose Fresh+Boot. |
| facades/db.go | Added MakeDB façade. |
| database/service_provider.go | Changed usage from Refresh to Fresh in ORM building. |
| database/orm/orm.go | Renamed refresh parameter and related method to fresh. |
| database/migration/* | Added a prepareDatabase call in Reset and updated tests accordingly. |
| contracts/support/http/body.go | Updated SetFiles signature to use map[string][]string. |
| contracts/grpc/grpc.go | Updated Shutdown signature to return error. |
| contracts/foundation/application.go | Updated interface definitions and replaced Refresh with Fresh; added MakeDB. |
| contracts/database/orm/orm.go | Changed Refresh method to Fresh. |
| console/application.go | Added support for the --no-ansi flag when running commands. |
Files not reviewed (1)
- go.mod: Language not supported
Comments suppressed due to low confidence (3)
contracts/support/http/body.go:11
- Changing the SetFiles method’s signature to accept map[string][]string may break existing implementations; ensure that all consumers are updated accordingly.
SetFiles(files map[string][]string) Body
database/migration/migrator.go:60
- The introduction of prepareDatabase() in Reset adds a dependency; please confirm that prepareDatabase is implemented and properly tested in this context.
if err := r.prepareDatabase(); err != nil {
foundation/application.go:100
- [nitpick] The Refresh method now calls Fresh followed by Boot; verify that this combined behavior is in line with the intended module reset functionality to avoid side effects.
func (r *Application) Refresh() {
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.
📑 Description
✅ Checks