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
8aadc080
Commit
8aadc080
authored
Feb 23, 2021
by
Maxime Orefice
Committed by
Dylan Griffith
Feb 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix codequality empty base report
parent
e876311b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
lib/gitlab/ci/reports/reports_comparer.rb
lib/gitlab/ci/reports/reports_comparer.rb
+8
-1
spec/lib/gitlab/ci/reports/reports_comparer_spec.rb
spec/lib/gitlab/ci/reports/reports_comparer_spec.rb
+24
-0
No files found.
lib/gitlab/ci/reports/reports_comparer.rb
View file @
8aadc080
...
...
@@ -8,6 +8,7 @@ module Gitlab
STATUS_SUCCESS
=
'success'
STATUS_FAILED
=
'failed'
STATUS_NOT_FOUND
=
'not_found'
attr_reader
:base_report
,
:head_report
...
...
@@ -17,7 +18,13 @@ module Gitlab
end
def
status
success?
?
STATUS_SUCCESS
:
STATUS_FAILED
if
success?
STATUS_SUCCESS
elsif
base_report
.
nil?
||
head_report
.
nil?
STATUS_NOT_FOUND
else
STATUS_FAILED
end
end
def
success?
...
...
spec/lib/gitlab/ci/reports/reports_comparer_spec.rb
View file @
8aadc080
...
...
@@ -45,6 +45,30 @@ RSpec.describe Gitlab::Ci::Reports::ReportsComparer do
expect
(
status
).
to
eq
(
'failed'
)
end
end
context
'when base_report is nil'
do
let
(
:base_report
)
{
nil
}
before
do
allow
(
comparer
).
to
receive
(
:success?
).
and_return
(
false
)
end
it
'returns status not_found'
do
expect
(
status
).
to
eq
(
'not_found'
)
end
end
context
'when head_report is nil'
do
let
(
:head_report
)
{
nil
}
before
do
allow
(
comparer
).
to
receive
(
:success?
).
and_return
(
false
)
end
it
'returns status not_found'
do
expect
(
status
).
to
eq
(
'not_found'
)
end
end
end
describe
'#success?'
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