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 more test to reach 100% coverage for visibility_single_manager #5832

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

bowenxia
Copy link
Contributor

@bowenxia bowenxia commented Apr 2, 2024

What changed?
Add unit tests to reach 100% coverage for the file

Why?
code coverage week

How did you test it?
unit test

Potential risks

Release notes

Documentation Changes

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Merging #5832 (8daa448) into master (c56c124) will increase coverage by 0.24%.
Report is 1 commits behind head on master.
The diff coverage is n/a.

❗ Current head 8daa448 differs from pull request most recent head e08e72c. Consider uploading reports for the commit e08e72c to get more accurate results

Additional details and impacted files

see 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 e5ccdf8...e08e72c. Read the comment docs.

@coveralls
Copy link

coveralls commented Apr 2, 2024

Pull Request Test Coverage Report for Build 018e9d46-51b7-469d-8c5a-6f1158cec0c9

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 38 unchanged lines in 9 files lost coverage.
  • Overall coverage increased (+0.08%) to 65.422%

Files with Coverage Reduction New Missed Lines %
service/history/task/transfer_standby_task_executor.go 2 86.6%
common/task/weighted_round_robin_task_scheduler.go 2 89.05%
common/persistence/sql/sqlplugin/postgres/task.go 2 73.4%
service/history/shard/context.go 2 66.7%
common/persistence/sql/sqlplugin/postgres/db.go 2 80.0%
service/history/execution/mutable_state_util.go 2 78.13%
common/asyncworkflow/queue/consumer/default_consumer.go 3 92.05%
service/history/task/fetcher.go 3 86.6%
service/history/task/task_util.go 20 70.57%
Totals Coverage Status
Change from base Build 018e9d44-8f40-49fc-a0a5-47b187356a25: 0.08%
Covered Lines: 95738
Relevant Lines: 146339

💛 - Coveralls

@taylanisikdemir taylanisikdemir changed the title Add test to reach 100% coverage for the file Add more test to reach 100% coverage for visibility_single_manager Apr 2, 2024
visibilityManager := NewVisibilityManagerImpl(mockVisibilityStore, log.NewNoop())
visibilityManagerImpl := visibilityManager.(*visibilityManagerImpl)

assert.Nil(t, visibilityManagerImpl.toInternalListWorkflowExecutionsRequest(nil))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this is already covered by other unit tests targeting public funcs. unless you wanted to cover specific edge cases, you don't need to add a separate test func targeting private funcs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I am testing an edge case with an input is nil.

@bowenxia bowenxia enabled auto-merge (squash) April 2, 2024 05:22
@bowenxia bowenxia merged commit 9fb217f into master Apr 2, 2024
17 of 19 checks passed
@bowenxia bowenxia deleted the xbowen_visibility_single_manager_unit_test01 branch April 2, 2024 05:46
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