Skip to content

Conversation

tsurdilo
Copy link
Contributor

@tsurdilo tsurdilo commented Jan 12, 2022

Signed-off-by: Tihomir Surdilovic tihomir@temporal.io

exposes TestEnvironmentOptions#setUseTimeskipping to WorkflowRule and WorkflowExtension and allows to turn it off, for example:

  @Rule
  public TestWorkflowRule testWorkflowRule =
        TestWorkflowRule.newBuilder()
            .setWorkflowTypes(GreetingWorkflowImpl.class)
            .setDoNotStart(true)
            .setUseTimeskipping(false)
            .build();

and

  @RegisterExtension
    public static final TestWorkflowExtension testWorkflow =
        TestWorkflowExtension.newBuilder()
            .setWorkflowTypes(HelloWorkflowImpl.class)
            .setActivityImplementations(new HelloActivityImpl())
            .setUseTimeskipping(false)
            .build();

@tsurdilo tsurdilo changed the title Expose setting time skipping for WorkflowRule and WorkflowExtension Expose turning off time skipping for WorkflowRule and WorkflowExtension Jan 12, 2022
@cretz
Copy link
Member

cretz commented Jan 12, 2022

Hrmm, we don't allow disabling of time-skipping on the Go test env that I know of. Can you elaborate on the use case so I can see if we need to do the same there?

@Spikhalskiy
Copy link
Contributor

@cretz We already allowed it on the TestWorkflowEnvironemnt, this PR just wires it handier for tests authors.
Use cases:

  1. Respect WorkflowClientInterceptors in newUntypedWorkflowStub(WorkflowExecution, ...) #813 (comment)
  2. https://temporalio.slack.com/archives/CTRCR8RBP/p1641845373104000

@tsurdilo tsurdilo force-pushed the setuptimeskippingrule branch from 7170734 to c1cabc9 Compare January 12, 2022 17:50
@tsurdilo
Copy link
Contributor Author

@Spikhalskiy updated. thanks for all your help!

Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
@tsurdilo tsurdilo force-pushed the setuptimeskippingrule branch from c1cabc9 to 8490ca5 Compare January 12, 2022 19:27
@Spikhalskiy Spikhalskiy merged commit f0ebbe7 into temporalio:master Jan 12, 2022
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