Services Subsystem

When you need to perform some actions before test starts, after test starts, or in parallel with running test, you should use services subsystem in Taurus. To configure services, use services top-level section of config with list of service module configs:

Services are configured with services toplevel section. services section contains a list of services to run:

- module: shellexec:
  post-process: ...
- module: monitoring
  - address:
    - cpu
    - disks
    - memory

Taurus provides the following services:

  • shellexec used to execute additional shell commands when test is executed
  • monitoring allows including monitoring data in test reports

Shell Executor Service Module

Shell executor is used to perform additional shell commands at various test execution phases. Taurus provides hooks to all Taurus test execution phases.

Sample configuration:

- module: shellexec
  - mkdir /tmp/test
  - echo 'started' >> /tmp/test/log
  - echo 'shutdown' >> /tmp/test/log 
  - rm /tmp/test/log
- scenario: tg1
  hold-for: 10s
    - label: HTTP Request
      method: GET

Learn more about shellexec service here.

Resource Monitoring Service

It may be useful to attach monitoring data from both servers and load generators in the test report for further analysis. You can achieve that with monitoring service. Here's a quick example.

- module: monitoring
  server-agent:  # collect data from remote server which has ServerAgent running
  - address:
    - cpu
    - disks
    - memory

You can learn more about Monitoring Service at its page

Virtual Display Service

If your tests open windows (e.g. Selenium tests) and you want to run them in a headless environment, you can tell Taurus to run virtual display by using virtual-display service.

virtual-display is build on top of Xvfb, so it's only available on Linux.

- module: virtual-display
  width: 1024
  height: 768


You can ask Taurus to unzip some of your files into artifacts directory before test starts (only zip format is supported). It's easy with unpacker service:

- module: unpacker
  - c:\
  - /home/user/

Alternate Provisionings and Services

If you use alternate provisionings, like BlazeMeter Cloud, you might want to specify where to run the service module - at target machine, or on your local machine. For that, use run-at option of service modules. The service will be effective only when its run-at value match to provisioning value. On the cloud images, provisioning always has value of local. Default value for run-at of services is also local.

Required Tools Installer

There is small service which helps to check for all possible tools presence on the machine. It is called install-checker service. This service, once present in config, will check for all possible tools to be installed on the computer. After that, it will shutdown Taurus without running anything else.

To invoke this service, just run Taurus like this bzt -install-tools.

Appium Loader

Useful for start/stop appium server automatically. This service doesn't provide installation ability so use official documentation to get appium. You can specify path to appium through the appropriate setting:

- appium
    path: 'path/to/appium/executable'
    timeout: 20     # timeout for appium startup

Android Emulator Loader

It used to start/stop android emulator. For that purpose you have to get Android SDK by yourself and tell Taurus where it placed with path to emulator (usualy it can be found in <sdk_directory>/tools) in config or environment variable ANDROID_HOME, which contains SDK location. Moreover, you should choose one of your android emulators with avd option.

- android-emulator
    path: /home/user/Android/sdk/tools/emulator
    avd: android10_arm128
    timeout: 20     # timeout for android emulator startup, adb should be available through the PATH for startup detection