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
5cb60cce
Commit
5cb60cce
authored
Mar 29, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up CI pipelines API specs
parent
c036703a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
spec/requests/api/pipelines_spec.rb
spec/requests/api/pipelines_spec.rb
+10
-6
No files found.
spec/requests/api/pipelines_spec.rb
View file @
5cb60cce
...
@@ -3,11 +3,15 @@
...
@@ -3,11 +3,15 @@
require
'spec_helper'
require
'spec_helper'
describe
API
::
Pipelines
do
describe
API
::
Pipelines
do
let
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:non_member
)
{
create
(
:user
)
}
let_it_be
(
:non_member
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
creator:
user
)
}
let!
(
:pipeline
)
do
# We need to reload as the shared example 'pipelines visibility table' is changing project
let_it_be
(
:project
,
reload:
true
)
do
create
(
:project
,
:repository
,
creator:
user
)
end
let_it_be
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
create
(
:ci_empty_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
ref:
project
.
default_branch
,
user:
user
)
ref:
project
.
default_branch
,
user:
user
)
end
end
...
@@ -26,7 +30,7 @@ describe API::Pipelines do
...
@@ -26,7 +30,7 @@ describe API::Pipelines do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
include_pagination_headers
expect
(
response
).
to
include_pagination_headers
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
first
[
'sha'
]).
to
match
/\A\h{40}\z/
expect
(
json_response
.
first
[
'sha'
]).
to
match
(
/\A\h{40}\z/
)
expect
(
json_response
.
first
[
'id'
]).
to
eq
pipeline
.
id
expect
(
json_response
.
first
[
'id'
]).
to
eq
pipeline
.
id
expect
(
json_response
.
first
[
'web_url'
]).
to
be_present
expect
(
json_response
.
first
[
'web_url'
]).
to
be_present
expect
(
json_response
.
first
.
keys
).
to
contain_exactly
(
*
%w[id sha ref status web_url created_at updated_at]
)
expect
(
json_response
.
first
.
keys
).
to
contain_exactly
(
*
%w[id sha ref status web_url created_at updated_at]
)
...
@@ -438,7 +442,7 @@ describe API::Pipelines do
...
@@ -438,7 +442,7 @@ describe API::Pipelines do
get
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
'sha'
]).
to
match
/\A\h{40}\z/
expect
(
json_response
[
'sha'
]).
to
match
(
/\A\h{40}\z/
)
end
end
it
'returns 404 when it does not exist'
do
it
'returns 404 when it does not exist'
do
...
...
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