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
5ed898a5
Commit
5ed898a5
authored
May 19, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
May 19, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor let! with let_it_be in pipelines spec
parent
b94dac6a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
changelogs/unreleased/pipelines-spec.yml
changelogs/unreleased/pipelines-spec.yml
+5
-0
spec/requests/api/pipelines_spec.rb
spec/requests/api/pipelines_spec.rb
+15
-15
No files found.
changelogs/unreleased/pipelines-spec.yml
0 → 100644
View file @
5ed898a5
---
title
:
angelog Replace let! with let_it_be in pipelines spec
merge_request
:
31916
author
:
Rajendra Kadam
type
:
fixed
spec/requests/api/pipelines_spec.rb
View file @
5ed898a5
...
@@ -72,8 +72,8 @@ describe API::Pipelines do
...
@@ -72,8 +72,8 @@ describe API::Pipelines do
end
end
context
'when scope is branches or tags'
do
context
'when scope is branches or tags'
do
let
!
(
:pipeline_branch
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
_it_be
(
:pipeline_branch
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
!
(
:pipeline_tag
)
{
create
(
:ci_pipeline
,
project:
project
,
ref:
'v1.0.0'
,
tag:
true
)
}
let
_it_be
(
:pipeline_tag
)
{
create
(
:ci_pipeline
,
project:
project
,
ref:
'v1.0.0'
,
tag:
true
)
}
context
'when scope is branches'
do
context
'when scope is branches'
do
it
'returns matched pipelines'
do
it
'returns matched pipelines'
do
...
@@ -161,7 +161,7 @@ describe API::Pipelines do
...
@@ -161,7 +161,7 @@ describe API::Pipelines do
end
end
context
'when name is specified'
do
context
'when name is specified'
do
let
!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
user:
user
)
}
let
_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
user:
user
)
}
context
'when name exists'
do
context
'when name exists'
do
it
'returns matched pipelines'
do
it
'returns matched pipelines'
do
...
@@ -185,7 +185,7 @@ describe API::Pipelines do
...
@@ -185,7 +185,7 @@ describe API::Pipelines do
end
end
context
'when username is specified'
do
context
'when username is specified'
do
let
!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
user:
user
)
}
let
_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
,
user:
user
)
}
context
'when username exists'
do
context
'when username exists'
do
it
'returns matched pipelines'
do
it
'returns matched pipelines'
do
...
@@ -209,8 +209,8 @@ describe API::Pipelines do
...
@@ -209,8 +209,8 @@ describe API::Pipelines do
end
end
context
'when yaml_errors is specified'
do
context
'when yaml_errors is specified'
do
let
!
(
:pipeline1
)
{
create
(
:ci_pipeline
,
project:
project
,
yaml_errors:
'Syntax error'
)
}
let
_it_be
(
:pipeline1
)
{
create
(
:ci_pipeline
,
project:
project
,
yaml_errors:
'Syntax error'
)
}
let
!
(
:pipeline2
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
_it_be
(
:pipeline2
)
{
create
(
:ci_pipeline
,
project:
project
)
}
context
'when yaml_errors is true'
do
context
'when yaml_errors is true'
do
it
'returns matched pipelines'
do
it
'returns matched pipelines'
do
...
@@ -242,9 +242,9 @@ describe API::Pipelines do
...
@@ -242,9 +242,9 @@ describe API::Pipelines do
end
end
context
'when updated_at filters are specified'
do
context
'when updated_at filters are specified'
do
let
!
(
:pipeline1
)
{
create
(
:ci_pipeline
,
project:
project
,
updated_at:
2
.
days
.
ago
)
}
let
_it_be
(
:pipeline1
)
{
create
(
:ci_pipeline
,
project:
project
,
updated_at:
2
.
days
.
ago
)
}
let
!
(
:pipeline2
)
{
create
(
:ci_pipeline
,
project:
project
,
updated_at:
4
.
days
.
ago
)
}
let
_it_be
(
:pipeline2
)
{
create
(
:ci_pipeline
,
project:
project
,
updated_at:
4
.
days
.
ago
)
}
let
!
(
:pipeline3
)
{
create
(
:ci_pipeline
,
project:
project
,
updated_at:
1
.
hour
.
ago
)
}
let
_it_be
(
:pipeline3
)
{
create
(
:ci_pipeline
,
project:
project
,
updated_at:
1
.
hour
.
ago
)
}
it
'returns pipelines with last update date in specified datetime range'
do
it
'returns pipelines with last update date in specified datetime range'
do
get
api
(
"/projects/
#{
project
.
id
}
/pipelines"
,
user
),
params:
{
updated_before:
1
.
day
.
ago
,
updated_after:
3
.
days
.
ago
}
get
api
(
"/projects/
#{
project
.
id
}
/pipelines"
,
user
),
params:
{
updated_before:
1
.
day
.
ago
,
updated_after:
3
.
days
.
ago
}
...
@@ -614,7 +614,7 @@ describe API::Pipelines do
...
@@ -614,7 +614,7 @@ describe API::Pipelines do
end
end
context
'when the pipeline has jobs'
do
context
'when the pipeline has jobs'
do
let
!
(
:build
)
{
create
(
:ci_build
,
project:
project
,
pipeline:
pipeline
)
}
let
_it_be
(
:build
)
{
create
(
:ci_build
,
project:
project
,
pipeline:
pipeline
)
}
it
'destroys associated jobs'
do
it
'destroys associated jobs'
do
delete
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
"
,
owner
)
delete
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
"
,
owner
)
...
@@ -654,12 +654,12 @@ describe API::Pipelines do
...
@@ -654,12 +654,12 @@ describe API::Pipelines do
describe
'POST /projects/:id/pipelines/:pipeline_id/retry'
do
describe
'POST /projects/:id/pipelines/:pipeline_id/retry'
do
context
'authorized user'
do
context
'authorized user'
do
let
!
(
:pipeline
)
do
let
_it_be
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
.
id
,
ref:
project
.
default_branch
)
ref:
project
.
default_branch
)
end
end
let
!
(
:build
)
{
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
)
}
let
_it_be
(
:build
)
{
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
)
}
it
'retries failed builds'
do
it
'retries failed builds'
do
expect
do
expect
do
...
@@ -683,12 +683,12 @@ describe API::Pipelines do
...
@@ -683,12 +683,12 @@ describe API::Pipelines do
end
end
describe
'POST /projects/:id/pipelines/:pipeline_id/cancel'
do
describe
'POST /projects/:id/pipelines/:pipeline_id/cancel'
do
let
!
(
:pipeline
)
do
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
)
ref:
project
.
default_branch
)
end
end
let
!
(
:build
)
{
create
(
:ci_build
,
:running
,
pipeline:
pipeline
)
}
let
_it_be
(
:build
)
{
create
(
:ci_build
,
:running
,
pipeline:
pipeline
)
}
context
'authorized user'
do
context
'authorized user'
do
it
'retries failed builds'
,
:sidekiq_might_not_need_inline
do
it
'retries failed builds'
,
:sidekiq_might_not_need_inline
do
...
@@ -700,7 +700,7 @@ describe API::Pipelines do
...
@@ -700,7 +700,7 @@ describe API::Pipelines do
end
end
context
'user without proper access rights'
do
context
'user without proper access rights'
do
let
!
(
:reporter
)
{
create
(
:user
)
}
let
_it_be
(
:reporter
)
{
create
(
:user
)
}
before
do
before
do
project
.
add_reporter
(
reporter
)
project
.
add_reporter
(
reporter
)
...
...
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