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

Made execution.Cache an interface so we can mock it in unit tests #6058

Closed jakobht closed 1 month ago

jakobht commented 1 month ago

What changed? Made execution cache an interface

Why? Now we can mock it in unit tests

How did you test it? Unit and integration tests

Potential risks Touches a lot of files but should be a safe change

Release notes

Documentation Changes

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 67.85%. Comparing base (fc6fae5) to head (36d7881). Report is 4 commits behind head on master.

Additional details and impacted files | [Files](https://app.codecov.io/gh/uber/cadence/pull/6058?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/decision/handler.go](https://app.codecov.io/gh/uber/cadence/pull/6058?src=pr&el=tree&filepath=service%2Fhistory%2Fdecision%2Fhandler.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-c2VydmljZS9oaXN0b3J5L2RlY2lzaW9uL2hhbmRsZXIuZ28=) | `94.93% <ø> (ø)` | | | [...ervice/history/engine/engineimpl/history\_engine.go](https://app.codecov.io/gh/uber/cadence/pull/6058?src=pr&el=tree&filepath=service%2Fhistory%2Fengine%2Fengineimpl%2Fhistory_engine.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-c2VydmljZS9oaXN0b3J5L2VuZ2luZS9lbmdpbmVpbXBsL2hpc3RvcnlfZW5naW5lLmdv) | `83.67% <ø> (ø)` | | | [service/history/execution/cache.go](https://app.codecov.io/gh/uber/cadence/pull/6058?src=pr&el=tree&filepath=service%2Fhistory%2Fexecution%2Fcache.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-c2VydmljZS9oaXN0b3J5L2V4ZWN1dGlvbi9jYWNoZS5nbw==) | `37.24% <100.00%> (ø)` | | | [service/history/ndc/activity\_replicator.go](https://app.codecov.io/gh/uber/cadence/pull/6058?src=pr&el=tree&filepath=service%2Fhistory%2Fndc%2Factivity_replicator.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-c2VydmljZS9oaXN0b3J5L25kYy9hY3Rpdml0eV9yZXBsaWNhdG9yLmdv) | `85.36% <ø> (ø)` | | | [service/history/ndc/history\_replicator.go](https://app.codecov.io/gh/uber/cadence/pull/6058?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=) | `17.13% <ø> (ø)` | | | [service/history/ndc/transaction\_manager.go](https://app.codecov.io/gh/uber/cadence/pull/6058?src=pr&el=tree&filepath=service%2Fhistory%2Fndc%2Ftransaction_manager.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-c2VydmljZS9oaXN0b3J5L25kYy90cmFuc2FjdGlvbl9tYW5hZ2VyLmdv) | `72.81% <ø> (ø)` | | | [...ice/history/queue/cross\_cluster\_queue\_processor.go](https://app.codecov.io/gh/uber/cadence/pull/6058?src=pr&el=tree&filepath=service%2Fhistory%2Fqueue%2Fcross_cluster_queue_processor.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-c2VydmljZS9oaXN0b3J5L3F1ZXVlL2Nyb3NzX2NsdXN0ZXJfcXVldWVfcHJvY2Vzc29yLmdv) | `39.13% <ø> (ø)` | | | [...istory/queue/cross\_cluster\_queue\_processor\_base.go](https://app.codecov.io/gh/uber/cadence/pull/6058?src=pr&el=tree&filepath=service%2Fhistory%2Fqueue%2Fcross_cluster_queue_processor_base.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-c2VydmljZS9oaXN0b3J5L3F1ZXVlL2Nyb3NzX2NsdXN0ZXJfcXVldWVfcHJvY2Vzc29yX2Jhc2UuZ28=) | `45.99% <ø> (ø)` | | | [service/history/queue/factory.go](https://app.codecov.io/gh/uber/cadence/pull/6058?src=pr&el=tree&filepath=service%2Fhistory%2Fqueue%2Ffactory.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-c2VydmljZS9oaXN0b3J5L3F1ZXVlL2ZhY3RvcnkuZ28=) | `100.00% <ø> (ø)` | | | [service/history/queue/timer\_queue\_processor.go](https://app.codecov.io/gh/uber/cadence/pull/6058?src=pr&el=tree&filepath=service%2Fhistory%2Fqueue%2Ftimer_queue_processor.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-c2VydmljZS9oaXN0b3J5L3F1ZXVlL3RpbWVyX3F1ZXVlX3Byb2Nlc3Nvci5nbw==) | `24.57% <ø> (ø)` | | | ... and [12 more](https://app.codecov.io/gh/uber/cadence/pull/6058?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) | | ... and [9 files with indirect coverage changes](https://app.codecov.io/gh/uber/cadence/pull/6058/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/6058?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/6058?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). Last update [fc6fae5...36d7881](https://app.codecov.io/gh/uber/cadence/pull/6058?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 1 month ago

Pull Request Test Coverage Report for Build 018faa8e-f44b-401a-8913-73e52eda9615

Details


Files with Coverage Reduction New Missed Lines %
service/history/shard/context.go 2 68.99%
service/matching/tasklist/db.go 2 73.23%
service/matching/tasklist/task_list_manager.go 2 76.48%
common/task/fifo_task_scheduler.go 2 85.57%
common/persistence/sql/sqlplugin/mysql/task.go 2 73.68%
service/history/task/transfer_active_task_executor.go 2 72.72%
common/persistence/sql/sqlplugin/mysql/db.go 2 79.49%
common/persistence/historyManager.go 2 66.67%
common/log/tag/tags.go 3 50.46%
service/history/task/transfer_standby_task_executor.go 4 86.63%
<!-- Total: 87 -->
Totals Coverage Status
Change from base Build 018faa62-bb7e-4a04-89d5-ced9d0d49d30: -0.02%
Covered Lines: 102369
Relevant Lines: 147418

💛 - Coveralls