kubetest

package
v0.0.0-...-02c6b06 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FalsePositivesDescFile = "false_positives.json"
	SkipDescFile           = "skip.json"
	GeneratedRunDescFile   = "generated_tests_to_run.txt"
	AllTestcasesFile       = "all_testcases.txt"
	Success                = "success"
	Failure                = "failure"
	Wildcard               = "*"
)
View Source
const (
	E2eLogFileNamePattern   = "e2e.log$"
	JunitXmlFileNamePattern = `junit_\d+.xml$`
	TestSummaryFileName     = "test_summary.json"
	MergedJunitXmlFile      = "junit_01.xml"
	MergedE2eLogFile        = "build-log.txt"
)

Variables

View Source
var AllTestcasesFilePath = filepath.Join(config.TmpDir, AllTestcasesFile)

Functions

func DryRun

func DryRun() (logDir string)

DryRun runs kubetest with dryrun=true argument

func Generate

func Generate() (desc string)

func Publish

func Publish(kubetestResultsPath string, resultSummary Summary)

Publish creates meta files finished.json, started.json in kubetestResultsPath path and uploads them and additionally e2e.log and junit_01.xml files to the google cloud storage

func Run

func Run(descFile string) (resultsPath string)

Run runs kubetest to execute e2e testcases for a given testcase description file

Types

type Cloudprovider

type Cloudprovider string

type JunitXMLResult

type JunitXMLResult struct {
	XMLName         xml.Name         `xml:"testsuite"`
	ExecutedTests   int              `xml:"tests,attr"`
	FailedTests     int              `xml:"failures,attr"`
	Errors          int              `xml:"errors,attr"`
	DurationFloat   float32          `xml:"time,attr"`
	Testcases       []TestcaseResult `xml:"testcase"`
	DurationInt     int              `xml:"-"` // calculated
	SuccessfulTests int              `xml:"-"` // calculated
}

func UnmarshalJunitXMLResult

func UnmarshalJunitXMLResult(junitXmlPath string) (junitXml JunitXMLResult, err error)

func (*JunitXMLResult) CalculateAdditionalFields

func (result *JunitXMLResult) CalculateAdditionalFields()

type KubetestArgs

type KubetestArgs struct {
	FlakeAttempts   int
	ShootConfigPath string
	DryRun          bool
	LogDir          string
	GinkgoParallel  string
	Provider        Cloudprovider
	Skip            string
	GinkgoFocus     string
}

type NestedJunitXMLResult

type NestedJunitXMLResult struct {
	XMLName      xml.Name       `xml:"testsuites"`
	SingleResult JunitXMLResult `xml:"testsuite"`
}

type Summary

type Summary struct {
	ExecutedTestcases   int       `json:"executed_testcases"`
	SuccessfulTestcases int       `json:"successful_testcases"`
	FailedTestcases     int       `json:"failed_testcases"`
	FlakedTestcases     int       `json:"flaked_testcases"`
	Flaked              bool      `json:"individual_testcases_flaked"`
	TestsuiteDuration   int       `json:"duration"`
	TestsuiteSuccessful bool      `json:"successful"`
	DescriptionFile     string    `json:"test_desc_file"`
	StartTime           time.Time `json:"-"`
	FinishedTime        time.Time `json:"-"`
	ExecutionGroup      string    `json:"execution_group"`
	FailedTestcaseNames []string  `json:"failed_testcase_names"`
}

func Analyze

func Analyze(kubetestResultsPath string) Summary

Analyze analyzes junit.xml files and e2e.log files, which are dumped by kubetest and provides a resulting test suite summary and results for each testcase individually. These results are then written to the export dir as files.

type TestcaseDesc

type TestcaseDesc struct {
	Name              string   `json:"testcase"`
	ExcludedProviders []string `json:"exclude,omitempty"`
	OnlyProviders     []string `json:"only,omitempty"`
	Retest            []string `json:"retest,omitempty"`
	TestcaseGroups    []string `json:"groups"`
	Skip              string   `json:"skip,omitempty"`
	Focus             string   `json:"focus,omitempty"`
	IsSubstring       bool     `json:"is-substring,omitempty"`
}

func UnmarshalDescription

func UnmarshalDescription(descPath string) []TestcaseDesc

type TestcaseResult

type TestcaseResult struct {
	XMLName        xml.Name  `xml:"testcase" json:"-"`
	Name           string    `xml:"name,attr" json:"name"`
	Status         string    `xml:"-" json:"status"` // calculated
	SkippedRaw     *struct{} `xml:"skipped" json:"-"`
	Skipped        bool      `xml:"-" json:"-"` // calculated
	FailureText    string    `xml:"failure,omitempty" json:"failure.text,omitempty"`
	SystemOutput   string    `xml:"system-out,omitempty" json:"system-out,omitempty"`
	DurationFloat  float32   `xml:"time,attr" json:"-"`
	DurationInt    int       `xml:"-" json:"duration"`        // calculated
	SigGroup       string    `xml:"-" json:"sig"`             // calculated
	TestDesc       string    `xml:"-" json:"test_desc_file"`  // calculated
	ExecutionGroup string    `xml:"-" json:"execution_group"` // calculated
	Successful     bool      `xml:"-" json:"successful"`      // calculated
	Flaked         int       `xml:"-" json:"flaked"`          // calculated
	StatusShort    string    `xml:"-" json:"status_short"`    // calculated
	ContextedName  string    `xml:"-" json:"contexted_name"`  // calculated
	SuccessRate    int       `xml:"-" json:"success_rate"`    // calculated
	K8sMajor       string    `xml:"-" json:"k8s_major"`       // calculated

}

type TestsKind

type TestsKind string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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