-
Notifications
You must be signed in to change notification settings - Fork 110
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
Refactor Test Environment and Worker initialization to CadenceTestRule #923
Conversation
@@ -2464,15 +2288,6 @@ public void mySignal(String value) { | |||
|
|||
@Test | |||
public void testSignal() { | |||
// Test getTrace through replay by a local worker. |
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.
This block is a no-op, it creates a new Worker and WorkerFactory but doesn't start it.
88cfa0a
to
af67e19
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted filessee 17 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Pull Request Test Coverage Report for Build 2539Details
💛 - Coveralls |
} else { | ||
wc = testEnvironment.newWorkflowClient(clientOptions); | ||
} | ||
WorkflowClient wc = cadenceTestRule.createWorkflowClient(clientOptions); |
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.
nit: maybe add client options to builder?
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.
Added, good call. This test still needs to create a custom client to test out its interceptor but that's a very useful thing to expose.
f988ba5
to
7a23c04
Compare
…flowTest. WorkflowTest is currently 6,000 lines long and has nearly every test related to end to end client behavior. It provides the rather neat behavior that it supports running against both an instance of Cadence running in Docker and against the test version. It's additionally parameterized to run the entire test suite with or without sticky execution enabled. Due to the complexity in handling both environments, adding yet another test to WorkflowTest has always been the easiest option for developers. To allow for tests to easily be split into other files, extract the core functionality to a Junit test rule that can easily be reused by additional tests. With the exception of testSignalCrossDomainExternalWorkflow and the replay tests that don't use the test environment, all tests have been left in WorkflowTest to be split out later.
7a23c04
to
54262a5
Compare
What changed?
WorkflowTest is additionally parameterized by whether or not to use sticky execution. I think there are obviously cases where that makes sense but I don't think we need to do that in every test going forward.
Why?
How did you test it?
Potential risks
Release notes
Documentation Changes