gotestrunner

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoCmdTestRunner

type GoCmdTestRunner struct{}

func (GoCmdTestRunner) RunModuleTets

func (c GoCmdTestRunner) RunModuleTets(moduleDirPath string) (*GoModuleTestRunResult, error)

RunModuleTets runs tests for all packages in Go module, collects aggregate statistics

func (GoCmdTestRunner) RunTests

func (c GoCmdTestRunner) RunTests(moduleDirPath string) (map[string]GoPackageTestRunResult, error)

RunTests runs tests via Go process and returns report

type GoModuleTestRunResult

type GoModuleTestRunResult struct {
	HasTests               bool    `json:"has_tests"`
	AllTestsPassed         bool    `json:"all_tests_passed"`
	NumPackages            uint    `json:"num_packages"`
	NumPackagesWithTests   uint    `json:"num_packages_with_tests"`
	NumPackagesTestsPassed uint    `json:"num_packages_tests_passed"`
	AvgPackageCoverage     float64 `json:"package_coverage_avg"`
}

GoModuleTestRunResult is summary of running tests in for all packages in Go module

type GoPackageTestRunResult

type GoPackageTestRunResult struct {
	Package      string  `json:"-"`
	Passed       bool    `json:"passed"`
	HasTests     bool    `json:"has_tests"`
	HasTestFiles bool    `json:"has_tests_files"`
	Coverage     float64 `json:"coverage"`
}

type GoPackageTestRunResultOutput

type GoPackageTestRunResultOutput struct {
	Action  GoTestResultActionEnum `json:"Action"`
	Package string                 `json:"Package"`
	Output  string                 `json:"Output"`
}

GoPackageTestRunResultOutput is json formatted output result of a run go test

type GoTestResultActionEnum

type GoTestResultActionEnum string
const (
	GoTestResultActionPass   GoTestResultActionEnum = "pass"
	GoTestResultActionFail   GoTestResultActionEnum = "fail"
	GoTestResultActionSkip   GoTestResultActionEnum = "skip"
	GoTestResultActionOutput GoTestResultActionEnum = "output"
)

Jump to

Keyboard shortcuts

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