config

package
v0.99.4 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedDeviceTypes = []string{"ANY", "PHONE", "TABLET"}

SupportedDeviceTypes contains the list of supported device types.

Functions

func CleanNpmPackages added in v0.63.4

func CleanNpmPackages(packages map[string]string, denyList []string) map[string]string

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

func IsSupportedDeviceType(deviceType string) bool

IsSupportedDeviceType check that the specified deviceType is valid.

func ShouldDownloadArtifact added in v0.99.2

func ShouldDownloadArtifact(jobID string, passed, timedOut, async bool, cfg ArtifactDownload) bool

ShouldDownloadArtifact returns true if it should download artifacts, otherwise false

func StandardizeVersionFormat

func StandardizeVersionFormat(version string) string

StandardizeVersionFormat remove the leading v in version to ensure reliable comparisons.

func Unmarshal added in v0.53.0

func Unmarshal(cfgPath string, project interface{}) error

Unmarshal parses the file cfgPath into the given project struct.

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 Docker

type Docker struct {
	FileTransfer DockerFileMode `yaml:"fileTransfer,omitempty" json:"fileTransfer,omitempty"`
	Image        string         `yaml:"image,omitempty" json:"image,omitempty"`
}

Docker represents docker settings.

type DockerFileMode

type DockerFileMode string

DockerFileMode represent the file providing method

const (
	DockerFileMount DockerFileMode = "mount"
	DockerFileCopy  DockerFileMode = "copy"
)

DockerFile* represent the different modes

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 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"`
	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:"-"`
}

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 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.

func Describe

func Describe(cfgPath string) (TypeDef, error)

Describe returns a description of the given config that is cfgPath.

type When added in v0.48.3

type When string

When represents a conditional status for when artifacts should be downloaded.

const (
	WhenFail   When = "fail"
	WhenPass   When = "pass"
	WhenNever  When = "never"
	WhenAlways When = "always"
)

These conditions indicate when artifacts are to be downloaded.

Jump to

Keyboard shortcuts

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