Repository navigation
fix(testing): accept detail_hints in ActivityEnvironment heartbeat - #626
Merged
chris-olszewski merged 1 commit intoOct 19, 2026
Merged
chris-olszewski merged 1 commit into
chris-olszewski merged 1 commit into
Conversation
chris-olszewski
approved these changes
Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Temporalio::Testing::ActivityEnvironmentnow accepts thedetail_hints:keyword onActivity::Context#heartbeat, matching the signature of the baseActivity::Contextand the worker's context. The hints are ignored, because the test environment passes heartbeat details toon_heartbeatwithout converting them.Why
The test context defined
heartbeat(*details)with no keyword parameters. Ruby converts the keyword argument to a positional Hash in that case, so an activity that callsheartbeat('progress', detail_hints: [hint])gets['progress', {detail_hints: [hint]}]in itson_heartbeatcallback. The worker records only['progress'], so the test sees different details than production does.Validation
test_heartbeatingintest/testing/activity_environment_test.rbwith a heartbeat that passesdetail_hints:.test_heartbeatingandtest_heartbeating_in_fiberfail: expected["with-hints"], got["with-hints", {detail_hints: [:some_hint]}].bundle exec ruby -Ilib -Itest test/testing/activity_environment_test.rbreports 10 runs, 0 failures, 1 skip (the existing skip).bundle exec rubocopon the changed Ruby files andbundle exec steep check lib/temporalio/testing/activity_environment.rbpass.changelog/fixed/.