diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 846ee44a..c23038f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,11 @@ name: Run CI on: push: - branches: [ main ] + branches: [ main, 'feat/**' ] paths-ignore: - '**.md' # Do not need to run CI for markdown changes. pull_request: - branches: [ main ] + branches: [ main, 'feat/**' ] paths-ignore: - '**.md' diff --git a/contract-tests/client_entity.rb b/contract-tests/client_entity.rb index dc932691..faab8c9d 100644 --- a/contract-tests/client_entity.rb +++ b/contract-tests/client_entity.rb @@ -65,7 +65,7 @@ def initialize(log, config) if config[:hooks] opts[:hooks] = config[:hooks][:hooks].map do |hook| - Hook.new(hook[:name], hook[:callbackUri], hook[:data] || {}) + Hook.new(hook[:name], hook[:callbackUri], hook[:data] || {}, hook[:errors] || {}) end end diff --git a/contract-tests/hook.rb b/contract-tests/hook.rb index 89690ce9..0c9eb221 100644 --- a/contract-tests/hook.rb +++ b/contract-tests/hook.rb @@ -7,11 +7,13 @@ class Hook # @param name [String] # @param callback_uri [String] # @param data [Hash] + # @parm errors [Hash] # - def initialize(name, callback_uri, data) + def initialize(name, callback_uri, data, errors) @metadata = LaunchDarkly::Interfaces::Hooks::Metadata.new(name) @callback_uri = callback_uri @data = data + @errors = errors @context_filter = LaunchDarkly::Impl::ContextFilter.new(false, []) end @@ -24,6 +26,8 @@ def metadata # @param data [Hash] # def before_evaluation(evaluation_series_context, data) + raise @errors[:beforeEvaluation] if @errors.include? :beforeEvaluation + payload = { evaluationSeriesContext: { flagKey: evaluation_series_context.key, @@ -46,6 +50,8 @@ def before_evaluation(evaluation_series_context, data) # @param detail [LaunchDarkly::EvaluationDetail] # def after_evaluation(evaluation_series_context, data, detail) + raise @errors[:afterEvaluation] if @errors.include? :afterEvaluation + payload = { evaluationSeriesContext: { flagKey: evaluation_series_context.key,