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
Option | Details |
---|---|
--application-id , -a
|
Application to run the mabl tests for. If provided, mabl only triggers plans that are associated with this application. |
--environment-id , -e
|
Environment to run the mabl tests for. If provided, mabl only triggers plans that are associated with this environment. |
--override-environment-id |
Override the environment to run the tests against. Not used to select the plans to run. Requires --application-id . |
--await-completion |
Blocks proceeding in the script and prints status polling updates until the deployment event is complete. The default value is false . |
--fast-failure |
Blocks proceeding in the script until the first test fails in the deployment event. Requires --await-completion . The default value is false. |
--silent |
Prevents the mabl CLI from printing status polling updates while awaiting completion. Requires --await-completion . The default value is false. |
--output , -o
|
Return deployment event output in JSON or yaml format. |
--browsers , -b
|
Space-delimited browsers to run the test against. The default value is "chrome." |
--labels , -l
|
Run plans that match any label in the space-delimited list of plan labels. |
--http-headers |
Space-delimited HTTP headers added to browser requests (e.g. "x-header:foo") |
--url , -u
|
URL to use for the deployment. |
--app-url |
Application/web URL to use for deployment. |
--api-url |
API URL to use for deployment. |
--api-key , -k
|
API key for authenticating the command in a script. |
--android-app-file-id |
Android mobile app file to use for deployment |
--ios-app-file-id |
iOS mobile app file to use for deployment |
--rebaseline-images , --rbi
|
Rebaseline visual change models. The default value is false. |
--set-static-baseline , --ssbi
|
Use 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 , --rev
|
Associate the deployment event with a specific git commit hash or revision ID. |
--repository-url |
Associate the deployment event with a specific repository by providing this flag with the repository URL. For example "git@github.com:foo/bar.git" |
--mabl-branch |
mabl branch to run tests against |
--auto-branch |
Create a new branch using the value provided for the --mabl-branch command. Requires --mabl-branch . The default value is false. |
--snapshot-from |
Create 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
Option | Description |
---|---|
--limit , -l
|
Number of deployment events to return. The default is 10. |
--output , -o
|
Specify 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
Option | Description |
---|---|
--fast-failure |
Blocks proceeding in the script until the first test fails in the deployment event. |
--silent |
Prevents the mabl CLI from printing status polling updates and results while awaiting completion. |
--output , -o
|
Specify 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
Option | Description |
---|---|
--output , -o
|
Specify the output format: "json", "yaml", "markdown" |
Examples
# Output details on a deployment event in JSON format mabl deployments describe <deployment-event-id> --output json