summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-08-17 00:42:23 -0700
committerStan Hu <stanhu@gmail.com>2019-08-17 06:23:26 -0700
commitb46b9d5e89d54cf1e374a014f0d523735c82ab8c (patch)
treea0b9cf862aa38839b4f1b4d5a8828b3d9078efe4 /spec/services
parent1068483f7260e5866c7d54f1f09b716dbf463c80 (diff)
downloadgitlab-ce-b46b9d5e89d54cf1e374a014f0d523735c82ab8c.tar.gz
Fix pipelines not always being created after a pushsh-fix-pipelines-not-being-created
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/31741 introduced a regression where not all the right parameters would be passed into `Ci::CreatePipelineService`. We fix this by breaking out the pipeline parameters and reusing a method from `Gitlab::DataBuilder::Push`. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66196
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/git/branch_push_service_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/services/git/branch_push_service_spec.rb b/spec/services/git/branch_push_service_spec.rb
index ad5d296f5c1..d9e607cd251 100644
--- a/spec/services/git/branch_push_service_spec.rb
+++ b/spec/services/git/branch_push_service_spec.rb
@@ -76,6 +76,22 @@ describe Git::BranchPushService, services: true do
stub_ci_pipeline_to_return_yaml_file
end
+ it 'creates a pipeline with the right parameters' do
+ expect(Ci::CreatePipelineService)
+ .to receive(:new)
+ .with(project,
+ user,
+ {
+ before: oldrev,
+ after: newrev,
+ ref: ref,
+ checkout_sha: SeedRepo::Commit::ID,
+ push_options: {}
+ }).and_call_original
+
+ subject
+ end
+
it "creates a new pipeline" do
expect { subject }.to change { Ci::Pipeline.count }