coverage

package
v0.0.0-...-c80136c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 9 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TruncateString

func TruncateString(s string, maxLen int) string

TruncateString truncates a string to maxLen and adds ellipsis if needed

Types

type CoverageCollector

type CoverageCollector struct {
	// contains filtered or unexported fields
}

CoverageCollector manages coverage data collection and report generation

func NewCoverageCollector

func NewCoverageCollector(config *CoverageConfig) *CoverageCollector

NewCoverageCollector creates a new CoverageCollector

func (*CoverageCollector) Cleanup

func (c *CoverageCollector) Cleanup()

Cleanup removes temporary coverage files

func (*CoverageCollector) MergeAndGenerateReport

func (c *CoverageCollector) MergeAndGenerateReport() error

MergeAndGenerateReport generates separate coverage reports for each service

func (*CoverageCollector) Setup

func (c *CoverageCollector) Setup() error

Setup prepares the coverage output directories

type CoverageConfig

type CoverageConfig struct {
	// OutputDir is the directory where coverage data is stored
	OutputDir string

	// Services lists the services to collect coverage from
	Services []string

	// ServiceSourceDirs maps service names to their absolute source directory paths
	ServiceSourceDirs map[string]string

	// ContainerPath is the path prefix used inside the container (e.g., "/build/")
	ContainerPath string

	// ModulePrefixes are the module prefixes to strip when displaying package names
	ModulePrefixes []string

	// ReportPrefix is the prefix for output report files (default: "integration-test-coverage")
	ReportPrefix string
}

CoverageConfig holds coverage collection configuration

func (*CoverageConfig) GetReportPrefix

func (c *CoverageConfig) GetReportPrefix() string

GetReportPrefix returns the report prefix, defaulting to "integration-test-coverage"

func (*CoverageConfig) GetSourceDir

func (c *CoverageConfig) GetSourceDir(service string) string

GetSourceDir returns the source directory for a given service

type CoverageReport

type CoverageReport struct {
	Timestamp     string            `json:"timestamp"`
	TotalCoverage float64           `json:"totalCoverage"`
	TotalPackages int               `json:"totalPackages"`
	Packages      []PackageCoverage `json:"packages"`
}

CoverageReport represents the complete coverage report

type PackageCoverage

type PackageCoverage struct {
	Package  string  `json:"package"`
	Coverage float64 `json:"coverage"`
}

PackageCoverage represents coverage for a single package

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL