insights

package
v0.124.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RDCSource = "rdc"
	VDCSource = "vdc"
	APISource = "api"
)
View Source
const (
	StatePassed  = "passed"
	StateFailed  = "failed"
	StateSkipped = "skipped"
)

The different states that a run can be in.

View Source
const (
	TypeWeb    = "web"
	TypeMobile = "mobile"
	TypeAPI    = "api"
	TypeOther  = "other"
)

The different types that a run can be.

View Source
const (
	PlatformVDC   = "vdc"
	PlatformRDC   = "rdc"
	PlatformAPI   = "api"
	PlatformOther = "other"
)

The different platform that a run can be executed on.

View Source
const AutomaticRunMode = "automatic"

AutomaticRunMode indicates the job is automated

Variables

View Source
var LaunchOptions = map[config.LaunchOrder]string{
	config.LaunchOrderFailRate: "fail_rate",
}

Functions

This section is empty.

Types

type CI added in v0.119.0

type CI struct {
	RefName    string `json:"ref_name,omitempty"`
	CommitSha  string `json:"commit_sha,omitempty"`
	Repository string `json:"repository,omitempty"`
	Branch     string `json:"branch,omitempty"`
}

type Client

type Client struct {
	HTTPClient  *http.Client
	URL         string
	Credentials credentials.Credentials
}

Client service

func New

func New(url string, creds credentials.Credentials, timeout time.Duration) Client

func (*Client) GetHistory

func (c *Client) GetHistory(ctx context.Context, user iam.User, launchOrder config.LaunchOrder) (JobHistory, error)

GetHistory returns job history from insights

func (*Client) ListJobs added in v0.120.0

func (c *Client) ListJobs(ctx context.Context, userID, jobSource string, queryOpts job.QueryOption) (job.List, error)

ListJobs returns job list

func (*Client) PostTestRun added in v0.119.0

func (c *Client) PostTestRun(ctx context.Context, runs []TestRun) error

PostTestRun publish test-run results to insights API.

func (*Client) ReadJob added in v0.120.0

func (c *Client) ReadJob(ctx context.Context, jobID string) (job.Job, error)

type Details added in v0.119.0

type Details struct {
	AppName   string
	Browser   string
	BuildName string
	BuildID   string
	CI        string
	Device    string
	Framework string
	Platform  string
	Tags      []string
}

type Job added in v0.119.0

type Job struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type JobHistory

type JobHistory struct {
	TestCases []TestCase `json:"test_cases"`
}

JobHistory represents job history data structure

type JobResp added in v0.120.0

type JobResp struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Status      string `json:"status"`
	Error       string `json:"error"`
	Framework   string `json:"automation_backend"`
	Device      string `json:"device"`
	BrowserName string `json:"browser_name"`
	OS          string `json:"os"`
	OSVersion   string `json:"os_version"`
	Source      string `json:"source"`
}

JobResp represents job response structure

type ListJobResp added in v0.120.0

type ListJobResp struct {
	Jobs  []JobResp `json:"jobs"`
	Total int       `json:"total"`
}

ListJobResp represents list job response structure

type Service

type Service interface {
	GetHistory(context.Context, iam.User, config.LaunchOrder) (JobHistory, error)
	PostTestRun(ctx context.Context, runs []TestRun) error
	ListJobs(ctx context.Context, userID, jobType string, queryOption job.QueryOption) (job.List, error)
	ReadJob(ctx context.Context, jobID string) (job.Job, error)
}

type TestCase

type TestCase struct {
	Name     string  `json:"name"`
	FailRate float64 `json:"fail_rate"`
}

TestCase represents test case data structure

type TestRun added in v0.119.0

type TestRun struct {
	ID           string         `json:"id,omitempty"`
	Name         string         `json:"name,omitempty"`
	UserID       string         `json:"user_id,omitempty"`
	OrgID        string         `json:"org_id,omitempty"`
	TeamID       string         `json:"team_id,omitempty"`
	GroupID      string         `json:"group_id,omitempty"`
	AuthorID     string         `json:"author_id,omitempty"`
	PathName     string         `json:"path_name,omitempty"`
	BuildID      string         `json:"build_id,omitempty"`
	BuildName    string         `json:"build_name,omitempty"`
	CreationTime time.Time      `json:"creation_time,omitempty"`
	StartTime    time.Time      `json:"start_time,omitempty"`
	EndTime      time.Time      `json:"end_time,omitempty"`
	Duration     int            `json:"duration"`
	Browser      string         `json:"browser,omitempty"`
	Device       string         `json:"device,omitempty"`
	OS           string         `json:"os,omitempty"`
	AppName      string         `json:"app_name,omitempty"`
	Status       string         `json:"status,omitempty"`
	Platform     string         `json:"platform,omitempty"`
	Type         string         `json:"type,omitempty"`
	Framework    string         `json:"framework,omitempty"`
	CI           *CI            `json:"ci,omitempty"`
	SauceJob     *Job           `json:"sauce_job,omitempty"`
	Errors       []TestRunError `json:"errors,omitempty"`
	Tags         []string       `json:"tags,omitempty"`
}

TestRun represents a

func FromJUnit added in v0.119.0

func FromJUnit(suites junit.TestSuites, jobID string, jobName string, details Details, isRDC bool) []TestRun

func FromSauceReport added in v0.119.0

func FromSauceReport(report saucereport.SauceReport, jobID string, jobName string, details Details, isRDC bool) []TestRun

type TestRunError added in v0.119.0

type TestRunError struct {
	Message string `json:"message,omitempty"`
	Path    string `json:"path,omitempty"`
	Line    int    `json:"line,omitempty"`
}

Jump to

Keyboard shortcuts

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