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
6f9b4583
Commit
6f9b4583
authored
Feb 13, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pipeline specs after adding retry ability check
parent
c5e78808
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+16
-8
No files found.
spec/models/ci/pipeline_spec.rb
View file @
6f9b4583
...
...
@@ -3,8 +3,12 @@ require 'spec_helper'
describe
Ci
::
Pipeline
,
models:
true
do
include
EmailHelpers
let
(
:project
)
{
FactoryGirl
.
create
:empty_project
}
let
(
:pipeline
)
{
FactoryGirl
.
create
:ci_empty_pipeline
,
status:
'created'
,
project:
project
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:pipeline
)
do
create
(
:ci_empty_pipeline
,
status: :created
,
project:
project
)
end
it
{
is_expected
.
to
belong_to
(
:project
)
}
it
{
is_expected
.
to
belong_to
(
:user
)
}
...
...
@@ -559,7 +563,9 @@ describe Ci::Pipeline, models: true do
context
'on failure and build retry'
do
before
do
build
.
drop
Ci
::
Build
.
retry
(
build
)
project
.
team
<<
[
user
,
:developer
]
Ci
::
Build
.
retry
(
build
,
user
)
end
# We are changing a state: created > failed > running
...
...
@@ -571,8 +577,6 @@ describe Ci::Pipeline, models: true do
end
describe
'#detailed_status'
do
let
(
:user
)
{
create
(
:user
)
}
subject
{
pipeline
.
detailed_status
(
user
)
}
context
'when pipeline is created'
do
...
...
@@ -771,12 +775,16 @@ describe Ci::Pipeline, models: true do
describe
'#retry_failed'
do
let
(
:latest_status
)
{
pipeline
.
statuses
.
latest
.
pluck
(
:status
)
}
before
do
project
.
team
<<
[
user
,
:developer
]
end
context
'when there is a failed build and failed external status'
do
before
do
create
(
:ci_build
,
:failed
,
name:
'build'
,
pipeline:
pipeline
)
create
(
:generic_commit_status
,
:failed
,
name:
'jenkins'
,
pipeline:
pipeline
)
pipeline
.
retry_failed
(
create
(
:user
)
)
pipeline
.
retry_failed
(
user
)
end
it
'retries only build'
do
...
...
@@ -789,7 +797,7 @@ describe Ci::Pipeline, models: true do
create
(
:ci_build
,
:failed
,
name:
'build'
,
stage_idx:
0
,
pipeline:
pipeline
)
create
(
:ci_build
,
:failed
,
name:
'jenkins'
,
stage_idx:
1
,
pipeline:
pipeline
)
pipeline
.
retry_failed
(
create
(
:user
)
)
pipeline
.
retry_failed
(
user
)
end
it
'retries both builds'
do
...
...
@@ -802,7 +810,7 @@ describe Ci::Pipeline, models: true do
create
(
:ci_build
,
:failed
,
name:
'build'
,
stage_idx:
0
,
pipeline:
pipeline
)
create
(
:ci_build
,
:canceled
,
name:
'jenkins'
,
stage_idx:
1
,
pipeline:
pipeline
)
pipeline
.
retry_failed
(
create
(
:user
)
)
pipeline
.
retry_failed
(
user
)
end
it
'retries both builds'
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