diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-02 21:07:23 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-02 21:07:23 +0300 |
commit | af833d9730dd367984b55ef02ccc3fe6eb83f0e4 (patch) | |
tree | f525dae9e43b8cb77d8eaad38f998ad06b8a769d /spec/requests/api | |
parent | 20ddcb963c756f5c7df26046adb01a8e325a26cd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api')
-rw-r--r-- | spec/requests/api/ci/jobs_spec.rb | 4 | ||||
-rw-r--r-- | spec/requests/api/internal/kubernetes_spec.rb | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/spec/requests/api/ci/jobs_spec.rb b/spec/requests/api/ci/jobs_spec.rb index c1b7461f444..fcf3ab201fb 100644 --- a/spec/requests/api/ci/jobs_spec.rb +++ b/spec/requests/api/ci/jobs_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe API::Ci::Jobs do +RSpec.describe API::Ci::Jobs, feature_category: :continuous_integration do include HttpBasicAuthHelpers include DependencyProxyHelpers @@ -325,7 +325,7 @@ RSpec.describe API::Ci::Jobs do context 'authorized user' do it 'returns project jobs' do expect(response).to have_gitlab_http_status(:ok) - expect(response).to include_pagination_headers + expect(response).to include_limited_pagination_headers expect(json_response).to be_an Array end diff --git a/spec/requests/api/internal/kubernetes_spec.rb b/spec/requests/api/internal/kubernetes_spec.rb index 3c6604cf409..f8fd81953b2 100644 --- a/spec/requests/api/internal/kubernetes_spec.rb +++ b/spec/requests/api/internal/kubernetes_spec.rb @@ -103,15 +103,19 @@ RSpec.describe API::Internal::Kubernetes do expect(response).to have_gitlab_http_status(:bad_request) end - it 'tracks events' do + it 'tracks events and unique events', :aggregate_failures do + request_count = 2 counters = { gitops_sync: 10, k8s_api_proxy_request: 5 } - unique_counters = { agent_users_using_ci_tunnel: [10] } + unique_counters = { agent_users_using_ci_tunnel: [10, 999, 777, 10] } expected_counters = { - kubernetes_agent_gitops_sync: counters[:gitops_sync], - kubernetes_agent_k8s_api_proxy_request: counters[:k8s_api_proxy_request] + kubernetes_agent_gitops_sync: request_count * counters[:gitops_sync], + kubernetes_agent_k8s_api_proxy_request: request_count * counters[:k8s_api_proxy_request] } + expected_hll_count = unique_counters[:agent_users_using_ci_tunnel].uniq.count - send_request(params: { counters: counters, unique_counters: unique_counters }) + request_count.times do + send_request(params: { counters: counters, unique_counters: unique_counters }) + end expect(Gitlab::UsageDataCounters::KubernetesAgentCounter.totals).to eq(expected_counters) @@ -121,7 +125,7 @@ RSpec.describe API::Internal::Kubernetes do event_names: 'agent_users_using_ci_tunnel', start_date: Date.current, end_date: Date.current + 10 ) - ).to eq(1) + ).to eq(expected_hll_count) end end end |