GSoC 2018. Code Coverage API Plugin

Goal:

Status: Active

Team

Details

Overview

There are a lot of plugins which currently implement code coverage, however, they all use similar config, charts, and content. So it will be much better if we can have an API plugin which does the most repeated work for those plugins and offers a unified APIs which can be consumed by other plugins and external tools.

Supported Tools

Architecture

This API plugin will mainly do these things:

  1. Find coverage reports according to the user’s config.

  2. Use adapters to convert reports into the our standard format.

  3. Parse standard format reports, and aggregate them.

  4. Show parsed result in a chart.

So, we can implement code coverage publishing by simply writing an adapter, and such adapter only needs to do one thing - convert a coverage report into the standard format. The implementation is based on extension points, so new adapters can be created in separate plugins. In order to simplify conversion for XML reports, there is also an abstraction layer which allows creating XSLT-based converters.

architecture diagram

architecture

Features

  • Modernized coverage chart

  • Coverage trend

  • Source code navigation

  • Parallel pipeline support

  • Reports combining

  • Rest API

  • Failed conditions and flexible threshold setting

  • Other small features

You can see more details in our 1.0 release blog post

First Phase Summary

Second Phase Summary

  • Add source code navigation(JENKINS-51988)

  • Prototype integration between Code Coverage API and Cobertura plugin(JENKINS-51424)

  • Offer REST API to retrieve the coverage reports in machine-readable format.(JENKINS-51422)

  • Offer REST API to retrieve the coverage trends in machine-readable format.(JENKINS-51423)

  • Move auto-detector coverage publishing logic to the extension point implementation.(JENKINS-51737)

  • Refactoring the configuration page to make it more user-friendly.(JENKINS-51927)

  • Add support of llvm-cov Report converter.(JENKINS-51736)

Third Phase Summary

  • Supporting combining reports within a build(e.g. after parallel() execution in Pipeline). (JENKINS-51926)

  • Make Code Coverage API plugin more generic. (JENKINS-52839)

  • Migrate LLVM coverage out into new plugin (JENKINS-52630)

  • Refactoring of the adopted code(JENKINS-51733)

  • Change current REST API to the standard format.(JENKINS-52628)

  • Bug fixing.

  • Writing documentation.

  • Releasing the plugin.

Future tasks

Phase 3 Presentation Slides

Phase 3 Presentation Video

Links