xctest

package
v0.192.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const IOS = "iOS"

IOS constant

Variables

View Source
var (
	// Kind represents the type definition of this config.
	Kind = "xctest"

	// APIVersion represents the supported config version.
	APIVersion = "v1alpha"
)

Config descriptors.

Functions

func FilterSuites

func FilterSuites(p *Project, suiteName string) error

FilterSuites filters out suites in the project that don't match the given suite name.

func GetShardTypes

func GetShardTypes(suites []Suite) []string

func SetDefaults

func SetDefaults(p *Project)

SetDefaults applies config defaults in case the user has left them blank.

func ShardSuites

func ShardSuites(p *Project) error

ShardSuites applies sharding by provided testListFile.

func Validate

func Validate(p Project) error

Validate validates basic configuration of the project and returns an error if any of the settings contain illegal values. This is not an exhaustive operation and further validation should be performed both in the client and/or server side depending on the workflow that is executed.

Types

type Project

type Project struct {
	config.TypeDef `yaml:",inline" mapstructure:",squash"`
	Defaults       config.Defaults        `yaml:"defaults,omitempty" json:"defaults"`
	ConfigFilePath string                 `yaml:"-" json:"-"`
	ShowConsoleLog bool                   `yaml:"showConsoleLog" json:"-"`
	DryRun         bool                   `yaml:"-" json:"-"`
	CLIFlags       map[string]interface{} `yaml:"-" json:"-"`
	Sauce          config.SauceConfig     `yaml:"sauce,omitempty" json:"sauce"`
	Xctest         Xctest                 `yaml:"xctest,omitempty" json:"xctest"`
	// Suite is only used as a workaround to parse adhoc suites that are created via CLI args.
	Suite     Suite             `yaml:"suite,omitempty" json:"-"`
	Suites    []Suite           `yaml:"suites,omitempty" json:"suites"`
	Artifacts config.Artifacts  `yaml:"artifacts,omitempty" json:"artifacts"`
	Reporters config.Reporters  `yaml:"reporters,omitempty" json:"-"`
	Env       map[string]string `yaml:"env,omitempty" json:"-"`
	EnvFlag   map[string]string `yaml:"-" json:"-"`
}

Project represents the xcuitest project configuration.

func FromFile

func FromFile(cfgPath string) (Project, error)

FromFile creates a new xcuitest Project based on the filepath cfgPath.

func (*Project) IsSmartRetried

func (p *Project) IsSmartRetried() bool

IsSmartRetried checks if the suites contain a smartRetried suite

type Suite

type Suite struct {
	Name                     string             `yaml:"name,omitempty" json:"name"`
	App                      string             `yaml:"app,omitempty" json:"app"`
	AppDescription           string             `yaml:"appDescription,omitempty" json:"appDescription"`
	XCTestRunFile            string             `yaml:"xcTestRunFile,omitempty" json:"xcTestRunFile"`
	XCTestRunFileDescription string             `yaml:"xcTestRunFileDescription,omitempty" json:"xcTestRunFileDescription"`
	OtherApps                []string           `yaml:"otherApps,omitempty" json:"otherApps"`
	Timeout                  time.Duration      `yaml:"timeout,omitempty" json:"timeout"`
	Devices                  []config.Device    `yaml:"devices,omitempty" json:"devices"`
	Simulators               []config.Simulator `yaml:"simulators,omitempty" json:"simulators"`
	TestOptions              TestOptions        `yaml:"testOptions,omitempty" json:"testOptions"`
	AppSettings              config.AppSettings `yaml:"appSettings,omitempty" json:"appSettings"`
	PassThreshold            int                `yaml:"passThreshold,omitempty" json:"-"`
	SmartRetry               config.SmartRetry  `yaml:"smartRetry,omitempty" json:"-"`
	Shard                    string             `yaml:"shard,omitempty" json:"-"`
	TestListFile             string             `yaml:"testListFile,omitempty" json:"-"`
	Env                      map[string]string  `yaml:"env,omitempty" json:"-"`
}

Suite represents the xcuitest test suite configuration.

func SortByHistory

func SortByHistory(suites []Suite, history insights.JobHistory) []Suite

SortByHistory sorts the suites in the order of job history

type TestOptions

type TestOptions struct {
	NotClass                          []string `yaml:"notClass,omitempty" json:"notClass"`
	Class                             []string `yaml:"class,omitempty" json:"class"`
	TestLanguage                      string   `yaml:"testLanguage,omitempty" json:"testLanguage"`
	TestRegion                        string   `yaml:"testRegion,omitempty" json:"testRegion"`
	TestTimeoutsEnabled               string   `yaml:"testTimeoutsEnabled,omitempty" json:"testTimeoutsEnabled"`
	MaximumTestExecutionTimeAllowance int      `yaml:"maximumTestExecutionTimeAllowance,omitempty" json:"maximumTestExecutionTimeAllowance"`
	DefaultTestExecutionTimeAllowance int      `yaml:"defaultTestExecutionTimeAllowance,omitempty" json:"defaultTestExecutionTimeAllowance"`
	StatusBarOverrideTime             string   `yaml:"statusBarOverrideTime,omitempty" json:"statusBarOverrideTime"`
}

TestOptions represents the xcuitest test filter options configuration.

func (TestOptions) ToMap

func (t TestOptions) ToMap() map[string]interface{}

ToMap converts the TestOptions to a map where the keys are derived from json struct tags.

type Xctest

type Xctest struct {
	App                      string   `yaml:"app,omitempty" json:"app"`
	AppDescription           string   `yaml:"appDescription,omitempty" json:"appDescription"`
	XCTestRunFile            string   `yaml:"xcTestRunFile,omitempty" json:"xcTestRunFile"`
	XCTestRunFileDescription string   `yaml:"xcTestRunFileDescription,omitempty" json:"xcTestRunFileDescription"`
	OtherApps                []string `yaml:"otherApps,omitempty" json:"otherApps"`
}

Xctest represents xctest apps configuration.

Jump to

Keyboard shortcuts

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