uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.
https://cadenceworkflow.io
MIT License
349 stars 132 forks source link

Testsuite: Support interceptors in child workflows mocks #1039

Closed seriousben closed 3 years ago

seriousben commented 3 years ago

What changed? Adding the missing interceptors in the workflow context sent to child workflow mocks.

Why? To support calling workflow.GetInfo(ctx) within mocks without a panic.

This is a regression introduced in 0.12.2 as part of adding interceptor support.

How did you test it?

Unit test failure before the fix:

panic: getWorkflowInterceptor: Not a workflow context

goroutine 47 [running]:
go.uber.org/cadence/internal.getWorkflowInterceptor(...)
    cadence-client/internal/internal_workflow.go:288
go.uber.org/cadence/internal.GetWorkflowInfo(0x1aec9c0, 0xc0004fe000, 0xc0004fe000)
    cadence-client/internal/workflow.go:756 +0xce
go.uber.org/cadence/internal.(*WorkflowTestSuiteUnitTest).Test_ChildWorkflow_Mock.func2(0xc00007ed80, 0x3, 0x4)
    cadence-client/internal/internal_workflow_testsuite_test.go:728 +0x7d

Potential risks No risk since only changing the testsuite.

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 4bbb5de7-00c2-420d-8d5d-10d33ababfb2


Totals Coverage Status
Change from base Build a491e373-0128-45c3-aa5f-a91cb5150fe3: 0.02%
Covered Lines: 9593
Relevant Lines: 12833

💛 - Coveralls