Commit 5b308b5
feat: Update contract tests to support multiple synchronizers and initializers (#222)
**Requirements**
- [ ] I have added test coverage for new or changed functionality
- [ ] I have followed the repository's [pull request submission
guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
- [ ] I have validated my changes against all supported platform
versions
**Related issues**
Related to sdk-test-harness commit:
launchdarkly/sdk-test-harness@01a245c
**Describe the solution you've provided**
Updates the contract test implementation to match the sdk-test-harness
changes that add support for multiple synchronizers (more than 2) for
testing fallback scenarios.
Contract test model changes:
- Changed `SdkConfigDataSystemParams.Synchronizers` from
`SdkConfigSynchronizersParams` (with `Primary`/`Secondary` properties)
to `SdkConfigDataSynchronizerParams[]` (array)
- Removed the `SdkConfigSynchronizersParams` class
- Renamed `SdkConfigSynchronizerParams` to
`SdkConfigDataSynchronizerParams` for consistency
- Updated `SdkClientEntity.BuildSdkConfig` to iterate over the
synchronizers array
CI config change:
- Pinned FDv2 contract tests to use the `v3.0.0-alpha.3` tag of
sdk-test-harness instead of the `feat/fdv2` branch
**Human review checklist**
- [ ] Verify `v3.0.0-alpha.3` tag exists in sdk-test-harness and is
compatible with the array-based synchronizer format used here
- [ ] Verify the FDv1 fallback synchronizer selection logic is correct —
it now picks the first polling synchronizer found in the array, or falls
back to the first synchronizer if none have polling configured
- [ ] Confirm the JSON serialization matches what the test harness sends
(property names are auto-camelCased)
**Describe alternatives you've considered**
Could have kept backward compatibility by supporting both the old
Primary/Secondary structure and the new array format, but this would add
unnecessary complexity since the test harness has moved to the
array-based approach.
**Additional context**
- Link to Devin run:
https://app.devin.ai/sessions/5d71cc37cb45475088773207ef7fd987
- Requested by: rlamb@launchdarkly.com
This is a contract test and CI config change only — no changes to the
SDK itself.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Moderate risk due to a breaking change in the contract-test config
model (`Synchronizers` shape) and updated fallback-selection behavior
that could alter FDv2/FDv1 test execution, though it is confined to
test/CI code.
>
> **Overview**
> Updates the contract test data-system configuration model to support
**multiple** synchronizers by changing
`SdkConfigDataSystemParams.Synchronizers` from a `Primary`/`Secondary`
object to an array of `SdkConfigDataSynchronizerParams` (and
removing/renaming the old types).
>
> Adjusts `SdkClientEntity.BuildSdkConfig` to build all provided
synchronizers, and changes FDv1 fallback selection to pick the *first
polling* synchronizer found (otherwise the first synchronizer). CI’s
FDv2 contract test action is also updated to run `sdk-test-harness` from
the pinned `v3.0.0-alpha.3` tag instead of the `feat/fdv2` branch.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
349d410. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: rlamb@launchdarkly.com <rlamb@launchdarkly.com>1 parent aa4616d commit 5b308b5
File tree
3 files changed
+24
-42
lines changed- .github/actions/contract-tests
- pkgs/sdk/server/contract-tests
3 files changed
+24
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 188 | + | |
195 | 189 | | |
196 | 190 | | |
197 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
| 490 | + | |
491 | 491 | | |
492 | 492 | | |
493 | 493 | | |
494 | | - | |
495 | | - | |
| 494 | + | |
496 | 495 | | |
497 | | - | |
498 | | - | |
| 496 | + | |
| 497 | + | |
499 | 498 | | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
| 499 | + | |
511 | 500 | | |
512 | 501 | | |
513 | 502 | | |
| |||
517 | 506 | | |
518 | 507 | | |
519 | 508 | | |
520 | | - | |
| 509 | + | |
521 | 510 | | |
522 | | - | |
523 | | - | |
524 | | - | |
| 511 | + | |
| 512 | + | |
525 | 513 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
532 | 519 | | |
533 | | - | |
534 | | - | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
535 | 523 | | |
536 | | - | |
| 524 | + | |
537 | 525 | | |
538 | 526 | | |
539 | 527 | | |
| |||
563 | 551 | | |
564 | 552 | | |
565 | 553 | | |
566 | | - | |
| 554 | + | |
567 | 555 | | |
568 | 556 | | |
569 | 557 | | |
| |||
608 | 596 | | |
609 | 597 | | |
610 | 598 | | |
611 | | - | |
| 599 | + | |
612 | 600 | | |
613 | 601 | | |
614 | 602 | | |
| |||
0 commit comments