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

Make cluster.Metadata a struct and stop using mocks for it #4851

Merged

Conversation

vytautas-karpavicius
Copy link
Contributor

@vytautas-karpavicius vytautas-karpavicius commented May 27, 2022

What changed?
Make cluster.Metadata a struct, drop interface, corresponding mock and all its usages.

Why?
cluster.Metadata is a pure state struct that is constructed once when server starts and never change. Thus it is safe to pass it by value, no need for pointers or interfaces. Furthermore, keeping it a simple struct significantly simplifies testing.

How did you test it?
Existing tests.

Potential risks

Release notes

Documentation Changes

@vytautas-karpavicius vytautas-karpavicius marked this pull request as ready for review May 27, 2022 11:27
@vytautas-karpavicius vytautas-karpavicius requested a review from a team May 27, 2022 11:27
@coveralls
Copy link

coveralls commented May 27, 2022

Pull Request Test Coverage Report for Build 018113d3-f495-4c9d-9ded-7510e9a4cccd

  • 14 of 26 (53.85%) changed or added relevant lines in 3 files are covered.
  • 100 unchanged lines in 18 files lost coverage.
  • Overall coverage decreased (-0.06%) to 56.876%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/persistence/persistence-tests/persistenceTestBase.go 0 2 0.0%
common/resource/resourceTest.go 0 4 0.0%
common/cluster/metadata.go 14 20 70.0%
Files with Coverage Reduction New Missed Lines %
common/cluster/metadata.go 2 68.63%
common/membership/hashring.go 2 83.54%
common/persistence/executionManager.go 2 78.2%
common/persistence/historyManager.go 2 66.67%
common/persistence/statsComputer.go 2 96.43%
common/task/weightedRoundRobinTaskScheduler.go 2 89.64%
service/history/handler.go 2 47.73%
service/matching/matcher.go 2 91.46%
service/matching/taskListManager.go 2 73.77%
common/task/fifoTaskScheduler.go 3 84.54%
Totals Coverage Status
Change from base Build 01810671-81ba-482b-ac33-da8b392cee8c: -0.06%
Covered Lines: 83974
Relevant Lines: 147645

💛 - Coveralls

@vytautas-karpavicius vytautas-karpavicius merged commit b457b55 into uber:master May 30, 2022
@vytautas-karpavicius vytautas-karpavicius deleted the cluster-metadata-struct branch May 30, 2022 07:44
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.

3 participants