summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-22 18:08:56 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-22 18:08:56 +0000
commitc25c2a508b3322278c6528685c2af703b29ba170 (patch)
treefe7aba0d3633225baa308cb647c9cc7b4b455e3a /spec/services
parent632d0734750382e7c4e5f1b3c526a94acf6e7ce2 (diff)
downloadgitlab-ce-c25c2a508b3322278c6528685c2af703b29ba170.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/web_hooks/log_execution_service_spec.rb61
1 files changed, 0 insertions, 61 deletions
diff --git a/spec/services/web_hooks/log_execution_service_spec.rb b/spec/services/web_hooks/log_execution_service_spec.rb
index 873f6adc8dc..1967a8368fb 100644
--- a/spec/services/web_hooks/log_execution_service_spec.rb
+++ b/spec/services/web_hooks/log_execution_service_spec.rb
@@ -101,27 +101,6 @@ RSpec.describe WebHooks::LogExecutionService do
it 'resets the failure count' do
expect { service.execute }.to change(project_hook, :recent_failures).to(0)
end
-
- it 'sends a message to AuthLogger if the hook as not previously enabled' do
- project_hook.update!(recent_failures: ::WebHook::FAILURE_THRESHOLD + 1)
-
- expect(Gitlab::AuthLogger).to receive(:info).with include(
- message: 'WebHook change active_state',
- # identification
- hook_id: project_hook.id,
- hook_type: project_hook.type,
- project_id: project_hook.project_id,
- group_id: nil,
- # relevant data
- prev_state: :permanently_disabled,
- new_state: :enabled,
- duration: 1.2,
- response_status: '200',
- recent_hook_failures: 0
- )
-
- service.execute
- end
end
end
@@ -158,27 +137,6 @@ RSpec.describe WebHooks::LogExecutionService do
expect { service.execute }.not_to change(project_hook, :recent_failures)
end
end
-
- it 'sends a message to AuthLogger if the state would change' do
- project_hook.update!(recent_failures: ::WebHook::FAILURE_THRESHOLD)
-
- expect(Gitlab::AuthLogger).to receive(:info).with include(
- message: 'WebHook change active_state',
- # identification
- hook_id: project_hook.id,
- hook_type: project_hook.type,
- project_id: project_hook.project_id,
- group_id: nil,
- # relevant data
- prev_state: :enabled,
- new_state: :permanently_disabled,
- duration: (be > 0),
- response_status: data[:response_status],
- recent_hook_failures: ::WebHook::FAILURE_THRESHOLD + 1
- )
-
- service.execute
- end
end
context 'when response_category is :error' do
@@ -200,25 +158,6 @@ RSpec.describe WebHooks::LogExecutionService do
expect { service.execute }.to change(project_hook, :backoff_count).by(1)
end
- it 'sends a message to AuthLogger if the state would change' do
- expect(Gitlab::AuthLogger).to receive(:info).with include(
- message: 'WebHook change active_state',
- # identification
- hook_id: project_hook.id,
- hook_type: project_hook.type,
- project_id: project_hook.project_id,
- group_id: nil,
- # relevant data
- prev_state: :enabled,
- new_state: :temporarily_disabled,
- duration: (be > 0),
- response_status: data[:response_status],
- recent_hook_failures: 0
- )
-
- service.execute
- end
-
context 'when the previous cool-off was near the maximum' do
before do
project_hook.update!(disabled_until: 5.minutes.ago, backoff_count: 8)