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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
020516f9
Commit
020516f9
authored
Dec 14, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pipeline validation failure description
parent
5466da88
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
app/presenters/ci/pipeline_presenter.rb
app/presenters/ci/pipeline_presenter.rb
+3
-1
ee/app/presenters/ee/ci/pipeline_presenter.rb
ee/app/presenters/ee/ci/pipeline_presenter.rb
+2
-1
spec/presenters/ci/pipeline_presenter_spec.rb
spec/presenters/ci/pipeline_presenter_spec.rb
+12
-6
No files found.
app/presenters/ci/pipeline_presenter.rb
View file @
020516f9
...
...
@@ -8,7 +8,9 @@ module Ci
# We use a class method here instead of a constant, allowing EE to redefine
# the returned `Hash` more easily.
def
self
.
failure_reasons
{
config_error:
'CI/CD YAML configuration error!'
}
{
unknown_failure:
'Unknown pipeline failure!'
,
config_error:
'CI/CD YAML configuration error!'
,
external_validation_failure:
'External pipeline validation failed!'
}
end
presents
:pipeline
...
...
ee/app/presenters/ee/ci/pipeline_presenter.rb
View file @
020516f9
...
...
@@ -12,7 +12,8 @@ module EE
def
failure_reasons
super
.
merge
(
activity_limit_exceeded:
'Pipeline activity limit exceeded!'
,
size_limit_exceeded:
'Pipeline size limit exceeded!'
size_limit_exceeded:
'Pipeline size limit exceeded!'
,
job_activity_limit_exceeded:
'Pipeline job activity limit exceeded!'
)
end
end
...
...
spec/presenters/ci/pipeline_presenter_spec.rb
View file @
020516f9
...
...
@@ -62,13 +62,19 @@ describe Ci::PipelinePresenter do
end
end
context
'#failure_reason'
do
context
'when pipeline has failure reason'
do
it
'represents a failure reason sentence'
do
pipeline
.
failure_reason
=
:config_error
describe
'#failure_reason'
do
context
'when pipeline has a failure reason'
do
::
Ci
::
PipelineEnums
.
failure_reasons
.
keys
.
each
do
|
failure_reason
|
context
"when failure reason is
#{
failure_reason
}
"
do
before
do
pipeline
.
failure_reason
=
failure_reason
end
expect
(
presenter
.
failure_reason
)
.
to
eq
'CI/CD YAML configuration error!'
it
'represents a failure reason sentence'
do
expect
(
presenter
.
failure_reason
).
to
be_an_instance_of
(
String
)
expect
(
presenter
.
failure_reason
).
not_to
eq
(
failure_reason
.
to_s
)
end
end
end
end
...
...
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