uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.

Home Page:https://cadenceworkflow.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Testing of multiple heartbeat properties

saurabhagrawal-86 opened this issue · comments

If my activity stores multiple properties in the heartbeat, how do I test it? In the cadence client, the RecordHeartbeat and GetHeartbeatDetails are variadic functions, i.e. we can record multiple details in the heartbeat. However, the TestActivityEnvironment.SetHeartbeatDetails() accepts only a single argument. Is this intentional? As a workaround, I could model the properties in a "container" struct, but I would like to avoid it if possible.

yeah, that's an inconsistency we should address 🤔
that said, tbh I'd much prefer to get rid of all multi-value APIs like this. they're significantly harder to make changes to, because you can't safely modify the number of arguments. the container-struct is significantly better in that respect.