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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
94190461
Commit
94190461
authored
Oct 15, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
0aa6061d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
lib/ci/gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+1
-1
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+3
-2
spec/models/ci/commit_spec.rb
spec/models/ci/commit_spec.rb
+2
-2
No files found.
lib/ci/gitlab_ci_yaml_processor.rb
View file @
94190461
...
@@ -187,7 +187,7 @@ module Ci
...
@@ -187,7 +187,7 @@ module Ci
end
end
if
job
[
:when
]
&&
!
job
[
:when
].
in?
(
%w(on_success on_failure always)
)
if
job
[
:when
]
&&
!
job
[
:when
].
in?
(
%w(on_success on_failure always)
)
raise
ValidationError
,
"
#{
name
}
: when should be on_success, on_failure or always"
raise
ValidationError
,
"
#{
name
}
: when
parameter
should be on_success, on_failure or always"
end
end
end
end
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
94190461
...
@@ -24,7 +24,8 @@ module Ci
...
@@ -24,7 +24,8 @@ module Ci
commands:
"pwd
\n
rspec"
,
commands:
"pwd
\n
rspec"
,
tag_list:
[],
tag_list:
[],
options:
{},
options:
{},
allow_failure:
false
allow_failure:
false
,
when:
"on_success"
})
})
end
end
...
@@ -330,7 +331,7 @@ module Ci
...
@@ -330,7 +331,7 @@ module Ci
end
end
it
"returns errors if job when is not on_success, on_failure or always"
do
it
"returns errors if job when is not on_success, on_failure or always"
do
config
=
YAML
.
dump
({
rspec:
{
script:
"test"
,
when:
false
}
})
config
=
YAML
.
dump
({
rspec:
{
script:
"test"
,
when:
1
}
})
expect
do
expect
do
GitlabCiYamlProcessor
.
new
(
config
)
GitlabCiYamlProcessor
.
new
(
config
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"rspec job: when parameter should be on_success, on_failure or always"
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"rspec job: when parameter should be on_success, on_failure or always"
)
...
...
spec/models/ci/commit_spec.rb
View file @
94190461
...
@@ -248,7 +248,7 @@ describe Ci::Commit do
...
@@ -248,7 +248,7 @@ describe Ci::Commit do
end
end
context
'properly creates builds "when" is defined'
do
context
'properly creates builds "when" is defined'
do
let
(
:yaml
)
{
let
(
:yaml
)
do
{
{
stages:
[
"build"
,
"test"
,
"test_failure"
,
"deploy"
,
"cleanup"
],
stages:
[
"build"
,
"test"
,
"test_failure"
,
"deploy"
,
"cleanup"
],
build:
{
build:
{
...
@@ -274,7 +274,7 @@ describe Ci::Commit do
...
@@ -274,7 +274,7 @@ describe Ci::Commit do
when:
"always"
,
when:
"always"
,
}
}
}
}
}
end
before
do
before
do
stub_ci_commit_yaml_file
(
YAML
.
dump
(
yaml
))
stub_ci_commit_yaml_file
(
YAML
.
dump
(
yaml
))
...
...
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