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

Refactor persistence manager initialization #6441

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

bowenxia
Copy link
Contributor

@bowenxia bowenxia commented Oct 29, 2024

What changed?
Refactored these 5 functions to be an interface PersistenceManagerFactory:

  • initializeExecutionStore(c *cli.Context, shardID int) (persistence.ExecutionManager, error)
  • initializeHistoryManager(c *cli.Context) (persistence.HistoryManager, error)
  • initializeShardManager(c *cli.Context) (persistence.ShardManager, error)
  • initializeDomainManager(c *cli.Context) (persistence.DomainManager, error)
  • initPersistenceFactory(c *cli.Context) (client.Factory, error)

and add it to deps struct
Also add a mock file for persistenceManagerFactory

Why?
For a better testability

How did you test it?
unit tests

Potential risks

Release notes

Documentation Changes

@bowenxia bowenxia enabled auto-merge (squash) October 29, 2024 22:14
@bowenxia bowenxia merged commit 2887db9 into master Oct 29, 2024
19 checks passed
@bowenxia bowenxia deleted the xbowen/refactor_persistence_manager_initialization branch October 29, 2024 22:47
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 3.33333% with 29 lines in your changes missing coverage. Please review.

Project coverage is 77.60%. Comparing base (cd6e4f3) to head (e3b43c9).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
tools/cli/database.go 0.00% 16 Missing ⚠️
tools/cli/admin_commands.go 0.00% 6 Missing ⚠️
tools/cli/admin_db_scan_command.go 0.00% 3 Missing ⚠️
tools/cli/admin_db_clean_command.go 0.00% 2 Missing ⚠️
tools/cli/admin_timers.go 0.00% 1 Missing ⚠️
tools/cli/domain_utils.go 0.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
tools/cli/app.go 93.71% <100.00%> (ø)
tools/cli/admin_timers.go 0.00% <0.00%> (ø)
tools/cli/domain_utils.go 1.30% <0.00%> (ø)
tools/cli/admin_db_clean_command.go 29.59% <0.00%> (ø)
tools/cli/admin_db_scan_command.go 0.00% <0.00%> (ø)
tools/cli/admin_commands.go 10.62% <0.00%> (ø)
tools/cli/database.go 36.98% <0.00%> (ø)

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd6e4f3...e3b43c9. Read the comment docs.

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