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
5fd635d1
Commit
5fd635d1
authored
Oct 13, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update code coverage for CI build asynchronously
parent
8efa041a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
app/workers/build_coverage_worker.rb
app/workers/build_coverage_worker.rb
+9
-0
spec/workers/build_coverage_worker_spec.rb
spec/workers/build_coverage_worker_spec.rb
+23
-0
No files found.
app/workers/build_coverage_worker.rb
0 → 100644
View file @
5fd635d1
class
BuildCoverageWorker
include
Sidekiq
::
Worker
sidekiq_options
queue: :default
def
perform
(
build_id
)
Ci
::
Build
.
find_by
(
id:
build_id
)
.
try
(
:update_coverage
)
end
end
spec/workers/build_coverage_worker_spec.rb
0 → 100644
View file @
5fd635d1
require
'spec_helper'
describe
BuildCoverageWorker
do
describe
'#perform'
do
context
'when build exists'
do
let!
(
:build
)
{
create
(
:ci_build
)
}
it
'updates code coverage'
do
expect_any_instance_of
(
Ci
::
Build
)
.
to
receive
(
:update_coverage
)
described_class
.
new
.
perform
(
build
.
id
)
end
end
context
'when build does not exist'
do
it
'does not raise exception'
do
expect
{
described_class
.
new
.
perform
(
123
)
}
.
not_to
raise_error
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