coverage

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package coverage serves the coverage data of a plugin built with coverage instrumentation, using make COVER=1, over the instrumentation HTTP server. It lets tests which run a plugin as a whole, in a cluster, collect coverage data from it the way go test -cover does for unit tests. Our e2e tests use this to take a snapshot of the counters per test case.

Save the served data to files named covmeta.<id> and covcounters.<id>.N.M, with <id> from the ID endpoint, and go tool covdata can digest the result. A plugin built without instrumentation serves an error for all endpoints.

Index

Constants

View Source
const (
	// IDPath serves the ID of the instrumented binary.
	IDPath = "/coverage/id"
	// MetaPath serves the coverage meta-data of the binary.
	MetaPath = "/coverage/meta"
	// CountersPath serves a snapshot of the coverage counters.
	CountersPath = "/coverage/counters"
	// ClearPath resets the coverage counters.
	ClearPath = "/coverage/clear"
)

Variables

This section is empty.

Functions

func Setup

func Setup(mux *xhttp.ServeMux)

Setup prepares the given HTTP request multiplexer for serving coverage data.

Types

This section is empty.

Directories

Path Synopsis
internal
coverage-server command
This is a helper for the tests of the coverage package, and handy for poking at the endpoints by hand.
This is a helper for the tests of the coverage package, and handy for poking at the endpoints by hand.

Jump to

Keyboard shortcuts

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