saucectl

module
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: Apache-2.0

README

saucectl

build

A command line interface for the Sauce Labs Testrunner Toolkit. This repository contains the Go binary that you use to kick off tests. If you look for more documentation on it, please have a look into our example repo.

For information on how to contribute to saucectl please have a look into our contribution guidelines.

Requirements

  • Docker installed
  • Make sure the Docker daemon is running (e.g. docker info works in your terminal)

FAQ

Please consult the FAQ before using saucectl.

Using saucectl

The new Command

saucectl new

This command will ask you to choose one of the frameworks:

After that, a ./sauce/config.yml file and an example test under the tests directory will be created, where you can start working from.

The run Command

saucectl run

This command will run the test based on the ./.sauce/config.yml file.

The configure Command

saucectl configure

This command ask you to type-in your SauceLabs username and access key.

You can also use the following command to do it in batch mode:

saucectl configure -u <MyUser> -a <MyAccessKey>

The credentials are store in $HOME/.sauce/credentials.yml

The signup Command

saucectl signup

This command provides a link to sign up for a SauceLabs free trial account.

Flags
config
saucectl run --config <path>

Using the --config flag will run the tests specified by that config file.

env
saucectl run --env <key1>=<value1> --env <key2>=<value2> ...

Using the --env flag will define environment variables that are then available for use by the test framework.

parallel
saucectl run --parallel=<true|false>

Using the --parallel flag allows the parallization of tests across machines to be turned on/off.

Saucectl will use CI provider specific clues from the environment and saucectl config file to generate a build ID. This build ID is used a grouping mechanism to synchronize the different machines that are running in the same pipeline to distribute the tests.

Saucectl currently uses the following CI environment variables to generate a build ID.

CI Environment Variables Current Limitations
GitHub GITHUB_WORKFLOW, GITHUB_RUN_ID Unable to re-run jobs. Must trigger a new pipeline.
GitLab CI_PIPELINE_ID, CI_JOB_STAGE Unable to re-run jobs. Must trigger a new pipeline.
Jenkins BUILD_NUMBER None

The current parallization feature is highly experimental and may have limitations with certain CI providers.

If your CI provider is not listed here, you'll have to specify your own build ID. Please consult the ci-build-id flag for this option.

ci-build-id
saucectl run --ci-build-id <value>

Using the --ci-build-id flag will override the build ID that is otherwise determined based on the CI provider. The config file hash will still be used in addition to this provided CI build ID.

region
saucectl run --region <region>

Using the --region flag will set the Sauce Labs region for the test execution. The region corresponds to the available regions at saucelabs.com and affects where your job information and assets are going to be stored.

timeout
saucectl run --timeout <seconds>

Using the --timeout flag will set the test timeout for the test runner framework.

suite
saucectl run --suite <suite_name>

Using the --suite flag will only run specified suite by name.

Private registry

In case you need to use an image from a private registry you can use environment variables for authentification;

export REGISTRY_USERNAME=registry-user
export REGISTRY_PASSWORD=registry-pass

and in your config.yml setup the image name to your registry like:

image:
  base: quay.io/saucelabs/stt-cypress-mocha-node

Licensing

saucectl is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Jump to

Keyboard shortcuts

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