Testery CLI
The Testery CLI is available as a pip package here: https://pypi.org/project/testery/.
To install, run
1
pip install --upgrade testery
Copied!
If pip install errors you might need to run pip3 install depending on which versions of python you have on your machine.
You can see the command line help by running,
1
> testery --help
2
Usage: testery [OPTIONS] COMMAND [ARGS]...
3
4
Testery CLI
5
6
Kick off test runs from your CI/CD platform and run them on Testery's
7
next-generation, cloud-based testing grid.
8
9
Options:
10
--help Show this message and exit.
11
12
Commands:
13
add-file Adds a file to a test run.
14
cancel-test-run Cancels a test run.
15
create-deploy Creates a deploy for a project and...
16
create-environment Creates an environment where tests can be...
17
create-test-run Submits a Git-based test run to the Testery...
18
delete-environment Deletes an environment.
19
list-environments Returns a list of environments.
20
load-users
21
monitor-test-run
22
monitor-test-runs
23
report-test-run Outputs individual test results for the...
24
update-environment Updates an environment where tests can be...
25
upload-build-artifacts Uploads a file or directory of build...
26
verify-token Verifies your username and authentication...
Copied!

Create a Deployment

Creating a deployment is useful for telling Testery when you've pushed new code into your test environment. What tests you want to run can be configured with Schedules.
1
> testery create-deploy --help
2
Usage: testery create-deploy [OPTIONS]
3
4
Creates a deploy for a project and environment.
5
6
Options:
7
--token TEXT Your Testery API token. [required]
8
--project TEXT The project key of the repo being deployed. [required]
9
--git-provider TEXT The Git provider used for the repository that is being
10
deployed. Should be GitHub or BitBucket
11
--git-owner TEXT The organization owner in Git for the repository that
12
is being deployed.
13
--git-repo TEXT The repository name that is being deployed.
14
--build-id TEXT The build the atifact should be associated with.
15
--environment TEXT Which environment you would like to run your tests
16
against. [required]
17
--commit TEXT The Git commit that was deployed.
18
--branch TEXT The Git branch the deploy came from.
19
--help Show this message and exit.
Copied!

Create a Test Run

1
Usage: testery create-test-run [OPTIONS]
2
3
Submits a Git-based test run to the Testery platform.
4
5
Options:
6
--token TEXT Your Testery API token. [required]
7
--git-ref TEXT The git commit hash of the build being
8
tested.
9
10
--git-branch TEXT The git branch whose latest commit you wnat
11
to run.
12
13
--test-name TEXT The name you want to use on the Git status.
14
--wait-for-results If set, the command will poll until the test
15
run is complete.
16
17
--project TEXT Legacy option. Use --project-key instead.
18
--project-key TEXT The project key.
19
--environment TEXT Legacy option. Use --environment-key
20
instead.
21
22
--environment-key TEXT Which environment you would like to run your
23
tests against.
24
25
--include-tags TEXT List of tags that should be run.
26
--exclude-tags TEXT List of tags that should excluded from the
27
test run.
28
29
--copies INTEGER The number of copies of the tests to submit.
30
--build-id TEXT A unique identifier that identifies this
31
build in your system.
32
33
--output TEXT The format for outputting results
34
[json,pretty,teamcity]
35
36
--fail-on-failure When set, the testery command will return
37
exit code 1 if there are test failures.
38
39
--include-all-tags When set, overrides the testery.yml and runs
40
all available tags.
41
42
--parallelize-by-file Pass this flag if you want the test run to
43
parallelize by file/feature.
44
45
--parallelize-by-test Pass this flag if you want the test run to
46
parallelize by test/scenario.
47
48
--timeout-minutes INTEGER The maximum number of minutes this test run
49
can take before it is killed automatically.
50
51
--test-timeout-seconds INTEGER The maximum number of seconds a test can
52
take before it is killed automatically.
53
54
--runner-count INTEGER Specify number of parallel runners to use in
55
for this testrun.
56
57
--variable TEXT A variable to add to the enviroment.
58
Specified as "KEY=VALUE". To encrypt value,
59
pass in "secure:KEY=VALUE", Multiple
60
variables can be provided.
61
62
--test-filter-regex TEXT A regular expression to be used for
63
filtering tests.
64
65
--help Show this message and exit.
Copied!

Upload Build Artifacts

If your project is using a compiled language (like .Net, Java) or if you aren't attaching a code repository to your project, then you'll have to upload your build artifacts to Testery before you can run a test. To do that you can use the upload-build-artifacts command of the Testery CLI.
1
> testery upload-build-artifacts --help
2
Usage: testery upload-build-artifacts [OPTIONS]
3
4
Uploads a file or directory of build artifacts and associates them with
5
the specified build-id
6
7
Options:
8
--token TEXT Your Testery API token. [required]
9
--project TEXT Legacy option. Use --project-key instead.
10
--project-key TEXT The project key.
11
--branch TEXT The Git branch the build came from.
12
--build-id TEXT The build the artifact should be associated with.
13
[required]
14
15
--path TEXT The path to the file or directory you want to upload.
16
[required]
17
18
--zip-dir Creates a zip file of the directory contents before
19
uploading.
20
21
--help Show this message and exit.
Copied!
Last modified 6mo ago
Copy link