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
iv
gitlab-ce
Commits
823970b5
Commit
823970b5
authored
Jun 24, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ci config cache validation in legacy processor
parent
1f320edb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
lib/ci/gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+2
-2
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+14
-1
No files found.
lib/ci/gitlab_ci_yaml_processor.rb
View file @
823970b5
...
@@ -127,8 +127,8 @@ module Ci
...
@@ -127,8 +127,8 @@ module Ci
def
validate_global_cache!
def
validate_global_cache!
@cache
.
keys
.
each
do
|
key
|
@cache
.
keys
.
each
do
|
key
|
unless
ALLOWED_CACHE_KEYS
.
include?
key
unless
ALLOWED_CACHE_KEYS
.
include?
(
key
)
raise
ValidationError
,
"
#{
name
}
cache unknown parameter
#{
key
}
"
raise
ValidationError
,
"
Cache config has unknown parameter:
#{
key
}
"
end
end
end
end
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
823970b5
...
@@ -591,7 +591,20 @@ module Ci
...
@@ -591,7 +591,20 @@ module Ci
end
end
end
end
describe
"Caches"
do
describe
'cache'
do
context
'when cache definition has unknown keys'
do
it
'raises relevant validation error'
do
config
=
YAML
.
dump
(
{
cache:
{
untracked:
true
,
invalid:
'key'
},
rspec:
{
script:
'rspec'
}
})
expect
{
GitlabCiYamlProcessor
.
new
(
config
)
}.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
'Cache config has unknown parameter: invalid'
)
end
end
it
"returns cache when defined globally"
do
it
"returns cache when defined globally"
do
config
=
YAML
.
dump
({
config
=
YAML
.
dump
({
cache:
{
paths:
[
"logs/"
,
"binaries/"
],
untracked:
true
,
key:
'key'
},
cache:
{
paths:
[
"logs/"
,
"binaries/"
],
untracked:
true
,
key:
'key'
},
...
...
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