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

[code-coverage] add tests for HandleDecisionTaskCompleted() #5934

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

ketsiambaku
Copy link
Member

@ketsiambaku ketsiambaku commented Apr 23, 2024

What changed?

  1. Generate mocks for service/history/resource
  2. Add tests scenarios for HandleDecisionTaskCompleted
  3. remove unused testing.T from expectMockCalls func

Why?
📈 Improve code coverage in service/handler/decision folder

How did you test it?
Unit tests

Potential risks

Release notes

Documentation Changes

@coveralls
Copy link

coveralls commented Apr 23, 2024

Pull Request Test Coverage Report for Build 018f0c6d-2ebf-4b6f-88d6-260f7abd9eef

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 57 unchanged lines in 17 files lost coverage.
  • Overall coverage decreased (-0.02%) to 67.659%

Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 2 88.56%
service/history/shard/context.go 2 66.7%
service/history/handler/handler.go 2 53.91%
common/persistence/sql/sqlplugin/mysql/task.go 2 73.68%
service/matching/db.go 2 73.23%
common/util.go 2 91.78%
service/matching/matcher.go 2 90.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%
Totals Coverage Status
Change from base Build 018f0b39-044e-40d9-83a4-36f15cd4016e: -0.02%
Covered Lines: 99085
Relevant Lines: 146448

💛 - Coveralls

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Merging #5934 (77b5878) into master (a4735e8) will increase coverage by 0.24%.
The diff coverage is n/a.

Additional details and impacted files

see 7 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 a4735e8...77b5878. Read the comment docs.

@ketsiambaku ketsiambaku changed the title generate resource mock and add tests for HandleDecisionTaskCompleted [code-coverage] add tests for HandleDecisionTaskCompleted() Apr 23, 2024
@ketsiambaku ketsiambaku marked this pull request as ready for review April 23, 2024 19:37
domainID: constants.TestDomainID,
expectedErr: &types.BadRequestError{Message: "Can't load workflow execution. WorkflowId not set."},
expectMockCalls: func(ctrl *gomock.Controller, decisionHandler *handlerImpl) {
_taskToken := &common.TaskToken{
Copy link
Member

Choose a reason for hiding this comment

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

We don't use _variable naming. Let's stick with regular naming patterns to avoid confusion. When I saw this I looked around to see whether this is a member variable or package level etc.

Copy link
Member

Choose a reason for hiding this comment

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

same comment applies to all underscore '_' prefixed variable names in this file

@ketsiambaku ketsiambaku merged commit dce7e4b into cadence-workflow:master Apr 23, 2024
20 checks passed
@ketsiambaku ketsiambaku deleted the history-decision branch April 23, 2024 20:44
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