feat: mock typed search-attribute upsert in the testing framework - #784
Open
xepozz wants to merge 3 commits into
Open
feat: mock typed search-attribute upsert in the testing framework#784xepozz wants to merge 3 commits into
xepozz wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 15f34a7740
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ework (#654) Workflow::upsertTypedSearchAttributes() timed out under the time-skipping test-server because the Java test-server binary does not implement the UpsertWorkflowTypedSearchAttributes command. Add a testing-framework mock, mirroring the activity/child-workflow mockers (#778): - MockSearchAttributeInterceptor swallows the typed upsert command (so the test-server never sees it) and records each update into a cross-process RoadRunner KV cache; untyped upsert is left untouched. - SearchAttributeInvocationCache trio (interface + RoadRunner + InMemory) stores upserts as a single name->entry map. - SearchAttributeMocker exposes assertUpserted / assertUpsertedValue / assertUnset / assertNotUpserted / wasUpserted / getUpserted / getUpsertedAttributes, wired into WorkflowTestCase. - Fixture + functional (typed stub, full-set assertion) and unit tests.
xepozz
force-pushed
the
feature/mock-typed-search-attributes
branch
from
July 28, 2026 09:24
15f34a7 to
63a3991
Compare
wolfy-j
approved these changes
Jul 28, 2026
…functional bootstrap Launching RoadRunner via the relative './rr' executable and relative config/-w paths resolves against the process cwd, which caused intermittent 'sh: exec: ./rr: not found' failures in CI. Build absolute paths for the rr binary, -c, -w and configFile, matching the acceptance RRStarter.
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 was changed
Mock typed search-attribute upserts in the testing framework, mirroring the activity/child-workflow mockers (#778).
MockSearchAttributeInterceptor— swallows theUpsertWorkflowTypedSearchAttributescommand (the time-skipping test-server doesn't implement it) and records each update; untypedupsertSearchAttributesis left untouched.SearchAttributeInvocationCache(interface + RoadRunner KV + InMemory) — stores upserts as a singlename → entrymap, crossing the worker↔test-process boundary like the child/activity caches.SearchAttributeMocker($this->searchAttributeMocks) —assertUpserted/assertUpsertedValue/assertUnset/assertNotUpserted/wasUpserted/getUpserted/getUpsertedAttributes, wired intoWorkflowTestCase.Why?
Workflow::upsertTypedSearchAttributes()timed out under the time-skipping test-server because the Java test-server binary doesn't implement the typed-SA command (the untyped one is accepted). Typed search-attribute upserts are now assertable in tests instead of hanging the run.Checklist
Closes [Bug] upsertTypedSearchAttributes in test server #654
How was this tested:
New Unit + Functional suites, all green: interceptor swallow/record (raw datetime value, unset, and the collision-name
index+ numeric-name2024edge cases),SearchAttributeMockerassertions (strict value match), and a functional test that drives a typed workflow and asserts the full upserted set on the real RoadRunner cache.Yes — document search-attribute mocking (
$this->searchAttributeMocks) on the PHP testing-suite page at docs.temporal.io.