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
c944e22d
Commit
c944e22d
authored
Aug 01, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix spec failures
parent
8fe37da6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
app/models/ci/build.rb
app/models/ci/build.rb
+3
-3
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+9
-8
No files found.
app/models/ci/build.rb
View file @
c944e22d
...
@@ -580,12 +580,12 @@ module Ci
...
@@ -580,12 +580,12 @@ module Ci
end
end
def
has_valid_build_dependencies?
def
has_valid_build_dependencies?
return
true
unless
Feature
.
enabled?
(
'ci_disable_validates_dependencies'
)
return
true
if
Feature
.
enabled?
(
'ci_disable_validates_dependencies'
)
dependencies
.
all?
(
&
:
is_
valid_dependency?
)
dependencies
.
all?
(
&
:valid_dependency?
)
end
end
def
is_
valid_dependency?
def
valid_dependency?
return
false
if
artifacts_expired?
return
false
if
artifacts_expired?
return
false
if
erased?
return
false
if
erased?
...
...
spec/models/ci/build_spec.rb
View file @
c944e22d
...
@@ -2414,13 +2414,13 @@ describe Ci::Build do
...
@@ -2414,13 +2414,13 @@ describe Ci::Build do
context
'when depended job has not been completed yet'
do
context
'when depended job has not been completed yet'
do
let!
(
:pre_stage_job
)
{
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'test'
,
stage_idx:
0
)
}
let!
(
:pre_stage_job
)
{
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'test'
,
stage_idx:
0
)
}
it
{
expect
{
job
.
run!
}
.
to
have_valid_build_dependencies
}
it
{
expect
(
job
)
.
to
have_valid_build_dependencies
}
end
end
context
'when artifacts of depended job has been expired'
do
context
'when artifacts of depended job has been expired'
do
let!
(
:pre_stage_job
)
{
create
(
:ci_build
,
:success
,
:expired
,
pipeline:
pipeline
,
name:
'test'
,
stage_idx:
0
)
}
let!
(
:pre_stage_job
)
{
create
(
:ci_build
,
:success
,
:expired
,
pipeline:
pipeline
,
name:
'test'
,
stage_idx:
0
)
}
it
{
expect
{
job
.
run!
}
.
not_to
have_valid_build_dependencies
}
it
{
expect
(
job
)
.
not_to
have_valid_build_dependencies
}
end
end
context
'when artifacts of depended job has been erased'
do
context
'when artifacts of depended job has been erased'
do
...
@@ -2430,7 +2430,7 @@ describe Ci::Build do
...
@@ -2430,7 +2430,7 @@ describe Ci::Build do
pre_stage_job
.
erase
pre_stage_job
.
erase
end
end
it
{
expect
{
job
.
run!
}
.
not_to
have_valid_build_dependencies
}
it
{
expect
(
job
)
.
not_to
have_valid_build_dependencies
}
end
end
end
end
...
@@ -2438,12 +2438,13 @@ describe Ci::Build do
...
@@ -2438,12 +2438,13 @@ describe Ci::Build do
context
'when depended job has not been completed yet'
do
context
'when depended job has not been completed yet'
do
let!
(
:pre_stage_job
)
{
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'test'
,
stage_idx:
0
)
}
let!
(
:pre_stage_job
)
{
create
(
:ci_build
,
:manual
,
pipeline:
pipeline
,
name:
'test'
,
stage_idx:
0
)
}
it
{
expect
{
job
.
run!
}
.
to
have_valid_build_dependencies
}
it
{
expect
(
job
)
.
to
have_valid_build_dependencies
}
end
end
context
'when artifacts of depended job has been expired'
do
context
'when artifacts of depended job has been expired'
do
let!
(
:pre_stage_job
)
{
create
(
:ci_build
,
:success
,
:expired
,
pipeline:
pipeline
,
name:
'test'
,
stage_idx:
0
)
}
let!
(
:pre_stage_job
)
{
create
(
:ci_build
,
:success
,
:expired
,
pipeline:
pipeline
,
name:
'test'
,
stage_idx:
0
)
}
it
{
expect
{
job
.
run!
}
.
to
have_valid_build_dependencies
}
it
{
expect
(
job
)
.
to
have_valid_build_dependencies
}
end
end
context
'when artifacts of depended job has been erased'
do
context
'when artifacts of depended job has been erased'
do
...
@@ -2453,7 +2454,7 @@ describe Ci::Build do
...
@@ -2453,7 +2454,7 @@ describe Ci::Build do
pre_stage_job
.
erase
pre_stage_job
.
erase
end
end
it
{
expect
{
job
.
run!
}
.
to
have_valid_build_dependencies
}
it
{
expect
(
job
)
.
to
have_valid_build_dependencies
}
end
end
end
end
...
@@ -2469,13 +2470,13 @@ describe Ci::Build do
...
@@ -2469,13 +2470,13 @@ describe Ci::Build do
context
'when "dependencies" keyword is not defined'
do
context
'when "dependencies" keyword is not defined'
do
let
(
:options
)
{
{}
}
let
(
:options
)
{
{}
}
it
{
expect
{
job
.
run!
}.
not_to
raise_error
}
it
{
expect
(
job
).
to
have_valid_build_dependencies
}
end
end
context
'when "dependencies" keyword is empty'
do
context
'when "dependencies" keyword is empty'
do
let
(
:options
)
{
{
dependencies:
[]
}
}
let
(
:options
)
{
{
dependencies:
[]
}
}
it
{
expect
{
job
.
run!
}.
not_to
raise_error
}
it
{
expect
(
job
).
to
have_valid_build_dependencies
}
end
end
context
'when "dependencies" keyword is specified'
do
context
'when "dependencies" keyword is specified'
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