test: use a valid context instead of legacy user format in relay tests#727
Merged
Merged
Conversation
… helper
The assertSDKEndpointsAvailability helper used the legacy LDUser shape
({"key":"userkey"}, no kind) for the streaming mobile /meval and JS
/eval endpoints. Replace simpleUserJSON and simpleUserBase64 with a valid
evaluation context ({"key":"userkey","kind":"user"}). The helper
only asserts HTTP status codes, so the 200/401/404 expectations are
unchanged.
2b4066a to
a652847
Compare
SimpleUserJSON used the legacy LDUser shape ({"key":"userkey"}, no kind),
which the SDK only still accepts via its backward-compat path. Update it to a
valid single-kind context ({"key":"userkey","kind":"user"}) to match the
format that has been canonical since contexts shipped in 7.0.0. All consumers
encode it for streaming/eval endpoints that don't assert on its literal value,
so behavior is unchanged.
02d626b to
72676fd
Compare
keelerm84
approved these changes
Jun 30, 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.
Summary
Updates two relay test fixtures that still modeled the eval context they send to the SDK endpoints as a legacy
LDUser({"key":"userkey"}, nokind) to use a valid single-kind evaluation context ({"key":"userkey","kind":"user"}):relay/testutils_test.go—simpleUserJSON/simpleUserBase64in theassertSDKEndpointsAvailabilityhelper, which feeds the mobile/meval/<base64>and JS/eval/<envID>/<base64>streaming endpoints (plus the REPORT variants) for many relay endpoint tests.internal/sharedtest/endpoints.go— the sharedSimpleUserJSONconstant, consumed by the stream/eval request builders inrelay/relay_environments_test.goandrelay/relay_end_to_end_test.go.Background
Evaluation contexts (the
kindfield) have been the canonical format since contexts shipped in 7.0.0 (2022-12-07) and are fully present in production v8. The bare no-kinduser shape is the legacy form, accepted today only via the SDK's backward-compatibility path inldcontext.UnmarshalJSON. These fixtures only need the payload to parse — none assert on its literal value or on evaluation results, andassertSDKEndpointsAvailabilitychecks only HTTP status codes — so behavior is unchanged.go test ./relay/...andgolangci-lint run ./internal/sharedtest/... ./relay/...pass.