Sha256: cb558841a9ff32164f83bdc0d613b9d087141cfdd262ae5e98144e1b051982cf

Contents?: true

Size: 1019 Bytes

Versions: 16

Compression:

Stored size: 1019 Bytes

Contents

require "feature_store_spec_base"
require "diplomat"
require "spec_helper"


$my_prefix = 'testprefix'

$consul_base_opts = {
  prefix: $my_prefix,
  logger: $null_log
}

def create_consul_store(opts = {})
  LaunchDarkly::Integrations::Consul::new_feature_store(
    $consul_base_opts.merge(opts).merge({ expiration: 60 }))
end

def create_consul_store_uncached(opts = {})
  LaunchDarkly::Integrations::Consul::new_feature_store(
    $consul_base_opts.merge(opts).merge({ expiration: 0 }))
end

def clear_all_data
  Diplomat::Kv.delete($my_prefix + '/', recurse: true)
end


describe "Consul feature store" do
  break if ENV['LD_SKIP_DATABASE_TESTS'] == '1'
  
  # These tests will all fail if there isn't a local Consul instance running.
  
  context "with local cache" do
    include_examples "feature_store", method(:create_consul_store), method(:clear_all_data)
  end

  context "without local cache" do
    include_examples "feature_store", method(:create_consul_store_uncached), method(:clear_all_data)
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
launchdarkly-server-sdk-6.2.4 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-6.2.3 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-6.2.2 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-6.2.1 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-6.2.0 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-6.1.1 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-6.1.0 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-6.0.0 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-5.8.2 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-5.8.1 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-5.8.0 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-5.7.4 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-5.7.3 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-5.7.2 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-5.7.1 spec/integrations/consul_feature_store_spec.rb
launchdarkly-server-sdk-5.7.0 spec/integrations/consul_feature_store_spec.rb