report

package
v2.1.155 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdStepReport

func NewCmdStepReport(commonOpts *opts.CommonOptions) *cobra.Command

NewCmdStepReport Creates a new Command object

func NewCmdStepReportChart

func NewCmdStepReportChart(commonOpts *opts.CommonOptions) *cobra.Command

NewCmdStepReportChart Creates a new Command object

func NewCmdStepReportImageVersion

func NewCmdStepReportImageVersion(commonOpts *opts.CommonOptions) *cobra.Command

NewCmdStepReportImageVersion Creates a new Command object

func NewCmdStepReportJUnit

func NewCmdStepReportJUnit(commonOpts *opts.CommonOptions) *cobra.Command

NewCmdStepReportJUnit Creates a new Command object

func NewCmdStepReportVersion

func NewCmdStepReportVersion(commonOpts *opts.CommonOptions) *cobra.Command

NewCmdStepReportVersion Creates a new Command object

func SortChartData

func SortChartData(items []*ChartData)

SortChartData sorts the charts in order

Types

type ChartData

type ChartData struct {
	Prefix  string   `json:"prefix,omitempty"`
	Name    string   `json:"name,omitempty"`
	RepoURL string   `json:"url,omitempty"`
	Version string   `json:"version,omitempty"`
	Images  []string `json:"images,omitempty"`
}

ChartData the image information

type ChartReport

type ChartReport struct {
	Charts          []*ChartData             `json:"charts,omitempty"`
	DuplicateImages []*DuplicateImageVersion `json:"duplicateImages,omitempty"`
}

ChartReport the report

func (*ChartReport) CalculateDuplicates

func (r *ChartReport) CalculateDuplicates(imagesDir string) error

CalculateDuplicates figures out if there are any duplicate image versions

type DuplicateImageVersion

type DuplicateImageVersion struct {
	Image    string
	Versions map[string]string
}

DuplicateImageVersion the duplicate images

type Failure

type Failure struct {
	Text string `xml:",chardata"`
	Type string `xml:"type,attr"`
}

Failure is the representation of a Failure that can be present in a TestCase within a TestSuite in a *.junit.xml xml file

type ImageMap

type ImageMap struct {
	Images map[string]map[string]string
}

ImageMap used to map images to their versions

func LoadImageMap

func LoadImageMap(imagesDir string) (ImageMap, error)

LoadImageMap loads the images from the given image stream dir

func (*ImageMap) AddImage

func (m *ImageMap) AddImage(name string, version string, from string)

AddImage adds a new image to the map

func (*ImageMap) DuplicateImages

func (m *ImageMap) DuplicateImages() []*DuplicateImageVersion

DuplicateImages returns the duplicate images

type ImageVersionReport

type ImageVersionReport struct {
	Versions []Pair `json:"versions,omitempty"`
	Failures []Pair `json:"failures,omitempty"`
}

ImageVersionReport the report

type Pair

type Pair struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

Pair represents a name and value

type StepReportChartOptions

type StepReportChartOptions struct {
	StepReportOptions
	VersionsDir     string
	ReportName      string
	FailOnDuplicate bool

	Report ChartReport
}

StepReportChartOptions contains the command line flags and other helper objects

func (*StepReportChartOptions) Run

func (o *StepReportChartOptions) Run() error

Run generates the report

type StepReportImageVersionOptions

type StepReportImageVersionOptions struct {
	StepReportOptions
	FileName              string
	VersionsDir           string
	GitURL                string
	GitBranch             string
	ServiceAccount        string
	UserName              string
	Email                 string
	Folder                string
	Includes              []string
	Excludes              []string
	BackoffLimit          int32
	ActiveDeadlineSeconds int64
	TestImage             string
	StashImage            string
	ContainerDir          string
	BatchSize             int
	NoWait                bool
	NoDeleteJob           bool
	JobWaitTimeout        time.Duration

	Report ImageVersionReport
}

StepReportImageVersionOptions contains the command line flags and other helper objects

func (*StepReportImageVersionOptions) Run

Run generates the report

type StepReportJUnitOptions

type StepReportJUnitOptions struct {
	StepReportOptions
	reportingtools.XUnitClient
	MergeReports     bool
	ReportsDir       string
	TargetReport     string
	SuiteName        string
	OutputReportName string
	DeleteReportFn   func(reportName string) error
}

StepReportJUnitOptions contains the command line flags and other helper objects

func (*StepReportJUnitOptions) Run

func (o *StepReportJUnitOptions) Run() error

Run generates the report

type StepReportOptions

type StepReportOptions struct {
	step.StepOptions
	OutputDir string
}

StepReportOptions contains the command line flags and other helper objects

func (*StepReportOptions) AddReportFlags

func (o *StepReportOptions) AddReportFlags(cmd *cobra.Command)

AddReportFlags adds common report flags

func (*StepReportOptions) OutputReport

func (o *StepReportOptions) OutputReport(report interface{}, fileName string, outputDir string) error

OutputReport outputs the report to the terminal or a file

func (*StepReportOptions) Run

func (o *StepReportOptions) Run() error

Run implements this command

type StepReportVersionOptions

type StepReportVersionOptions struct {
	StepReportOptions
	FileName string
	Packages []string

	Report VersionReport
}

StepReportVersionOptions contains the command line flags and other helper objects

func (*StepReportVersionOptions) Run

Run generates the report

type TestCase

type TestCase struct {
	XMLName   xml.Name `xml:"testcase"`
	Text      string   `xml:",chardata"`
	Name      string   `xml:"name,attr"`
	Classname string   `xml:"classname,attr"`
	Time      string   `xml:"time,attr"`
	Failure   *Failure `xml:"failure,omitempty"`
	SystemOut string   `xml:"system-out"`
}

TestCase is the representation of an individual test case within a TestSuite in a *.junit.xml xml file

type TestSuite

type TestSuite struct {
	XMLName  xml.Name   `xml:"testsuite"`
	Text     string     `xml:",chardata"`
	Name     string     `xml:"name,attr"`
	Tests    string     `xml:"tests,attr"`
	Failures string     `xml:"failures,attr"`
	Errors   string     `xml:"errors,attr"`
	Time     string     `xml:"time,attr"`
	TestCase []TestCase `xml:"testcase"`
}

TestSuite is the representation of a <testsuite> of a *.junit.xml xml file

type TestSuites

type TestSuites struct {
	XMLName    xml.Name    `xml:"testsuites"`
	Text       string      `xml:",chardata"`
	TestSuites []TestSuite `xml:"testsuite"`
}

TestSuites is the representation of the root of a *.junit.xml xml file

type VersionReport

type VersionReport struct {
	Versions []Pair `json:"versions,omitempty"`
	Failures []Pair `json:"failures,omitempty"`
}

VersionReport the report

Jump to

Keyboard shortcuts

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