summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-06-08 10:00:20 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-06-08 10:00:20 +0000
commit05e88a0d12b5ae79fcd5a7e26a5eb1bb259843ec (patch)
treee355e60f63f9cc4c0a5e54a7f5b4de3a7463303f /spec
parentacdd1bf7c92b7e9cdbd579df8faca5ea7783489f (diff)
parentff1bc1778d7fe40ac96d8515dc04195d56aced07 (diff)
downloadgitlab-ce-05e88a0d12b5ae79fcd5a7e26a5eb1bb259843ec.tar.gz
Merge branch 'zj-prom-pipeline-count' into 'master'
Add prometheus metrics on pipeline creation Closes #32624 See merge request !11975
Diffstat (limited to 'spec')
-rw-r--r--spec/services/ci/create_pipeline_service_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb
index e9c2b865b47..77c07b71c68 100644
--- a/spec/services/ci/create_pipeline_service_spec.rb
+++ b/spec/services/ci/create_pipeline_service_spec.rb
@@ -38,6 +38,14 @@ describe Ci::CreatePipelineService, :services do
expect(pipeline.builds.first).to be_kind_of(Ci::Build)
end
+ it 'increments the prometheus counter' do
+ expect(Gitlab::Metrics).to receive(:counter)
+ .with(:pipelines_created_count, "Pipelines created count")
+ .and_call_original
+
+ pipeline
+ end
+
context 'when merge requests already exist for this source branch' do
it 'updates head pipeline of each merge request' do
merge_request_1 = create(:merge_request, source_branch: 'master', target_branch: "branch_1", source_project: project)