Running Automated Tests
Adding test automation to your build pipelines supports continuous integration, and allows you to implement and test new features as early as possible.
In Eggplant DAI, you can trigger a set of tests, or test configuration, from the command line. To do this, you need to install and run a CLI tool:
Download the CLI for your platform. The following platforms are supported:
- Windows
- OSX: Big Sur and Monterey
- Linux: CentOS 7 and Ubuntu 16.
Run the
.exe
from the command line with the following mandatory options:eggplant-runner-Windows-6.1.2.exe <SERVER_URL> <TEST_CONFIG_ID> --client-id <CLIENT_ID> --client-secret <CLIENT_SECRET>
For example:
eggplant-runner-Windows-6.1.2.exe https://myeggplantserver.com 2905e92f-a3e8-471b-b6d6-e5775e00e784 --client-id client:dai:agent:integration --client-secret b034763d-c708-432f-9240-e660e53c59c9
The
.exe
runs until the test config is complete.- If the test config runs successfully, it will complete with an exit code of
0
. - Other exit codes indicate that the test config has failed.
- If the test config runs successfully, it will complete with an exit code of
Mandatory Options​
Parameter | Value Description |
---|---|
--client-id <CLIENT_ID> --client-secret <CLIENT_SECRET> | Retrieve the client secret pair set up during installation. For security, you might want to set the DAI_CLIENT_SECRET environment variable instead of passing your credentials on the command line. |
SERVER_URL | URL for the Eggplant DAI server. For example: https://myeggplantserver.com |
TEST_CONFIG | Go to Controller > Test Config and edit the test configuration that you want to run. The TEST_CONFIG value is appended to the URL. |
Advanced Options​
Advanced options are optional but do allow you to fine-tune test executions. For an up-to-date list, run the --help
option.
Option | Description |
---|---|
--request-timeout INTEGER | Timeout in seconds for each HTTP request to the DAI server. Default: 30 |
--request-retries INTEGER | Number of times to attempt each HTTP request to the DAI server. Default: 10 |
--backoff-factor FLOAT | Exponential backoff factor between each HTTP request. Default: 0.5 |
--poll-interval INTEGER | Number of seconds to wait between each call to the DAI server. Default: 5 |
--test-environment-timeout INTEGER | The timeout in seconds for checking test environment readiness. Default: 15 |
--log-level TEXT | Logging level. Default: INFO |
--ca-cert-path PATH | Path to an alternative Certificate Author pem file |
--test-result-path PATH | Path to a file where the test results will be stored in junit xml format |
--version | Shows the version number and exits |
--dry run / --no-dry-run | Perform a dry run only. Default: no-dry-run |