diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-11 13:22:01 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-11 13:22:16 +0000 |
commit | 01496e9337972f1ea0256bcd1e12996edb883e54 (patch) | |
tree | eed61c95985d0afaedf97c9c661018d5cc60d545 /spec | |
parent | 8db23545d53ecbd4ea6438f59ab12513d873bf18 (diff) | |
download | gitlab-ce-01496e9337972f1ea0256bcd1e12996edb883e54.tar.gz |
Add latest changes from gitlab-org/gitlab@15-7-stable-ee
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/memory/watchdog_spec.rb | 10 | ||||
-rw-r--r-- | spec/requests/api/container_registry_event_spec.rb | 13 |
2 files changed, 7 insertions, 16 deletions
diff --git a/spec/lib/gitlab/memory/watchdog_spec.rb b/spec/lib/gitlab/memory/watchdog_spec.rb index 668ea36d420..1603dda0c39 100644 --- a/spec/lib/gitlab/memory/watchdog_spec.rb +++ b/spec/lib/gitlab/memory/watchdog_spec.rb @@ -104,16 +104,6 @@ RSpec.describe Gitlab::Memory::Watchdog, :aggregate_failures, feature_category: watchdog.call end - context 'when gitlab_memory_watchdog ops toggle is off' do - before do - stub_feature_flags(gitlab_memory_watchdog: false) - end - - it 'does not trigger any monitor' do - expect(configuration).not_to receive(:monitors) - end - end - context 'when process does not exceed threshold' do it 'does not report violations event' do expect(reporter).not_to receive(:threshold_violated) diff --git a/spec/requests/api/container_registry_event_spec.rb b/spec/requests/api/container_registry_event_spec.rb index 32c4b0e9598..64c17bc2eef 100644 --- a/spec/requests/api/container_registry_event_spec.rb +++ b/spec/requests/api/container_registry_event_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' RSpec.describe API::ContainerRegistryEvent, feature_category: :container_registry do let(:secret_token) { 'secret_token' } - let(:events) { [{ action: 'push' }] } + let(:events) { [{ action: 'push' }, { action: 'pull' }] } let(:registry_headers) { { 'Content-Type' => ::API::ContainerRegistryEvent::DOCKER_DISTRIBUTION_EVENTS_V1_JSON } } describe 'POST /container_registry_event/events' do @@ -19,14 +19,15 @@ RSpec.describe API::ContainerRegistryEvent, feature_category: :container_registr end it 'returns 200 status and events are passed to event handler' do - event = spy(:event) - allow(::ContainerRegistry::Event).to receive(:new).and_return(event) - expect(event).to receive(:supported?).and_return(true) + allow_next_instance_of(::ContainerRegistry::Event) do |event| + if event.supported? + expect(event).to receive(:handle!).once + expect(event).to receive(:track!).once + end + end post_events - expect(event).to have_received(:handle!).once - expect(event).to have_received(:track!).once expect(response).to have_gitlab_http_status(:ok) end |