Skip to content

Smoke Tests

Basics

Zoidberg's smoke tests config is based on the artillery config format. To run the smoke tests of a specific product, just run it against the directory that contains an artillery.yml file:

zoidberg smokeTests -d ./zoidberg_tests
Run smoke tests

Usage:
  Zoidberg smokeTests [flags]

Flags:
  -d, --dataDir string   Directory with the datas (default "./zoidberg_tests/")
  -f, --file string      YAML file containing the smoke tests to run (relative to --dataDir, default "artillery.yml")
  -h, --help             help for smokeTests
  -i, --isoWith string   Environment ( develop | prod | local )

Global Flags:
  -e, --environment string   Environment ( develop | prod | local ) (default "develop")
  -k, --publicKey string     Override public key from environment variable
  -v, --verbose              Verbose Mode
  -p, --versionPR string     Run the tests on a specific PR

Config file

By default, Zoidberg looks for artillery.yml in the directory passed to --dataDir. Use -f to specify a different filename (still resolved relative to --dataDir).

Zoidberg reads a subset of artillery and adds its own features such as the setup section and capture. See the Artillery Config reference for the full format. A short example:

config:
  variables:
    test_variable: "test_value"
    username_variable: "test"
    password_variable: "test"

setup:
  - log: "Retrieve Bearer from authent"
  - request:
      url: "/auth/access_tokens"
      kind: "post"
      json:
        username: "{{ username_variable }}"
        password: "{{ password_variable }}"
      capture:
        - responseData: "access_token"
          as: "bearer_token"

scenarios:
  - flow:
      - log: "Some debug message"
      - get | post:
          url: "/exemple/of/api/url_path"
          qs:
            params: "params_value"
            param_from_variable: "{{ test_variable }}"
          headers:
            Authorization: "Bearer {{ bearer_token }}"
          expect:
            statusCode: 200
            contentType: application/json
            bodyContain: 'body response should contain this sentence'
          capture:
            - responseData: "json.path"
              as: "variable_name"

Run smoke tests on different environments

By default, Zoidberg runs the smoke tests on the develop environment.

  • Use -p pr_number to run them against a dedicated PR.
  • Use -e environment to run them on another environment (e.g. prod or local).

Zoidberg knows the URLs of develop and prod. To run tests on a custom environment like your local one, set both environment variables:

WOOSMAP_ENVNAME_API_KEY=change_me
WOOSMAP_ENVNAME_BASEURL=http://localhost