diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 19:05:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-17 19:05:49 +0300 |
commit | 43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch) | |
tree | dceebdc68925362117480a5d672bcff122fb625b /spec/requests/api/sidekiq_metrics_spec.rb | |
parent | 20c84b99005abd1c82101dfeff264ac50d2df211 (diff) |
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc42
Diffstat (limited to 'spec/requests/api/sidekiq_metrics_spec.rb')
-rw-r--r-- | spec/requests/api/sidekiq_metrics_spec.rb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/spec/requests/api/sidekiq_metrics_spec.rb b/spec/requests/api/sidekiq_metrics_spec.rb index 1085df97cc7..1ac065f0c0c 100644 --- a/spec/requests/api/sidekiq_metrics_spec.rb +++ b/spec/requests/api/sidekiq_metrics_spec.rb @@ -2,12 +2,19 @@ require 'spec_helper' -RSpec.describe API::SidekiqMetrics, feature_category: :not_owned do +RSpec.describe API::SidekiqMetrics, :aggregate_failures, feature_category: :shared do let(:admin) { create(:user, :admin) } describe 'GET sidekiq/*' do + %w[/sidekiq/queue_metrics /sidekiq/process_metrics /sidekiq/job_stats + /sidekiq/compound_metrics].each do |path| + it_behaves_like 'GET request permissions for admin mode' do + let(:path) { path } + end + end + it 'defines the `queue_metrics` endpoint' do - get api('/sidekiq/queue_metrics', admin) + get api('/sidekiq/queue_metrics', admin, admin_mode: true) expect(response).to have_gitlab_http_status(:ok) expect(json_response).to match a_hash_including( @@ -25,14 +32,14 @@ RSpec.describe API::SidekiqMetrics, feature_category: :not_owned do end it 'defines the `process_metrics` endpoint' do - get api('/sidekiq/process_metrics', admin) + get api('/sidekiq/process_metrics', admin, admin_mode: true) expect(response).to have_gitlab_http_status(:ok) expect(json_response['processes']).to be_an Array end it 'defines the `job_stats` endpoint' do - get api('/sidekiq/job_stats', admin) + get api('/sidekiq/job_stats', admin, admin_mode: true) expect(response).to have_gitlab_http_status(:ok) expect(json_response).to be_a Hash @@ -43,7 +50,7 @@ RSpec.describe API::SidekiqMetrics, feature_category: :not_owned do end it 'defines the `compound_metrics` endpoint' do - get api('/sidekiq/compound_metrics', admin) + get api('/sidekiq/compound_metrics', admin, admin_mode: true) expect(response).to have_gitlab_http_status(:ok) expect(json_response).to be_a Hash |