Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion contract-tests/client_entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ def initialize(log, config)

opts[:logger] = log

# A per-component baseUri set below takes precedence over these.
service_endpoints = config[:serviceEndpoints]
if service_endpoints
opts[:stream_uri] = service_endpoints[:streaming] if service_endpoints[:streaming]
opts[:base_uri] = service_endpoints[:polling] if service_endpoints[:polling]
opts[:events_uri] = service_endpoints[:events] if service_endpoints[:events]
end

data_system_config = config[:dataSystem]
if data_system_config
data_system = LaunchDarkly::DataSystem.custom
Expand Down Expand Up @@ -68,7 +76,8 @@ def initialize(log, config)
opts[:base_uri] = polling[:baseUri] unless polling[:baseUri].nil?
opts[:payload_filter_key] = polling[:filter] unless polling[:filter].nil?
set_optional_time_prop(polling, :pollIntervalMs, opts, :poll_interval)
else
elsif config.dig(:serviceEndpoints, :streaming).nil?
# With no data source block and no streaming endpoint, read only from the persistent store.
opts[:use_ldd] = true
end

Expand Down Expand Up @@ -111,6 +120,13 @@ def initialize(log, config)
}
end

if config[:wrapper]
# The harness sends an empty string for an unset name or version.
wrapper = config[:wrapper]
opts[:wrapper_name] = wrapper[:name] unless wrapper[:name].to_s.empty?
opts[:wrapper_version] = wrapper[:version] unless wrapper[:version].to_s.empty?
end

if config[:hooks]
opts[:hooks] = config[:hooks][:hooks].map do |hook|
Hook.new(hook[:name], hook[:callbackUri], hook[:data] || {}, hook[:errors] || {})
Expand Down
3 changes: 3 additions & 0 deletions contract-tests/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
'fdv1-fallback',
'retry-conformance-fdv1-streaming',
'retry-conformance-fdv1-polling',
'wrapper',
'service-endpoints',
'tls:verify-peer',
],
}.to_json
end
Expand Down
Loading