covermerger

package
v0.0.0-...-444551c Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyKernelRepo   = "kernel_repo"
	KeyKernelBranch = "kernel_branch"
	KeyKernelCommit = "kernel_commit"
	KeyFilePath     = "file_path"
	KeyStartLine    = "sl"
	KeyHitCount     = "hit_count"
	KeyManager      = "manager"
)

Variables

This section is empty.

Functions

func GetFileVersion

func GetFileVersion(filePath, repo, commit string) (string, error)

func MakeBQCSVReader

func MakeBQCSVReader() *bqCSVReader

func MergeCSVData

func MergeCSVData(c context.Context, config *Config, reader io.Reader, results chan<- *FileMergeResult) error

func MergeCSVWriteJSONL

func MergeCSVWriteJSONL(config *Config, descr *coveragedb.HistoryRecord, csvReader io.Reader, w io.Writer,
) (int, int, error)

MergeCSVWriteJSONL mergers input CSV and generates JSONL records. The amount of lines generated is [count(managers)+1] * [count(kernel_files)]. Returns (totalInstrumentedLines, totalCoveredLines, error).

Types

type Config

type Config struct {
	Jobs    int
	Workdir string

	Base             RepoCommit
	FileVersProvider FileVersProvider
	// contains filtered or unexported fields
}

type DeletedFileLineMerger

type DeletedFileLineMerger struct {
}

func (*DeletedFileLineMerger) Add

func (*DeletedFileLineMerger) Result

func (a *DeletedFileLineMerger) Result() *MergeResult

type FileCoverageMerger

type FileCoverageMerger interface {
	Add(record *FileRecord)
	Result() *MergeResult
}

type FileLineCoverMerger

type FileLineCoverMerger struct {
	*MergeResult
	// contains filtered or unexported fields
}

func (*FileLineCoverMerger) Add

func (a *FileLineCoverMerger) Add(record *FileRecord)

func (*FileLineCoverMerger) Result

func (a *FileLineCoverMerger) Result() *MergeResult

type FileMergeResult

type FileMergeResult struct {
	FilePath string
	*MergeResult
}

type FileRecord

type FileRecord struct {
	FilePath string
	RepoCommit
	StartLine int
	HitCount  int
	Manager   string
}

type FileRecords

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

type FileVersProvider

type FileVersProvider interface {
	GetFileVersions(targetFilePath string, repoCommits ...RepoCommit,
	) (fileVersions, error)
}

func MakeMonoRepo

func MakeMonoRepo(workdir string) FileVersProvider

func MakeWebGit

func MakeWebGit(funcProxy FuncProxyURI) FileVersProvider

type FuncProxyURI

type FuncProxyURI func(filePath, commit string) string

type LineToLineMatcher

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

func (*LineToLineMatcher) SameLinePos

func (lm *LineToLineMatcher) SameLinePos(line int) int

type MergeResult

type MergeResult struct {
	HitCounts   map[int]int
	FileExists  bool
	LineDetails map[int][]*FileRecord
}

type RepoCommit

type RepoCommit struct {
	Repo   string
	Commit string
}

Jump to

Keyboard shortcuts

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