testreportfiller

package
v0.0.0-...-569970b Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoFileSizeLimit   = 0
	FileSizeLimit10Mb = 1e7
)

File size constants

Variables

View Source
var ErrFileIsTooLarge = errors.New("file is too large")

ErrFileIsTooLarge ...

Functions

func FetchXML

func FetchXML(fAPI DownloadURLCreator, trr models.TestReport, httpClient *http.Client, maxFileSize int64) ([]byte, error)

FetchXML ...

func GetContent

func GetContent(url string, httpClient *http.Client, maxFileSize int64) ([]byte, error)

GetContent ...

Types

type CheckStyleError

type CheckStyleError struct {
	Column   int    `xml:"column,attr,omitempty"`
	Line     int    `xml:"line,attr"`
	Message  string `xml:"message,attr"`
	Severity string `xml:"severity,attr,omitempty"`
	Source   string `xml:"source,attr,omitempty"`
}

CheckStyleError represents <error line="1" column="10" severity="error" message="msg" source="src" />

type CheckStyleFile

type CheckStyleFile struct {
	Name   string             `xml:"name,attr"`
	Errors []*CheckStyleError `xml:"error"`
}

CheckStyleFile represents <file name="fname"><error ... />...</file>

type CheckStyleResult

type CheckStyleResult struct {
	XMLName xml.Name          `xml:"checkstyle"`
	Version string            `xml:"version,attr"`
	Files   []*CheckStyleFile `xml:"file,omitempty"`
}

CheckStyleResult represents checkstyle XML result. <?xml version="1.0" encoding="utf-8"?><checkstyle version="4.3"><file ...></file>...</checkstyle>

References:

type DownloadURLCreator

type DownloadURLCreator interface {
	DownloadURLforPath(string) (string, error)
}

DownloadURLCreator ...

type Filler

type Filler struct{}

Filler ...

func (*Filler) Annotate

func (f *Filler) Annotate(xmlContent []byte) ([]bitrise.Annotation, error)

Annotate ...

func (*Filler) FillMore

func (f *Filler) FillMore(testReportRecords []models.TestReport, fAPI DownloadURLCreator, junitParser junit.Parser, httpClient *http.Client, status string) ([]TestReportWithTestSuites, error)

FillMore ...

func (*Filler) FillOne

func (f *Filler) FillOne(trr models.TestReport,
	assetDownloadURLCreator DownloadURLCreator,
	xmlContent []byte,
	junitParser junit.Parser,
	status string,
) (TestReportWithTestSuites, error)

FillOne ...

func (*Filler) FillOneXML

func (f *Filler) FillOneXML(trr models.TestReport, junitParser junit.Parser, status string, xmlContent []byte) (TestReportWithTestSuites, error)

FillOneXML ...

type StepReportData

type StepReportData struct {
	XMLContent []byte
	Step       models.StepInfo
}

StepReportData ...

func (*StepReportData) StepProperties

func (srd *StepReportData) StepProperties() map[string]string

StepProperties ...

type TestReportAssetInfo

type TestReportAssetInfo struct {
	Filename    string    `json:"filename"`
	Filesize    int       `json:"filesize"`
	Uploaded    bool      `json:"uploaded"`
	DownloadURL string    `json:"download_url"`
	CreatedAt   time.Time `json:"created_at" db:"created_at"`
}

TestReportAssetInfo ...

type TestReportWithTestSuites

type TestReportWithTestSuites struct {
	ID         uuid.UUID             `json:"id"`
	TestSuites []junitmodels.Suite   `json:"test_suites"`
	StepInfo   models.StepInfo       `json:"step_info"`
	TestAssets []TestReportAssetInfo `json:"test_assets"`
}

TestReportWithTestSuites ...

Jump to

Keyboard shortcuts

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