Skip to content

Commit

Permalink
Improved the description of merged tasks in the README.md
Browse files Browse the repository at this point in the history
Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
  • Loading branch information
shanshin and qwwdfsad committed Aug 5, 2022
1 parent f1f8f2f commit 34005d4
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions README.md
Expand Up @@ -15,13 +15,14 @@ Minimal supported `Gradle` version: `6.6`.
- [Apply plugin to a project](#apply-plugin)
- [Applying plugins with the plugins DSL](#applying-plugins-with-the-plugins-dsl)
- [Legacy Plugin Application: applying plugins with the buildscript block](#legacy-plugin-application-applying-plugins-with-the-buildscript-block)
- [Merged reports](#merged-reports)
- [Cross-project coverage](#cross-project-coverage)
- [Configuration](#configuration)
- [Configuring project](#configuring-project)
- [Configuring merged reports](#configuring-merged-reports)
- [Configuring JVM test task](#configuring-jvm-test-task)
- [Specifying Coverage Engine](#specifying-coverage-engine)
- [Tasks](#kover-default-tasks)
- [Kover single-project tasks](#kover-single-project-tasks)
- [Kover merged tasks](#kover-merged-tasks)
- [Implicit plugin dependencies](#implicit-plugin-dependencies)

## Features
Expand Down Expand Up @@ -95,12 +96,20 @@ apply plugin: 'kover'
```
</details>

### Merged reports
### Cross-project coverage

[Kover tasks that are created by default](#kover-single-project-tasks) designed to collect project coverage only by tests located in the same project.

In order to find the coverage of the project code, the tests for which are in another project, or the coverage of all the code in a multi-project build,
it is necessary to calculate the cross-module coverage.
[Merged tasks](#kover-merged-tasks) are used to calculate such a coverage.

Merged reports are reports that combine statistics of code coverage by test tasks from several projects.

At the same time, for each project, its configuration of instrumentation and special filters (non-class filters) is applied.

In all projects used for merged reports, a Kover plugin must be applied, as well as all Coverage Engines must match.
For every Gradle project participating in the merged report, both Kover plugin should be applied
and Coverage Engine types and versions should be identical.

See how to enable merge reports in [this section](#configuring-merged-reports).

Expand Down Expand Up @@ -359,7 +368,6 @@ koverMerged {
```
By default, merged reports include containing project along with all its subprojects.


Merged reports can also be configured in a similar manner. To do this, you need to configure the extension in the containing project (where `koverMerged.enable()` is called)

<details open>
Expand Down Expand Up @@ -530,13 +538,14 @@ kotlinx.kover.api.DefaultJacocoEngine.INSTANCE
kotlinx.kover.api.JacocoEngine("0.8.8")
```

## Kover default tasks
## Kover single-project tasks
Tasks that are created for a project where the Kover plugin is applied:
- `koverHtmlReport` - Generates code coverage HTML report for all enabled test tasks in the project.
- `koverXmlReport` - Generates code coverage XML report for all enabled test tasks in the project.
- `koverReport` - Executes both `koverXmlReport` and `koverHtmlReport` tasks.
- `koverVerify` - Verifies code coverage metrics of the project based on configured rules. Always is executed before `check` task.

## Kover merged tasks
Tasks that are created for project where the Kover plugin is applied and merged reports are enabled:
- `koverMergedHtmlReport` - Generates code coverage HTML report for all enabled test tasks in all projects.
- `koverMergedXmlReport` - Generates code coverage XML report for all enabled test tasks in all projects.
Expand Down

0 comments on commit 34005d4

Please sign in to comment.