ScoverageReportWorkerImpl

mill.contrib.scoverage.worker.ScoverageReportWorkerImpl
class ScoverageReportWorkerImpl extends ScoverageReportWorkerApi2

Scoverage Worker for Scoverage 2.x

Attributes

Source
ScoverageReportWorkerImpl.scala
Graph
Supertypes
trait ScoverageReportWorkerApi2
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def report(reportType: ReportType, sources: Array[Path], dataDirs: Array[Path], sourceRoot: Path, ctx: Ctx): Unit

Attributes

Definition Classes
ScoverageReportWorkerApi2
Source
ScoverageReportWorkerImpl.scala
override def validateCoverageMinimums(dataDirs: Array[Path], sourceRoot: Path, statementCoverageMin: Double, branchCoverageMin: Double, ctx: Ctx): Unit

Validates whether the project's code coverage meets specified minimum thresholds for both statement and branch coverage.

Validates whether the project's code coverage meets specified minimum thresholds for both statement and branch coverage.

This method processes coverage data from specified directories to ensure that both statement and branch coverage meet or exceed the provided thresholds. It aggregates coverage metrics using Scoverage's CoverageAggregator and checks each metric against its respective minimum.

If either coverage threshold is not met, a RuntimeException is thrown with detailed error messages indicating which thresholds were violated.

If no coverage data is found in the specified directories, a warning is logged but no exception is thrown.

Value parameters

branchCoverageMin

The minimum acceptable percentage for branch coverage. If not met, an exception is thrown.

ctx

A context object providing logging and destination directory information for the worker's operations.

dataDirs

Array of paths pointing to directories containing Scoverage coverage data.

sourceRoot

The root directory from which relative paths are determined, typically the project's workspace root.

sources

Array of paths representing the source files or directories being analyzed.

statementCoverageMin

The minimum acceptable percentage for statement coverage. If not met, an exception is thrown.

Attributes

Definition Classes
ScoverageReportWorkerApi2
Source
ScoverageReportWorkerImpl.scala