temporalio / sdk-go

Temporal Go SDK
https://docs.temporal.io/application-development?lang=go
MIT License
480 stars 197 forks source link

OnUpsertSearchAttributes and OnUpsertMemo unclear about mocking ability #1033

Open cretz opened 1 year ago

cretz commented 1 year ago

Expected Behavior

OnUpsertSearchAttributes and OnUpsertMemo are just called when their methods are called. They were not developed to return values or return errors unlike many of our other mocks. We need to either:

jPomeranz commented 3 months ago

Just curious, was an internal consensus reached on the optimal behavior for these calls going forward? I was wondering if this is something we could make a PR for to allow the mocks or whether it's still awaiting an internal decision.

Quinn-With-Two-Ns commented 3 weeks ago

We should document that OnUpsertSearchAttributes and OnUpsertMemo are just event listeners. Mocking these calls return value in the test environment doesn't make sense since the real environment and the test environment perform identical validation so mocking would just allow users to create discrepancies between a real workflow and one running in the test environment.