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

[common/persistence] Add ExecutionManager tests #5803

Merged
merged 9 commits into from
Mar 21, 2024

Conversation

3vilhamster
Copy link
Contributor

What changed?
I've introduced tests for proxy methods in persistence/ExecutionManager type.
To achive it I've created mocks for ExecutionStore and PayloadSerializer so that unit tests can focus only on manager logic.
As a first step I only test proxy methods that do not provide any logic. I'll follow up with a PR that focuses on more complex methods.

Why?
To increase code coverage and code quality.

How did you test it?
unit tests

Potential risks
None

Release notes

Documentation Changes

Copy link
Contributor

@dkrotx dkrotx left a comment

Choose a reason for hiding this comment

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

stamped with 2 comments

common/persistence/execution_manager_test.go Outdated Show resolved Hide resolved
common/persistence/execution_manager_test.go Outdated Show resolved Hide resolved
idls Outdated Show resolved Hide resolved
common/persistence/execution_manager_test.go Show resolved Hide resolved
common/persistence/execution_manager_test.go Outdated Show resolved Hide resolved
common/persistence/execution_manager_test.go Outdated Show resolved Hide resolved
common/persistence/execution_manager_test.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Merging #5803 (f9041d9) into master (b6cfd48) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Additional details and impacted files
Files Coverage Δ
common/persistence/data_store_interfaces.go 100.00% <ø> (ø)
common/persistence/execution_manager.go 12.07% <100.00%> (ø)
common/persistence/serializer.go 76.20% <ø> (ø)

... and 2 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 b6cfd48...f9041d9. Read the comment docs.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 018e60e6-74a5-4e89-90ce-79a84a394cc6

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 2 files are covered.
  • 44 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.04%) to 65.183%

Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 2 88.56%
common/task/fifo_task_scheduler.go 2 85.57%
service/history/execution/mutable_state_util.go 2 78.48%
service/history/task/fetcher.go 4 85.05%
service/matching/taskListManager.go 7 79.7%
service/history/task/transfer_standby_task_executor.go 10 86.6%
service/history/execution/mutable_state_task_refresher.go 17 65.82%
Totals Coverage Status
Change from base Build 018e5de2-13e5-4ee7-8b49-541f9f2abb50: 0.04%
Covered Lines: 95283
Relevant Lines: 146178

💛 - Coveralls

@3vilhamster 3vilhamster merged commit 3e6202e into cadence-workflow:master Mar 21, 2024
20 checks passed
@3vilhamster 3vilhamster deleted the em_tests branch March 21, 2024 12:28
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.

4 participants