Documentation ¶
Overview ¶
Package smoke is a basic harness for testing the validity of config.ExtractRepo output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmptyIndexer ¶
EmptyIndexer does nothing - it is a placeholder.
Types ¶
type Harness ¶
type Harness struct { Fetcher Fetcher // defaults to GitFetch Extractor config.Extractor // defaults to config.ExtractRepo Indexer Indexer // defaults to EmptyIndexer ConfigPath string // defaults to "" }
A Harness contains all the settings necessary to test a repository. All fields are optional and use defaults as specified. Note that a default ConfigPath tries to use per-repository configuration files.
type Indexer ¶
Indexer takes .kindex files in a given inputDir, indexes them, and deposits in outputDir.
TODO(danielmoy): kzip? This is generally a thing that needs supporting in smoke.go and related files now that I think about it.
type Result ¶
type Result struct {
// Whether the repo was successfully downloaded, extracted, or indexed.
Downloaded, Extracted, Indexed bool
// The number of downloaded and extracted files, and the number of
// indexed symbols.
DownloadCount, ExtractCount, IndexCount int
// The percentage of files in the repo that are covered by extraction.
// Should be in range [0.0, 1.0]
FileCoverage float64
}
Result is a simple container for the results of a single repo test. It may contain useful information about whether or not the repo was accessible, extracted at all, or the extent to which we got good file coverage from the extraction.
TODO(danielmoy): consider better metrics here. For example consider having the smoke test harness try to run a kythe indexer in addition to an extraction and see how much symbol coverage we have. This might be out of scope for a simple smoke test harness though.
type Tester ¶
Tester checks the validity of config.ExtractRepo.
It does this in a generic way by simply trying to determine expected output automatically. The current implementation is to simply check the fraction of files covered by extractor output.
Also optionally supports indexing the extractors output.