BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
1f324864
Commit
1f324864
authored
Apr 15, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make CI config return empty array if no job variables
parent
3dec6e26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+5
-2
gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+12
-0
No files found.
lib/ci/gitlab_ci_yaml_processor.rb
View file @
1f324864
...
...
@@ -45,8 +45,11 @@ module Ci
end
def
job_variables
(
name
)
job
=
@jobs
[
name
.
to_sym
]
job
?
job
[:
variables
]
:
[]
if
job
=
@jobs
[
name
.
to_sym
]
job
[
:variables
]
||
[]
else
[]
end
end
private
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
1f324864
...
...
@@ -380,6 +380,18 @@ module Ci
expect
(
config
.
job_variables
(
:rspec
)).
to
eq
job_variables
end
end
context
'when job variables are not defined'
do
it
'returns empty array'
do
config
=
YAML
.
dump
({
before_script:
[
"pwd"
],
rspec:
{
script:
"rspec"
}
})
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
expect
(
config_processor
.
job_variables
(
:rspec
)).
to
eq
[]
end
end
end
describe
"When"
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