Skip to content

Commit e7b75a5

Browse files
committed
test: Wire FDv1 Fallback Directive contract-test capability
The contract harness now treats the FDv1 Fallback Synchronizer as a distinct field on the data system (DataSystem.FDv1Fallback) rather than deriving it from the FDv2 synchronizer chain, and gates the directive subtests on a new fdv1-fallback capability. Wire the test service to match: - declare the fdv1-fallback capability - accept the new dataSystem.fdv1Fallback config field - build the FDv1 fallback synchronizer from that field directly, instead of inferring it from the last polling synchronizer Also bump the contract-tests pin from v3.0.0-alpha.4 to v3.0.0-alpha.6 so the harness ships the new directive subtests.
1 parent 2d2ea3c commit e7b75a5

3 files changed

Lines changed: 16 additions & 14 deletions

File tree

.github/actions/check/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ runs:
5151
test_service_port: 9000
5252
enable_persistence_tests: true
5353
token: ${{ inputs.token }}
54-
version: v3.0.0-alpha.4
54+
version: v3.0.0-alpha.6

contract-tests/client_entity.rb

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,14 @@ def initialize(log, config)
4242
if sync_configs && !sync_configs.empty?
4343
synchronizer_builders = sync_configs.map { |sync_config| build_synchronizer_builder(sync_config) }.compact
4444
data_system.synchronizers(synchronizer_builders) unless synchronizer_builders.empty?
45+
end
4546

46-
fallback_builder = build_fdv1_fallback_builder(sync_configs)
47-
data_system.fdv1_compatible_synchronizer(fallback_builder)
47+
# The FDv1 Fallback Synchronizer is wired directly from a top-level
48+
# dataSystem.fdv1Fallback config block -- the test harness no longer
49+
# infers it from the FDv2 synchronizer chain.
50+
fdv1_fallback_config = data_system_config[:fdv1Fallback]
51+
if fdv1_fallback_config
52+
data_system.fdv1_compatible_synchronizer(build_fdv1_fallback_builder(fdv1_fallback_config))
4853
end
4954

5055
if data_system_config[:payloadFilter]
@@ -342,21 +347,17 @@ def close
342347
end
343348

344349
#
345-
# Builds an FDv1 fallback polling data source builder using the first available polling config.
350+
# Builds an FDv1 fallback polling data source builder from the dedicated
351+
# `dataSystem.fdv1Fallback` config block. This block has the same shape as
352+
# a polling config (`baseUri`, `pollIntervalMs`).
346353
#
347-
# @param sync_configs [Array<Hash>] Array of synchronizer configurations
354+
# @param fdv1_fallback_config [Hash] The FDv1 fallback configuration
348355
# @return [Object] Returns the configured FDv1 fallback builder
349356
#
350-
private def build_fdv1_fallback_builder(sync_configs)
357+
private def build_fdv1_fallback_builder(fdv1_fallback_config)
351358
builder = LaunchDarkly::DataSystem.fdv1_fallback_ds_builder
352-
353-
# Use the first available polling config for the fallback base_uri
354-
polling_config = sync_configs.lazy.map { |c| c[:polling] }.detect { |p| p }
355-
if polling_config
356-
builder.base_uri(polling_config[:baseUri]) if polling_config[:baseUri]
357-
builder.poll_interval(polling_config[:pollIntervalMs] / 1_000.0) if polling_config[:pollIntervalMs]
358-
end
359-
359+
builder.base_uri(fdv1_fallback_config[:baseUri]) if fdv1_fallback_config[:baseUri]
360+
builder.poll_interval(fdv1_fallback_config[:pollIntervalMs] / 1_000.0) if fdv1_fallback_config[:pollIntervalMs]
360361
builder
361362
end
362363

contract-tests/service.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
'persistent-data-store-redis',
5454
'flag-change-listeners',
5555
'flag-value-change-listeners',
56+
'fdv1-fallback',
5657
],
5758
}.to_json
5859
end

0 commit comments

Comments
 (0)