Skip to main content

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:

  1. Download the CLI for your platform. The following platforms are supported:

    • Windows
    • OSX: Big Sur and Monterey
    • Linux: CentOS 7 and Ubuntu 16.
  2. 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.

Mandatory Options

ParameterValue 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_URLURL for the Eggplant DAI server. For example: https://myeggplantserver.com
TEST_CONFIGGo to Controller > Test Config and edit the test configuration that you want to run. The TEST_CONFIG value is appended to the URL.

Test config id in 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.

OptionDescription
--request-timeout INTEGERTimeout in seconds for each HTTP request to the DAI server. Default: 30
--request-retries INTEGERNumber of times to attempt each HTTP request to the DAI server. Default: 10
--backoff-factor FLOATExponential backoff factor between each HTTP request. Default: 0.5
--poll-interval INTEGERNumber of seconds to wait between each call to the DAI server. Default: 5
--log-level TEXTLogging level. Default: INFO
--ca-cert-path PATHPath to an alternative Certificate Author pem file
--test-result-path PATHPath to a file where the test results will be stored in junit xml format"
--versionShows the version number and exits
--dry run / --no-dry-runPerform a dry run only. Default: no-dry-run