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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
f2f1b9e3
Commit
f2f1b9e3
authored
Aug 04, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a spec for concurrent process
parent
28b44298
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
27 deletions
+68
-27
spec/features/merge_requests/pipelines_spec.rb
spec/features/merge_requests/pipelines_spec.rb
+68
-27
No files found.
spec/features/merge_requests/pipelines_spec.rb
View file @
f2f1b9e3
require
'spec_helper'
require
'spec_helper'
feature
'Pipelines for Merge Requests'
,
js:
true
do
feature
'Pipelines for Merge Requests'
,
js:
true
do
describe
'pipeline tab'
do
given
(
:user
)
{
create
(
:user
)
}
given
(
:user
)
{
create
(
:user
)
}
given
(
:merge_request
)
{
create
(
:merge_request
)
}
given
(
:merge_request
)
{
create
(
:merge_request
)
}
given
(
:project
)
{
merge_request
.
target_project
}
given
(
:project
)
{
merge_request
.
target_project
}
...
@@ -28,7 +29,7 @@ feature 'Pipelines for Merge Requests', js: true do
...
@@ -28,7 +29,7 @@ feature 'Pipelines for Merge Requests', js: true do
end
end
wait_for_requests
wait_for_requests
expect
(
page
).
to
have_selector
(
'.stage-cell
'
)
expect
(
page
).
to
have_selector
(
'.sssssssss
'
)
end
end
end
end
...
@@ -43,4 +44,44 @@ feature 'Pipelines for Merge Requests', js: true do
...
@@ -43,4 +44,44 @@ feature 'Pipelines for Merge Requests', js: true do
end
end
end
end
end
end
end
describe
'race condition'
do
given
(
:project
)
{
create
(
:project
,
:repository
)
}
given
(
:user
)
{
create
(
:user
)
}
given
(
:build_push_data
)
{
{
ref:
'feature'
,
checkout_sha:
TestEnv
::
BRANCH_SHA
[
'feature'
]
}
}
given
(
:merge_request_params
)
do
{
"source_branch"
=>
"feature"
,
"source_project_id"
=>
project
.
id
,
"target_branch"
=>
"master"
,
"target_project_id"
=>
project
.
id
,
"title"
=>
"A"
}
end
background
do
project
.
add_master
(
user
)
sign_in
user
end
context
'when pipeline and merge request were created simultaneously'
do
background
do
stub_ci_pipeline_to_return_yaml_file
threads
=
[]
threads
<<
Thread
.
new
do
@merge_request
=
MergeRequests
::
CreateService
.
new
(
project
,
user
,
merge_request_params
).
execute
end
threads
<<
Thread
.
new
do
@pipeline
=
Ci
::
CreatePipelineService
.
new
(
project
,
user
,
build_push_data
).
execute
(
:push
)
end
threads
.
each
{
|
thr
|
thr
.
join
}
end
scenario
'user sees pipeline in merge request widget'
do
visit
project_merge_request_path
(
project
,
@merge_request
)
expect
(
page
.
find
(
".ci-widget"
)).
to
have_content
(
TestEnv
::
BRANCH_SHA
[
'feature'
])
expect
(
page
.
find
(
".ci-widget"
)).
to
have_content
(
"#
#{
@pipeline
.
id
}
"
)
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