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

Refactor high-coupling method into functions in applyEvent for a more testability #6089

Closed bowenxia closed 4 weeks ago

bowenxia commented 4 weeks ago

What changed? Refactored methods in applyEvent to be functions, and make them as historyReplicator parameters

Why? Easier to do unit test

How did you test it?

Potential risks

Release notes

Documentation Changes

codecov[bot] commented 4 weeks ago

Codecov Report

Attention: Patch coverage is 2.32558% with 42 lines in your changes missing coverage. Please review.

Project coverage is 68.52%. Comparing base (f0f7efd) to head (f092d74). Report is 6 commits behind head on master.

Additional details and impacted files | [Files](https://app.codecov.io/gh/uber/cadence/pull/6089?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) | Coverage Δ | | |---|---|---| | [service/history/ndc/history\_replicator.go](https://app.codecov.io/gh/uber/cadence/pull/6089?src=pr&el=tree&filepath=service%2Fhistory%2Fndc%2Fhistory_replicator.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-c2VydmljZS9oaXN0b3J5L25kYy9oaXN0b3J5X3JlcGxpY2F0b3IuZ28=) | `16.87% <2.32%> (-0.26%)` | :arrow_down: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/uber/cadence/pull/6089/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/6089?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/6089?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). Last update [f0f7efd...f092d74](https://app.codecov.io/gh/uber/cadence/pull/6089?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 018fe0a0-cddd-4e8a-9e06-8a5a8650a29c

Details


Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 1 89.05%
service/history/task/transfer_standby_task_executor.go 2 87.14%
common/persistence/sql/sqlplugin/mysql/task.go 2 73.68%
service/frontend/api/handler.go 2 62.56%
service/history/task/transfer_active_task_executor.go 2 72.79%
common/util.go 2 91.78%
common/persistence/sql/sqlplugin/mysql/db.go 2 79.49%
common/task/fifo_task_scheduler.go 3 84.54%
common/archiver/filestore/historyArchiver.go 4 80.95%
service/matching/tasklist/task_list_manager.go 4 76.09%
<!-- Total: 171 -->
Totals Coverage Status
Change from base Build 018fe051-df14-4702-b515-0388c6db07f3: -0.1%
Covered Lines: 103093
Relevant Lines: 147942

💛 - Coveralls