diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-02 19:17:47 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-10-02 19:17:47 +0400 |
commit | 8e33f9460c6f98df089eb367b96d9a1fc91c5d52 (patch) | |
tree | a8a0ecb97ae3d10cc43f14c4f08477ad086fa71d /app/controllers | |
parent | 71fce0b2f82fa4c6dea4fef4c0672514a00ec72c (diff) |
Show test coverage results in MR if available
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 2667cc7a4f7..16bb3a5476e 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -150,8 +150,17 @@ class Projects::MergeRequestsController < Projects::ApplicationController end def ci_status - status = @merge_request.source_project.ci_service.commit_status(merge_request.last_commit.sha) - response = {status: status} + ci_service = @merge_request.source_project.ci_service + status = ci_service.commit_status(merge_request.last_commit.sha) + + if ci_service.respond_to?(:commit_coverage) + coverage = ci_service.commit_coverage(merge_request.last_commit.sha) + end + + response = { + status: status, + coverage: coverage + } render json: response end |