-
Notifications
You must be signed in to change notification settings - Fork 805
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
History engine start/stop unit tests #5985
History engine start/stop unit tests #5985
Conversation
type EngineForTest struct { | ||
Engine engine.Engine | ||
Cleanup func() | ||
// Add mocks or other fields here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Planning to attach mock objects created inline inside NewEngineForTest
function here so different unit test scenarios can adjust the behavior/expectations
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
... and 8 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Pull Request Test Coverage Report for Build 018f59b5-6531-41ed-9764-e612b3e75900Details
💛 - Coveralls |
|
||
//go:generate mockgen -package $GOPACKAGE -source $GOFILE -destination factory_mock.go -self_package github.com/uber/cadence/service/history/queue | ||
|
||
type ProcessorFactory interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tbh it feels a little odd that these are bundled together. is there any reason other than convenience, since all three are used by the same caller(s?)?
but I don't have much context for the full refactor-and-test planned here, possibly I'm just missing something obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't made my mind how the final objects/interfaces will look like after refactoring but I am also considering the option where there's just single "Queue" object that history interacts with. Based on the task type, domain and other attributes that top level object decides where to route the request.
66b5931
to
a640d04
Compare
What changed?
It is now possible to write small scoped unit tests for history engine after it got splitted into small files in #5972.
This PR adds a basic Start/Stop test.
Changes:
Why?
Improve coverage and make code testable.
How did you test it?
Unit tests