uber / cadence

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.
https://cadenceworkflow.io
MIT License
7.97k stars 773 forks source link

tools/cli: reducing unnecessary closures #6090

Closed Groxx closed 4 weeks ago

Groxx commented 4 weeks ago

Pretty simple change: these closures don't actually buy us anything, but they do make coverage more annoying to gather because we don't call the closure. So just get rid of the closures. Shorter and free coverage.

Groxx commented 4 weeks ago

Difftastic makes this quite easy to check by hand:

Screenshot 2024-06-03 at 17 49 15
codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.97%. Comparing base (84ab621) to head (87142e1).

Additional details and impacted files | [Files](https://app.codecov.io/gh/uber/cadence/pull/6090?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) | Coverage Δ | | |---|---|---| | [tools/cli/admin.go](https://app.codecov.io/gh/uber/cadence/pull/6090?src=pr&el=tree&filepath=tools%2Fcli%2Fadmin.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-dG9vbHMvY2xpL2FkbWluLmdv) | `98.35% <100.00%> (+31.49%)` | :arrow_up: | | [tools/cli/cluster.go](https://app.codecov.io/gh/uber/cadence/pull/6090?src=pr&el=tree&filepath=tools%2Fcli%2Fcluster.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-dG9vbHMvY2xpL2NsdXN0ZXIuZ28=) | `100.00% <100.00%> (ø)` | | | [tools/cli/task\_list.go](https://app.codecov.io/gh/uber/cadence/pull/6090?src=pr&el=tree&filepath=tools%2Fcli%2Ftask_list.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-dG9vbHMvY2xpL3Rhc2tfbGlzdC5nbw==) | `100.00% <100.00%> (+13.63%)` | :arrow_up: | | [tools/cli/workflow.go](https://app.codecov.io/gh/uber/cadence/pull/6090?src=pr&el=tree&filepath=tools%2Fcli%2Fworkflow.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-dG9vbHMvY2xpL3dvcmtmbG93Lmdv) | `100.00% <100.00%> (+32.06%)` | :arrow_up: | ... and [7 files with indirect coverage changes](https://app.codecov.io/gh/uber/cadence/pull/6090/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/uber/cadence/pull/6090?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/uber/cadence/pull/6090?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). Last update [84ab621...87142e1](https://app.codecov.io/gh/uber/cadence/pull/6090?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber).
coveralls commented 4 weeks ago

Pull Request Test Coverage Report for Build 018fe06f-9837-4a7b-a8fa-d60958d36128

Details


Files with Coverage Reduction New Missed Lines %
service/matching/tasklist/db.go 2 73.23%
common/peerprovider/ringpopprovider/config.go 2 81.58%
common/task/fifo_task_scheduler.go 2 87.63%
common/persistence/sql/sqlplugin/mysql/task.go 2 73.68%
service/history/task/transfer_active_task_executor.go 2 72.79%
common/persistence/sql/sqlplugin/mysql/db.go 2 79.49%
common/log/tag/tags.go 3 50.46%
service/history/handler/handler.go 3 96.2%
common/persistence/statsComputer.go 3 98.21%
service/frontend/api/handler.go 4 62.5%
<!-- Total: 88 -->
Totals Coverage Status
Change from base Build 018fe051-df14-4702-b515-0388c6db07f3: 0.3%
Covered Lines: 104369
Relevant Lines: 148939

💛 - Coveralls