summaryrefslogtreecommitdiff
path: root/spec/services/ci/create_pipeline_service_spec.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-07-20 20:36:43 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-07-20 20:36:43 +0800
commit43aa8866bc40ed6efddfdf7678825da2b5c86613 (patch)
tree552f79e694f1eae9964173de0b34717cf4af8afd /spec/services/ci/create_pipeline_service_spec.rb
parente9862a9900c6269a41b65ca543035e57b49fede3 (diff)
parent542b675cf60bb8208306d2c0cae138f4ccc47972 (diff)
downloadgitlab-ce-43aa8866bc40ed6efddfdf7678825da2b5c86613.tar.gz
Merge remote-tracking branch 'upstream/master' into 30634-protected-pipeline
* upstream/master: (130 commits) Change auto-retry count to a correct value in docs Fix background migration cleanup specs Fix CI/CD job auto-retry specs Fix JS; make buttons sr accessibile; fix overlay remove redundant changelog entries Merge branch '24570-use-re2-for-user-supplied-regexp-9-3' into 'security-9-3' Merge branch '33303-404-for-unauthorized-project' into 'security-9-3' Merge branch '33359-pers-snippet-files-location' into 'security-9-3' Merge branch 'bvl-remove-appearance-symlink' into 'security-9-3' Hide description about protected branches to non-member Update CHANGELOG.md for 9.0.11 Update CHANGELOG.md for 9.1.8 Update CHANGELOG.md for 8.17.7 Update CHANGELOG.md for 9.2.8 Update CHANGELOG.md for 9.3.8 Respect blockquote line breaks in markdown 35209 Add wip message to new navigation preference section Add github imported projects count to usage data Add versions to Prometheus metrics doc Add Bulgarian translations of Pipeline Schedules ...
Diffstat (limited to 'spec/services/ci/create_pipeline_service_spec.rb')
-rw-r--r--spec/services/ci/create_pipeline_service_spec.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb
index 66218772084..146d25daba3 100644
--- a/spec/services/ci/create_pipeline_service_spec.rb
+++ b/spec/services/ci/create_pipeline_service_spec.rb
@@ -47,7 +47,7 @@ describe Ci::CreatePipelineService, :services do
it 'increments the prometheus counter' do
expect(Gitlab::Metrics).to receive(:counter)
- .with(:pipelines_created_count, "Pipelines created count")
+ .with(:pipelines_created_total, "Counter of pipelines created")
.and_call_original
pipeline
@@ -328,6 +328,20 @@ describe Ci::CreatePipelineService, :services do
end
end
+ context 'when builds with auto-retries are configured' do
+ before do
+ config = YAML.dump(rspec: { script: 'rspec', retry: 2 })
+ stub_ci_pipeline_yaml_file(config)
+ end
+
+ it 'correctly creates builds with auto-retry value configured' do
+ pipeline = execute_service
+
+ expect(pipeline).to be_persisted
+ expect(pipeline.builds.find_by(name: 'rspec').retries_max).to eq 2
+ end
+ end
+
shared_examples 'when ref is protected' do
let(:user) { create(:user) }