Overview

To get full list of commands, run testor without parameters.

Self Commands

testor self:init

This commands create an initial configuration file, if it doesn't exist yet, and a shortcut for DDEV. See Configuration.

Snapshot Commands

For all commands, the website is specified in the .testor.yml file. Where applicable, the environment (dev, test, live, etc.) can be specified with --env.

The --element flag is either database|files|code and applies only when creating a snapshot from Pantheon.

testor snapshot:list

Show the snapshots in the S3 storage; optionally filter by the folder name.

This shows all snapshots:

% testor snapshot:list
-
 Name: developer/performant-labs_dev_2024-09-06T22-51-24_UTC_database.sql.gz
 Date: 2024-09-06T22:52:13.654+00:00
 Size: '3624374'
-
 Name: developer/performant-labs_dev_2024-09-05T19-10-36_UTC_database.sql.gz
 Date: 2024-09-05T19:13:26.853+00:00
 Size: '3624372'

This shows all snapshots that are in the "developer" folder:

% testor snapshot:list --name developer
-
 Name: developer/performant-labs_dev_2024-09-06T22-51-24_UTC_database.sql.gz
 Date: 2024-09-06T22:52:13.654+00:00
 Size: '3624374'
-
 Name: developer/performant-labs_dev_2024-09-05T19-10-36_UTC_database.sql.gz
 Date: 2024-09-05T19:13:26.853+00:00
 Size: '3624372'

testor snapshot:get

Options:

--name  full or partial name

--output local filename

--element database|files|code

--import import the snapshot to the local database after downloading

Downloads a snapshot from the data store. If the file already exists, it is overwritten.

By default, the database snapshot will be downloaded. You can also get files or code snapshot by specifying --element.

When only a folder name is given, testor returns the most recent snapshot. --name can be a partial name such as testing.

This fetches the most recent snapshot that starts with "developer:"

% testor snapshot:get --name developer

Downloaded developer/performant-labs_dev_2024-08-26T21-40-46_UTC_database.sql.gz => developer/performant-labs_dev_2024-08-26T21-40-46_UTC_database.sql.gz

This fetches the specified file:

% testor snapshot:get --name developer/performant-labs_dev_2024-08-26T21-40-46_UTC_database.sql.gz

Downloaded developer/performant-labs_dev_2024-08-26T21-40-46_UTC_database.sql.gz => developer/performant-labs_dev_2024-08-26T21-40-46_UTC_database.sql.gz

Optionally, specify the name of the local file with --output.

% testor snapshot:get --name developer/performant-labs_dev_2024-08-26T21-40-46_UTC_database.sql.gz --output local.sql.gz

Downloaded developer/performant-labs_dev_2024-08-26T21-40-46_UTC_database.sql.gz => local.sql.gz

This fetches the most recent of any snapshot in the root folder:

% testor snapshot:get

Downloaded performant-labs_dev_2024-09-26T21-40-46_UTC_database.sql.gz => performant-labs_dev_2024-09-26T21-40-46_UTC_database.sql.gz 

testor snapshot:create

Options:

--name [optional] destination folder

--env  [optional] the environment for which to create the snapshot

--element [optional] database|files|code

--put put snapshot to the storage after creating

Creates a snapshot of the database and downloads it locally.

By default, only database snapshot is created. You can override this behaviour by specifying --element.

This creates a snapshot of the dev environment and places it in the "testing" folder: 

% testor snapshot:create --name testing

[snip]

Uploaded snapshot::testing/performant-labs_live_2024-09-09T16-53-39_UTC_database.sql.gz

testor snapshot:put

snapshot:put [--name [NAME]] [--element [ELEMENT]] [--format FORMAT] [--] <file>

Options:

--name [optional] destination folder

Upload the snapshot to the data store.

This uploads the snapshot into the "demo" folder: 

% testor snapshot:put --name demo -- performant-labs_dev_2025-03-15T19-03-34_UTC_database.tar.gz

Uploaded performant-labs_dev_2025-03-15T19-03-34_UTC_database.tar.gz => demo/performant-labs_local_2025-03-15T20-03-01_UTC_database.tar.gz

testor snapshot:delete

Options:

--name [optional] name or prefix of snapshot(s) to delete.

-y, --yes Confirm deletion

Delete snapshot(s) from the storage.

This deletes one or more snapshot from the storage which names start with "demo/performant-labs_dev_2025-02":

% testor snapshot:delete --name demo/performant-labs_dev_2025-02

 Do you want to delete 1 objects (yes/no) [yes]:
 > y

 [PL\Testor\SnapshotDelete] Deleted 1 objects

Preview Commands

Testor can be used to automate handling Tugboat previews. It uses Tugboat's command line tool tugboat underneath, and provides more short-handed commands that it initially does.

To work with Tugboat, repo must be configured in .testor.yml:

tugboat:
 repo: '<repo ID>'

Also, a secret token must be configured in .testor_secret.yml:

tugboat:
 token: '<secret token>'

Alternatively, environment variable TUGBOAT_TOKEN can be set.

testor preview:create

Options:

--base [optional] Specify which Preview should be used as the Base Preview. If there are any anchored Base Previews, those will be used by default. Specify the ID of another Preview to use it as the Base Preview, or set this to false to build a Preview without a Base Preview.

--set [optional] Change ATK configs to run test against the new preview.

--format [optional] Format the result data. Available formats: csv,json,list,null,php,print-r,tsv,var_export,xml,yaml

Create a new preview on Tugboat.

This creates a preview, using the anchored preview as a base, and formats output as JSON:

% testor preview:create --format json

testor preview:set

Change ATK configs to run tests against given preview.

This sets preview with ID "67e338d306460d7881906b83":

ddev testor preview:set 67e338d306460d7881906b83

testor preview:delete

Delete one or all previews within project's repo.

This deletes preview with ID "67e338d306460d7881906b83":

ddev testor preview:delete 67e338d306460d7881906b83

This deletes all previews beside of the anchor preview:

ddev testor preview:delete all