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

Add unit test for frontend/admin/handler - part 2 #6003

Merged
merged 4 commits into from
Jun 4, 2024

Conversation

neil-xie
Copy link
Member

@neil-xie neil-xie commented May 9, 2024

What changed?
Add more unit test for frontend/admin/handler

Why?

How did you test it?

Potential risks

Release notes

Documentation Changes

Copy link

codecov bot commented May 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.42%. Comparing base (f0f7efd) to head (e1531fe).
Report is 14 commits behind head on master.

Additional details and impacted files

see 15 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 f0f7efd...e1531fe. Read the comment docs.

@coveralls
Copy link

coveralls commented May 9, 2024

Pull Request Test Coverage Report for Build 018f6355-2db9-4b66-8eea-28d1e6119fb4

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1010 unchanged lines in 10 files lost coverage.
  • Overall coverage increased (+0.2%) to 69.038%

Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 1 89.05%
service/history/execution/mutable_state_util.go 2 78.52%
tools/cli/admin_db_decode_thrift.go 3 69.23%
common/persistence/statsComputer.go 3 96.79%
service/frontend/api/handler.go 4 62.26%
service/history/task/fetcher.go 4 86.08%
service/history/engine/engineimpl/poll_mutable_state.go 9 74.16%
service/history/engine/engineimpl/refresh_workflow_tasks.go 31 0.0%
service/history/replication/task_processor.go 52 78.81%
service/history/execution/mutable_state_builder.go 901 71.29%
Totals Coverage Status
Change from base Build 018f5e8f-a247-406e-9920-f997ba145d18: 0.2%
Covered Lines: 101425
Relevant Lines: 146911

💛 - Coveralls

@neil-xie neil-xie enabled auto-merge (squash) May 10, 2024 01:52
Copy link
Member

@taylanisikdemir taylanisikdemir left a comment

Choose a reason for hiding this comment

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

LGTM with comments

},
wantErr: false,
},
"get dql message error": {
Copy link
Member

Choose a reason for hiding this comment

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

nit typo: dlq

},
},
hcHandlerFunc: func(mock *history.MockClient) {
mock.EXPECT().GetDLQReplicationMessages(gomock.Any(), gomock.Any()).Return(nil, nil)
Copy link
Member

Choose a reason for hiding this comment

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

let's return some non-nil object here and validate it's received in test code

handler.domainDLQHandler = mockDlqHandler
}

_, err := handler.ReadDLQMessages(context.Background(), td.input)
Copy link
Member

Choose a reason for hiding this comment

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

same here. missing validation of returned messages for success case

domainDLQHandler: dlqMock,
}

_, err := handler.CountDLQMessages(context.Background(), td.input)
Copy link
Member

Choose a reason for hiding this comment

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

same here

}
}

func Test_GetCrossClusterTasks(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

I think @davidporter-id-au will cleanup cross cluster related code but doesn't hurt to keep these new tests until that happens

@neil-xie neil-xie merged commit 66b4bb2 into cadence-workflow:master Jun 4, 2024
20 checks passed
@neil-xie neil-xie deleted the cdnc_8785_1 branch June 4, 2024 20:13
timl3136 pushed a commit to timl3136/cadence that referenced this pull request Jun 4, 2024
timl3136 pushed a commit to timl3136/cadence that referenced this pull request Jun 4, 2024
dkrotx pushed a commit to dkrotx/cadence that referenced this pull request Jun 5, 2024
timl3136 pushed a commit to timl3136/cadence that referenced this pull request Jun 6, 2024
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