Skip to content
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

fix: some bugs when adding test cases for v1.16 #980

Merged
merged 7 commits into from
Apr 1, 2025

Conversation

hwbrzzl
Copy link
Contributor

@hwbrzzl hwbrzzl commented Mar 30, 2025

📑 Description

✅ Checks

  • Added test cases for my code

Copy link

codecov bot commented Mar 30, 2025

Codecov Report

Attention: Patch coverage is 73.59551% with 47 lines in your changes missing coverage. Please review.

Project coverage is 70.04%. Comparing base (4f2944d) to head (b6601c9).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
foundation/application.go 62.66% 28 Missing ⚠️
foundation/container.go 80.00% 17 Missing ⚠️
http/service_provider.go 0.00% 1 Missing ⚠️
testing/docker/database.go 50.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hwbrzzl hwbrzzl marked this pull request as ready for review April 1, 2025 04:05
@Copilot Copilot bot review requested due to automatic review settings April 1, 2025 04:06
@hwbrzzl hwbrzzl requested a review from a team as a code owner April 1, 2025 04:06
Copy link

@Copilot 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 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() {

@hwbrzzl hwbrzzl merged commit 47e6f78 into master Apr 1, 2025
13 checks passed
@hwbrzzl hwbrzzl deleted the bowen/fix-bugs-when-testing branch April 1, 2025 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant