Documentation ¶
Index ¶
- Constants
- Variables
- func CleanNpmPackages(packages map[string]string, denyList []string) map[string]string
- func GetSuiteArtifactFolder(suiteName string, cfg ArtifactDownload) (string, error)
- func IsSupportedDeviceType(deviceType string) bool
- func StandardizeVersionFormat(version string) string
- func Unmarshal(cfgPath string, project interface{}) error
- func ValidateSchema(cfgFile string)
- func ValidateSmartRetry(smartRetry SmartRetry)
- func ValidateVisibility(visibility string) bool
- type AppSettings
- type ArtifactDownload
- type Artifacts
- type Defaults
- type Device
- type DeviceOptions
- type Emulator
- type Instrumentation
- type LaunchOrder
- type Metadata
- type Notifications
- type Npm
- type Reporters
- type SauceConfig
- type Simulator
- type Slack
- type SmartRetry
- type Tunnel
- type TypeDef
- type When
Constants ¶
const ( VisibilityPublic = "public" VisibilityPublicRestricted = "public restricted" VisibilityTeam = "team" VisibilityPrivate = "private" )
Variables ¶
var SupportedDeviceTypes = []string{"ANY", "PHONE", "TABLET"}
SupportedDeviceTypes contains the list of supported device types.
var ValidVisibilityValues = []string{ VisibilityPublic, VisibilityPublicRestricted, VisibilityTeam, VisibilityShare, VisibilityPrivate, }
Functions ¶
func CleanNpmPackages ¶ added in v0.63.4
CleanNpmPackages removes any packages in denyList from packages
func GetSuiteArtifactFolder ¶ added in v0.99.2
func GetSuiteArtifactFolder(suiteName string, cfg ArtifactDownload) (string, error)
GetSuiteArtifactFolder returns a target folder that's based on a combination of suiteName and the configured artifact download folder. The suiteName is sanitized by undergoing character replacements that are safe to be used as a directory name. If the determined target directory already exists, a running number is added as a suffix.
func IsSupportedDeviceType ¶ added in v0.52.0
IsSupportedDeviceType check that the specified deviceType is valid.
func StandardizeVersionFormat ¶
StandardizeVersionFormat remove the leading v in version to ensure reliable comparisons.
func ValidateSchema ¶ added in v0.119.0
func ValidateSchema(cfgFile string)
ValidateSchema validates user config against the JSON Schema. If validation fails for any reason, fail softly to avoid disturbing execution as this is not critical.
func ValidateSmartRetry ¶ added in v0.138.0
func ValidateSmartRetry(smartRetry SmartRetry)
func ValidateVisibility ¶ added in v0.104.0
ValidateVisibility checks that the user specified job visibility is valid
Types ¶
type AppSettings ¶ added in v0.93.0
type AppSettings struct { AudioCapture bool `yaml:"audioCapture,omitempty" json:"audioCapture"` Instrumentation Instrumentation `yaml:"instrumentation,omitempty" json:"instrumentation"` }
AppSettings represents override settings.
type ArtifactDownload ¶ added in v0.36.0
type ArtifactDownload struct { Match []string `yaml:"match,omitempty" json:"match"` When When `yaml:"when,omitempty" json:"when"` Directory string `yaml:"directory,omitempty" json:"directory"` }
ArtifactDownload represents the test artifacts configuration.
type Artifacts ¶ added in v0.36.0
type Artifacts struct { Download ArtifactDownload `yaml:"download,omitempty" json:"download"` Cleanup bool `yaml:"cleanup,omitempty" json:"cleanup"` }
Artifacts represents the test artifacts configuration.
type Defaults ¶ added in v0.37.0
type Defaults struct { Mode string `yaml:"mode,omitempty" json:"mode"` Timeout time.Duration `yaml:"timeout,omitempty" json:"timeout"` }
Defaults represents default suite settings.
type Device ¶ added in v0.36.0
type Device struct { ID string `yaml:"id,omitempty" json:"id"` Name string `yaml:"name,omitempty" json:"name"` PlatformName string `yaml:"platformName,omitempty" json:"platformName"` PlatformVersion string `yaml:"platformVersion,omitempty" json:"platformVersion"` Options DeviceOptions `yaml:"options,omitempty" json:"options,omitempty"` }
Device represents the RDC device configuration.
type DeviceOptions ¶ added in v0.43.0
type DeviceOptions struct { CarrierConnectivity bool `yaml:"carrierConnectivity,omitempty" json:"carrierConnectivity"` DeviceType string `yaml:"deviceType,omitempty" json:"deviceType,omitempty"` Private bool `yaml:"private,omitempty" json:"private,omitempty"` }
DeviceOptions represents the devices capabilities required from a real device.
type Emulator ¶ added in v0.43.0
type Emulator struct { Name string `yaml:"name,omitempty" json:"name,omitempty"` PlatformName string `yaml:"platformName,omitempty" json:"platformName"` Orientation string `yaml:"orientation,omitempty" json:"orientation,omitempty"` PlatformVersions []string `yaml:"platformVersions,omitempty" json:"platformVersions,omitempty"` }
Emulator represents the emulator configuration.
type Instrumentation ¶ added in v0.88.0
type Instrumentation struct {
NetworkCapture bool `yaml:"networkCapture,omitempty" json:"networkCapture"`
}
Instrumentation represents Instrumentation settings for real devices.
type LaunchOrder ¶ added in v0.105.0
type LaunchOrder string
const (
LaunchOrderFailRate LaunchOrder = "fail rate"
)
type Metadata ¶
type Metadata struct { Tags []string `yaml:"tags" json:"tags,omitempty"` Build string `yaml:"build" json:"build"` }
Metadata describes job metadata
func (*Metadata) SetDefaultBuild ¶ added in v0.94.0
func (m *Metadata) SetDefaultBuild()
SetDefaultBuild sets default build if it's empty
type Notifications ¶ added in v0.66.0
type Notifications struct {
Slack Slack `yaml:"slack,omitempty" json:"slack"`
}
Notifications represents the test notifications configuration.
type Npm ¶
type Npm struct { Registry string `yaml:"registry,omitempty" json:"registry,omitempty"` Packages map[string]string `yaml:"packages,omitempty" json:"packages"` Dependencies []string `yaml:"dependencies,omitempty" json:"dependencies"` StrictSSL bool `yaml:"strictSSL,omitempty" json:"strictSSL"` }
Npm represents the npm settings
type Reporters ¶ added in v0.62.0
type Reporters struct { JUnit struct { Enabled bool `yaml:"enabled"` Filename string `yaml:"filename"` } `yaml:"junit"` JSON struct { Enabled bool `yaml:"enabled"` WebhookURL string `yaml:"webhookURL"` Filename string `yaml:"filename"` } `yaml:"json"` }
Reporters represents the reporter configuration.
type SauceConfig ¶
type SauceConfig struct { Region string `yaml:"region,omitempty" json:"region"` Metadata Metadata `yaml:"metadata,omitempty" json:"metadata"` Tunnel Tunnel `yaml:"tunnel,omitempty" json:"tunnel,omitempty"` Concurrency int `yaml:"concurrency,omitempty" json:"concurrency,omitempty"` Sauceignore string `yaml:"sauceignore,omitempty" json:"sauceignore,omitempty"` Experiments map[string]string `yaml:"experiments,omitempty" json:"experiments,omitempty"` Retries int `yaml:"retries,omitempty" json:"-"` Visibility string `yaml:"visibility,omitempty" json:"-"` LaunchOrder LaunchOrder `yaml:"launchOrder,omitempty" json:"launchOrder,omitempty"` }
SauceConfig represents sauce labs related settings.
type Simulator ¶ added in v0.49.0
type Simulator Emulator
Simulator represents the simulator configuration.
type Slack ¶ added in v0.66.0
type Slack struct { Channels []string `yaml:"channels,omitempty" json:"channels"` Send When `yaml:"send,omitempty" json:"send"` }
Slack represents slack configuration.
type SmartRetry ¶ added in v0.130.0
type SmartRetry struct { FailedOnly bool `yaml:"failedOnly" json:"-"` // FailedClassesOnly was introduced as the first iteration of smart retry // and was applicable to mobile only. // DEPRECATED. Use FailedOnly instead. FailedClassesOnly bool `yaml:"failedClassesOnly" json:"-"` }
SmartRetry represents the settings for retry strategy.
func (*SmartRetry) IsRetryFailedOnly ¶ added in v0.138.0
func (s *SmartRetry) IsRetryFailedOnly() bool
IsRetryFailedOnly indicates whether retries should selectively pick failed tests.
type Tunnel ¶
type Tunnel struct { // ID represents the tunnel identifier (aka tunnel name). // Deprecated. Use Name instead. ID string `yaml:"id,omitempty" json:"id,omitempty"` Name string `yaml:"name,omitempty" json:"name,omitempty"` // Parent represents the tunnel owner. // Deprecated. Use Owner instead. Parent string `yaml:"parent,omitempty" json:"parent,omitempty"` Owner string `yaml:"owner,omitempty" json:"owner,omitempty"` }
Tunnel represents a sauce labs tunnel.
func (*Tunnel) SetDefaults ¶ added in v0.68.2
func (t *Tunnel) SetDefaults()
SetDefaults updates tunnel default values
type TypeDef ¶
type TypeDef struct { APIVersion string `yaml:"apiVersion,omitempty"` Kind string `yaml:"kind,omitempty"` }
TypeDef represents the type definition of the config.