diff --git a/.github/actions/contract-tests/action.yml b/.github/actions/contract-tests/action.yml index 35431398..9ccaad11 100644 --- a/.github/actions/contract-tests/action.yml +++ b/.github/actions/contract-tests/action.yml @@ -12,7 +12,7 @@ inputs: required: false default: '' run_fdv2_tests: - description: 'Whether to run contract tests from the feat/fdv2 branch' + description: 'Whether to run contract tests from the v3.0.0-alpha.3 tag' required: false default: 'false' @@ -64,7 +64,7 @@ runs: shell: bash run: dotnet ${{ inputs.service_dll_file }} > test-service.log 2>&1 & disown - - name: Clone and run contract tests from feat/fdv2 branch + - name: Clone and run contract tests from v3.0.0-alpha.3 tag if: inputs.run_fdv2_tests == 'true' shell: bash run: | @@ -72,7 +72,7 @@ runs: git clone https://github.com/launchdarkly/sdk-test-harness.git /tmp/sdk-test-harness cp $(dirname ./${{ inputs.service_project_file }})/test-supressions-fdv2.txt /tmp/sdk-test-harness/testharness-suppressions-fdv2.txt cd /tmp/sdk-test-harness - git checkout feat/fdv2 + git checkout v3.0.0-alpha.3 go build -o test-harness . ./test-harness -url http://localhost:8000 -debug -status-timeout=360 --skip-from=testharness-suppressions-fdv2.txt --stop-service-at-end env: diff --git a/pkgs/sdk/server/contract-tests/Representations.cs b/pkgs/sdk/server/contract-tests/Representations.cs index 43b3fdf6..5030b315 100644 --- a/pkgs/sdk/server/contract-tests/Representations.cs +++ b/pkgs/sdk/server/contract-tests/Representations.cs @@ -152,7 +152,7 @@ public class SdkConfigDataSystemParams public SdkConfigDataStoreParams Store { get; set; } public int? StoreMode { get; set; } public SdkConfigDataInitializerParams[] Initializers { get; set; } - public SdkConfigSynchronizersParams Synchronizers { get; set; } + public SdkConfigDataSynchronizerParams[] Synchronizers { get; set; } public string PayloadFilter { get; set; } } @@ -185,13 +185,7 @@ public class SdkConfigDataInitializerParams public SdkConfigPollingParams Polling { get; set; } } - public class SdkConfigSynchronizersParams - { - public SdkConfigSynchronizerParams Primary { get; set; } - public SdkConfigSynchronizerParams Secondary { get; set; } - } - - public class SdkConfigSynchronizerParams + public class SdkConfigDataSynchronizerParams { public SdkConfigStreamingParams Streaming { get; set; } public SdkConfigPollingParams Polling { get; set; } diff --git a/pkgs/sdk/server/contract-tests/SdkClientEntity.cs b/pkgs/sdk/server/contract-tests/SdkClientEntity.cs index 5c05d842..2b8631fe 100644 --- a/pkgs/sdk/server/contract-tests/SdkClientEntity.cs +++ b/pkgs/sdk/server/contract-tests/SdkClientEntity.cs @@ -487,27 +487,16 @@ private static Configuration BuildSdkConfig(SdkConfigParams sdkParams, ILogAdapt } // Configure synchronizers - if (sdkParams.DataSystem.Synchronizers != null) + if (sdkParams.DataSystem.Synchronizers != null && sdkParams.DataSystem.Synchronizers.Length > 0) { var synchronizers = new List>(); - // Primary synchronizer - if (sdkParams.DataSystem.Synchronizers.Primary != null) + foreach (var synchronizerParams in sdkParams.DataSystem.Synchronizers) { - var primary = CreateSynchronizer(sdkParams.DataSystem.Synchronizers.Primary, sdkParams.DataSystem.PayloadFilter); - if (primary != null) + var synchronizer = CreateSynchronizer(synchronizerParams, sdkParams.DataSystem.PayloadFilter); + if (synchronizer != null) { - synchronizers.Add(primary); - } - } - - // Secondary synchronizer (optional) - if (sdkParams.DataSystem.Synchronizers.Secondary != null) - { - var secondary = CreateSynchronizer(sdkParams.DataSystem.Synchronizers.Secondary, sdkParams.DataSystem.PayloadFilter); - if (secondary != null) - { - synchronizers.Add(secondary); + synchronizers.Add(synchronizer); } } @@ -517,23 +506,22 @@ private static Configuration BuildSdkConfig(SdkConfigParams sdkParams, ILogAdapt // Find the best synchronizer to use for FDv1 fallback configuration // Prefer polling synchronizers since FDv1 fallback is polling-based - SdkConfigSynchronizerParams synchronizerForFallback = null; + SdkConfigDataSynchronizerParams synchronizerForFallback = null; - // First, try to find a polling synchronizer (check secondary first, then primary) - if (sdkParams.DataSystem.Synchronizers.Secondary != null && - sdkParams.DataSystem.Synchronizers.Secondary.Polling != null) + // First, try to find a polling synchronizer + foreach (var syncParams in sdkParams.DataSystem.Synchronizers) { - synchronizerForFallback = sdkParams.DataSystem.Synchronizers.Secondary; - } - else if (sdkParams.DataSystem.Synchronizers.Primary != null && - sdkParams.DataSystem.Synchronizers.Primary.Polling != null) - { - synchronizerForFallback = sdkParams.DataSystem.Synchronizers.Primary; + if (syncParams.Polling != null) + { + synchronizerForFallback = syncParams; + break; + } } - // If no polling synchronizer found, use primary synchronizer (could be streaming) - else if (sdkParams.DataSystem.Synchronizers.Primary != null) + + // If no polling synchronizer found, use the first synchronizer (could be streaming) + if (synchronizerForFallback == null && sdkParams.DataSystem.Synchronizers.Length > 0) { - synchronizerForFallback = sdkParams.DataSystem.Synchronizers.Primary; + synchronizerForFallback = sdkParams.DataSystem.Synchronizers[0]; } if (synchronizerForFallback != null) @@ -563,7 +551,7 @@ private static Configuration BuildSdkConfig(SdkConfigParams sdkParams, ILogAdapt } private static IComponentConfigurer CreateSynchronizer( - SdkConfigSynchronizerParams synchronizer, + SdkConfigDataSynchronizerParams synchronizer, string payloadFilter) { if (synchronizer.Polling != null) @@ -608,7 +596,7 @@ private static IComponentConfigurer CreateSynchronizer( } private static IComponentConfigurer CreateFDv1FallbackSynchronizer( - SdkConfigSynchronizerParams synchronizer) + SdkConfigDataSynchronizerParams synchronizer) { // FDv1 fallback synchronizer is always polling-based var fdv1PollingBuilder = DataSystemComponents.FDv1Polling();