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
31f679da
Commit
31f679da
authored
Feb 11, 2021
by
Maxime Orefice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor daily coverage specs
parent
a64f507e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
spec/services/ci/daily_build_group_report_result_service_spec.rb
...rvices/ci/daily_build_group_report_result_service_spec.rb
+7
-15
No files found.
spec/services/ci/daily_build_group_report_result_service_spec.rb
View file @
31f679da
...
...
@@ -3,17 +3,13 @@
require
'spec_helper'
RSpec
.
describe
Ci
::
DailyBuildGroupReportResultService
,
'#execute'
do
let
!
(
:pipeline
)
{
create
(
:ci_pipeline
,
created_at:
'2020-02-06 00:01:10'
)
}
let
!
(
:rspec_job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'3/3 rspec'
,
coverage:
80
)
}
let
!
(
:karma_job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'2/2 karma'
,
coverage:
9
0
)
}
let
!
(
:extra_job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'extra'
,
coverage:
nil
)
}
let
!
(
:group
)
{
create
(
:group
,
:private
)
}
let
_it_be
(
:group
)
{
create
(
:group
,
:private
)
}
let
_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
create
(
:project
,
group:
group
),
created_at:
'2020-02-06 00:01:10'
)
}
let
_it_be
(
:rspec_job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'3/3 rspec'
,
coverage:
8
0
)
}
let
_it_be
(
:karma_job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'2/2 karma'
,
coverage:
90
)
}
let
_it_be
(
:extra_job
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
name:
'extra'
,
coverage:
nil
)
}
let
(
:coverages
)
{
Ci
::
DailyBuildGroupReportResult
.
all
}
before
do
pipeline
.
project
.
group
=
group
end
it
'creates daily code coverage record for each job in the pipeline that has coverage value'
do
described_class
.
new
.
execute
(
pipeline
)
...
...
@@ -25,7 +21,7 @@ RSpec.describe Ci::DailyBuildGroupReportResultService, '#execute' do
group_name:
rspec_job
.
group_name
,
data:
{
'coverage'
=>
rspec_job
.
coverage
},
date:
pipeline
.
created_at
.
to_date
,
group_id:
pipeline
.
project
.
group
.
id
group_id:
group
.
id
)
end
...
...
@@ -37,7 +33,7 @@ RSpec.describe Ci::DailyBuildGroupReportResultService, '#execute' do
group_name:
karma_job
.
group_name
,
data:
{
'coverage'
=>
karma_job
.
coverage
},
date:
pipeline
.
created_at
.
to_date
,
group_id:
pipeline
.
project
.
group
.
id
group_id:
group
.
id
)
end
...
...
@@ -162,10 +158,6 @@ RSpec.describe Ci::DailyBuildGroupReportResultService, '#execute' do
let!
(
:some_job
)
{
create
(
:ci_build
,
pipeline:
new_pipeline
,
name:
'foo'
)
}
before
do
new_pipeline
.
project
.
group
=
group
end
it
'does nothing'
do
expect
{
described_class
.
new
.
execute
(
new_pipeline
)
}.
not_to
raise_error
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