rdc

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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrServerError is returned when the server was not able to correctly handle our request (status code >= 500).
	ErrServerError = errors.New(msg.InternalServerError)
	// ErrJobNotFound is returned when the requested job was not found.
	ErrJobNotFound = errors.New(msg.JobNotFound)
	// ErrAssetNotFound is returned when the requested asset is not found.
	ErrAssetNotFound = errors.New(msg.AssetNotFound)
)

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient     *retryablehttp.Client
	NativeClient   *http.Client
	URL            string
	Username       string
	AccessKey      string
	ArtifactConfig config.ArtifactDownload
}

Client http client.

func New

func New(url, username, accessKey string, timeout time.Duration, artifactConfig config.ArtifactDownload) Client

New creates a new client.

func (*Client) DownloadArtifact

func (c *Client) DownloadArtifact(jobID, suiteName string, realDevice bool) []string

DownloadArtifact does downloading artifacts and returns downloaded file list

func (*Client) GetDevices added in v0.49.0

func (c *Client) GetDevices(ctx context.Context, OS string) ([]devices.Device, error)

GetDevices returns the list of available devices using a specific operating system.

func (*Client) GetJobAssetFileContent

func (c *Client) GetJobAssetFileContent(ctx context.Context, jobID, fileName string, realDevice bool) ([]byte, error)

GetJobAssetFileContent returns the job asset file content.

func (*Client) GetJobAssetFileNames

func (c *Client) GetJobAssetFileNames(ctx context.Context, jobID string, realDevice bool) ([]string, error)

GetJobAssetFileNames returns all assets files available.

func (*Client) PollJob

func (c *Client) PollJob(ctx context.Context, id string, interval, timeout time.Duration, realDevice bool) (job.Job, error)

PollJob polls job details at an interval, until timeout has been reached or until the job has ended, whether successfully or due to an error.

func (*Client) ReadAllowedCCY

func (c *Client) ReadAllowedCCY(ctx context.Context) (int, error)

ReadAllowedCCY returns the allowed (max) concurrency for the current account.

func (*Client) ReadJob

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

ReadJob returns the job details.

func (*Client) StartJob added in v0.99.0

func (c *Client) StartJob(ctx context.Context, opts job.StartOptions) (jobID string, isRDC bool, err error)

StartJob creates a new job in Sauce Labs.

type DeviceQuery added in v0.99.0

type DeviceQuery struct {
	Type                         string `json:"type"`
	DeviceDescriptorID           string `json:"device_descriptor_id,omitempty"`
	PrivateDevicesOnly           bool   `json:"private_devices_only,omitempty"`
	CarrierConnectivityRequested bool   `json:"carrier_connectivity_requested,omitempty"`
	RequestedDeviceType          string `json:"requested_device_type,omitempty"`
	DeviceName                   string `json:"device_name,omitempty"`
	PlatformVersion              string `json:"platform_version,omitempty"`
}

DeviceQuery represents the device selection query for RDC.

type SessionRequest added in v0.99.0

type SessionRequest struct {
	TestFramework       string            `json:"test_framework,omitempty"`
	AppID               string            `json:"app_id,omitempty"`
	TestAppID           string            `json:"test_app_id,omitempty"`
	OtherApps           []string          `json:"other_apps,omitempty"`
	DeviceQuery         DeviceQuery       `json:"device_query,omitempty"`
	TestOptions         map[string]string `json:"test_options,omitempty"`
	TestsToRun          []string          `json:"tests_to_run,omitempty"`
	TestsToSkip         []string          `json:"tests_to_skip,omitempty"`
	TestName            string            `json:"test_name,omitempty"`
	TunnelName          string            `json:"tunnel_name,omitempty"`
	TunnelOwner         string            `json:"tunnel_owner,omitempty"`
	UseTestOrchestrator bool              `json:"use_test_orchestrator,omitempty"`
	Tags                []string          `json:"tags,omitempty"`
	Build               string            `json:"build,omitempty"`
	AppSettings         job.AppSettings   `json:"settings,omitempty"`
	RealDeviceKind      string            `json:"kind,omitempty"`
}

SessionRequest represents the RDC session request.

Jump to

Keyboard shortcuts

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