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
Jérome Perrin
gitlab-ce
Commits
6171db2d
Commit
6171db2d
authored
Dec 02, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix /build_spec.rb
parent
38d46754
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
app/models/ci/build.rb
app/models/ci/build.rb
+8
-8
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+6
-1
No files found.
app/models/ci/build.rb
View file @
6171db2d
...
@@ -490,6 +490,14 @@ module Ci
...
@@ -490,6 +490,14 @@ module Ci
end
end
end
end
def
valid_dependency?
return
false
unless
complete?
return
false
if
artifacts_expired?
return
false
if
erased?
true
end
def
hide_secrets
(
trace
)
def
hide_secrets
(
trace
)
return
unless
trace
return
unless
trace
...
@@ -600,13 +608,5 @@ module Ci
...
@@ -600,13 +608,5 @@ module Ci
update_project_statistics
update_project_statistics
end
end
end
end
def
valid_dependency?
return
false
unless
complete?
return
false
if
artifacts_expired?
return
false
if
erased?
true
end
end
end
end
end
spec/models/ci/build_spec.rb
View file @
6171db2d
...
@@ -1869,6 +1869,10 @@ describe Ci::Build do
...
@@ -1869,6 +1869,10 @@ describe Ci::Build do
end
end
describe
'state transition: any => [:running]'
do
describe
'state transition: any => [:running]'
do
before
do
stub_feature_flags
(
ci_validates_dependencies:
true
)
end
let
(
:build
)
{
create
(
:ci_build
,
:pending
,
pipeline:
pipeline
,
stage_idx:
1
,
options:
options
)
}
let
(
:build
)
{
create
(
:ci_build
,
:pending
,
pipeline:
pipeline
,
stage_idx:
1
,
options:
options
)
}
context
'when "dependencies" keyword is not defined'
do
context
'when "dependencies" keyword is not defined'
do
...
@@ -1887,13 +1891,14 @@ describe Ci::Build do
...
@@ -1887,13 +1891,14 @@ describe Ci::Build do
let
(
:options
)
{
{
dependencies:
[
'test'
]
}
}
let
(
:options
)
{
{
dependencies:
[
'test'
]
}
}
context
'when a depended job exists'
do
context
'when a depended job exists'
do
let!
(
:pre_stage_job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'test'
,
stage_idx:
0
)
}
let!
(
:pre_stage_job
)
{
create
(
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'test'
,
stage_idx:
0
)
}
it
{
expect
{
build
.
run!
}.
not_to
raise_error
}
it
{
expect
{
build
.
run!
}.
not_to
raise_error
}
context
'when "artifacts" keyword is specified on depended job'
do
context
'when "artifacts" keyword is specified on depended job'
do
let!
(
:pre_stage_job
)
do
let!
(
:pre_stage_job
)
do
create
(
:ci_build
,
create
(
:ci_build
,
:success
,
:artifacts
,
:artifacts
,
pipeline:
pipeline
,
pipeline:
pipeline
,
name:
'test'
,
name:
'test'
,
...
...
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