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

Add unit test for frontend/admin/handler - part 2 #6003

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

neil-xie
Copy link
Contributor

@neil-xie neil-xie commented May 9, 2024

What changed?
Add more unit test for frontend/admin/handler

Why?

How did you test it?

Potential risks

Release notes

Documentation Changes

Copy link

codecov bot commented May 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.42%. Comparing base (94b8305) to head (db1b5fc).
Report is 12 commits behind head on master.

Additional details and impacted files

see 21 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 94b8305...db1b5fc. Read the comment docs.

@coveralls
Copy link

coveralls commented May 9, 2024

Pull Request Test Coverage Report for Build 018f6355-2db9-4b66-8eea-28d1e6119fb4

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1010 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+0.2%) to 69.038%

Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 1 89.05%
service/history/execution/mutable_state_util.go 2 78.52%
tools/cli/admin_db_decode_thrift.go 3 69.23%
common/persistence/statsComputer.go 3 96.79%
service/frontend/api/handler.go 4 62.26%
service/history/task/fetcher.go 4 86.08%
service/history/engine/engineimpl/poll_mutable_state.go 9 74.16%
service/history/engine/engineimpl/refresh_workflow_tasks.go 31 0.0%
service/history/replication/task_processor.go 52 78.81%
service/history/execution/mutable_state_builder.go 901 71.29%
Totals Coverage Status
Change from base Build 018f5e8f-a247-406e-9920-f997ba145d18: 0.2%
Covered Lines: 101425
Relevant Lines: 146911

💛 - Coveralls

@neil-xie neil-xie enabled auto-merge (squash) May 10, 2024 01:52
"test-cluster": 1,
}, nil)
mock.EXPECT().GetReplicationMessages(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil, int64(2), nil)
mock.EXPECT().UpdateAckLevel(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest not using goock.Any() on the actual levels, and more generally for all the fields on write operations like this.

You probably want to ensure that if you were to do a big refactor after this test was landed, that if they were to get zero'd out or were wrong or something that the test would catch the problem.

Asserting - particularly in write cases - at least the important values, at both ends is probably worthwhile

Events: &types.DataBlob{},
},
hcHandlerFunc: func(mock *history.MockClient) {
mock.EXPECT().ReapplyEvents(gomock.Any(), gomock.Any()).Return(nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, you may want to be a little more specific about what's accepted

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.

None yet

3 participants