Deployment events in the mabl CLI

Creating and reviewing mabl deployment events from the mabl CLI

With mabl deployment events, you can integrate mabl tests into your CI/CD workflow to test code as soon as it's deployed. A deployment event triggers a parallel cloud run of all the plans in the workspace that match specified conditions, such as application, environment, and plan label.

The mabl CLI includes commands to create, list, watch, and describe mabl deployment events.

mabl deployments create

The mabl deployments create command triggers a deployment event. At a minimum, you must provide the application ID or the environment ID for the plans that you want to run. After running mabl deployments create, the mabl CLI returns a link to the deployment results in the mabl app.

Options

OptionDetails
--application-id, -aApplication to run the mabl tests for. If provided, mabl only triggers plans that are associated with this application.
--environment-id, -eEnvironment to run the mabl tests for. If provided, mabl only triggers plans that are associated with this environment.
--override-environment-idOverride the environment to run the tests against. Not used to select the plans to run. Requires --application-id.
--await-completionBlocks proceeding in the script and prints status polling updates until the deployment event is complete. The default value is false.
--fast-failureBlocks proceeding in the script until the first test fails in the deployment event. Requires --await-completion. The default value is false.
--silentPrevents the mabl CLI from printing status polling updates while awaiting completion. Requires --await-completion. The default value is false.
--output, -oReturn deployment event output in JSON or yaml format.
--browsers, -bSpace-delimited browsers to run the test against. The default value is "chrome."
--labels, -lRun plans that match any label in the space-delimited list of plan labels.
--http-headersSpace-delimited HTTP headers added to browser requests (e.g. "x-header:foo")
--url, -uURL to use for the deployment.
--app-urlApplication/web URL to use for deployment.
--api-urlAPI URL to use for deployment.
--api-key, -kAPI key for authenticating the command in a script.
--rebaseline-images, --rbiRebaseline visual change models. The default value is false.
--set-static-baseline, --ssbiUse the screenshots from the tests run in the deployment event as the static visual baseline for all subsequent plan runs in that environment. The default value is false.
--revision, --revAssociate the deployment event with a specific git commit hash or revision ID.
--repository-urlAssociate the deployment event with a specific repository by providing this flag with the repository URL. For example "[email protected]:foo/bar.git"
--mabl-branchMabl branch to run tests against
--auto-branchCreate a new branch using the value provided for the --mabl-branch command. Requires --mabl-branch. The default value is false.
--snapshot-fromCreate a snapshot of the current state of tests from a mabl branch onto the environment. Use "master" for the main branch. Requires --environment-id.

Examples

# Trigger a deployment of all plans with a "regression" label
mabl deployments create -e <environment-id> --labels regression

# Trigger a deployment event to run plans on Chrome and Firefox
mabl deployments create -e <environment-id> -a <application-id> --browsers chrome firefox

# Trigger a deployment event on a new branch called "test-branch"
mabl deployments create -e <environment-id> --mabl-branch test-branch --auto-branch

mabl deployments list

The mabl deployments list command returns a list of deployment event IDs, time triggered, application and/or environment used, and total number of passing and failing tests.

Options

OptionDescription
--limit, -lNumber of deployment events to return. The default is 10.
--output, -oSpecify the output format: "json" or "yaml"

Examples

# List the five most recent deployment events in your workspace
mabl deployments list --limit 5

# List deployment events in JSON format
mabl deployments list --output json

mabl deployments watch

The mabl deployments watch command prints polling statuses while the deployment event is running. When the deployment event completes, the mabl CLI outputs the final status and run time of each test and plan that ran in the deployment event.

Options

OptionDescription
--fast-failureBlocks proceeding in the script until the first test fails in the deployment event.
--silentPrevents the mabl CLI from printing status polling updates and results while awaiting completion.
--output, -oSpecify the output format: "json" or "yaml"

Examples

# Watch a deployment event until it finishes
mabl deployments watch <deployment-event-id>

# Pause a script until a mabl deployment event completes
mabl deployments watch <deployment-event-id> --silent

mabl deployments describe

The mabl deployments describe command returns details on the deployment event, including:

  • environment ID
  • received time
  • plan labels
  • deployment event status
  • plan statuses
  • test statuses

📘

Note

Tests are referred to as "journeys" in the mabl CLI output.

Options

OptionDescription
--output, -oSpecify the output format: "json", "yaml", "markdown"

Examples

# Output details on a deployment event in JSON format
mabl deployments describe <deployment-event-id> --output json