Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2b6461bf
Commit
2b6461bf
authored
May 03, 2019
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a spec for dupcalite merge request pipeline creation case
This is EE related change
parent
b5cb6123
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
+41
-0
No files found.
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
View file @
2b6461bf
...
@@ -182,5 +182,46 @@ describe MergeRequests::RefreshService do
...
@@ -182,5 +182,46 @@ describe MergeRequests::RefreshService do
end
end
end
end
end
end
describe
'Pipelines for merge requests'
do
let
(
:service
)
{
described_class
.
new
(
project
,
current_user
)
}
let
(
:current_user
)
{
merge_request
.
author
}
let
(
:config
)
do
{
test:
{
stage:
'test'
,
script:
'echo'
,
only:
[
'merge_requests'
]
}
}
end
before
do
project
.
add_developer
(
current_user
)
project
.
update
(
merge_pipelines_enabled:
true
)
stub_licensed_features
(
merge_pipelines:
true
)
stub_ci_pipeline_yaml_file
(
YAML
.
dump
(
config
))
end
it
'creates a merge request pipeline'
do
expect
{
subject
}
.
to
change
{
merge_request
.
pipelines_for_merge_request
.
count
}.
by
(
1
)
expect
(
merge_request
.
all_pipelines
.
last
).
to
be_merge_request_pipeline
end
context
"when MergeRequestUpdateWorker is retried by an exception"
do
it
'does not re-create a duplicate merge request pipeline'
do
expect
do
service
.
execute
(
oldrev
,
newrev
,
"refs/heads/
#{
source_branch
}
"
)
end
.
to
change
{
merge_request
.
pipelines_for_merge_request
.
count
}.
by
(
1
)
expect
do
service
.
execute
(
oldrev
,
newrev
,
"refs/heads/
#{
source_branch
}
"
)
end
.
not_to
change
{
merge_request
.
pipelines_for_merge_request
.
count
}
end
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment