Locust Overview

Introduction

Testable has support for executing Locust tests in a globally distributed fashion.

Check out the Getting Started with Locust guide for a quick introduction on how to run your tests.

This section of the documentation goes into further detail on the various options, environment variables, etc that we support when running a Locust test.

Creating a Locust Scenario

There are two ways to create a Locust scenario:

  1. Create a new Test Case (New Test Case button on the dashboard or Test Cases -> New... on the left nav), select Locust file during step 2.
  2. Go to an existing test case and click on the Scenario tab. Click the New Scenario button and select Locust file as the scenario type.

Source

There are several ways to load your Locust code onto Testable.

  1. Upload Files + Create/Edit: Upload all *.py files that are required or create/edit them on our website. Useful if you want to see and update your main Locust file directly.
  2. Upload All Files: Upload all *.py files that are required.
  3. Version Control: Project is cloned from version control onto the test runner. The project folder becomes the working directory on the test runner when your test runs.

Locust Arguments

The scenario allows you to define all the arguments that are passed to the Locust process via command line arguments when it is run on the test runner.

This includes the locust file, host, concurrent clients, hatch rate, # of requests, locust classes, and log level.

Params

Params

Parameters are a way to specify values when defining your Test Configuration and then utilizing these within your scenario.

For example let's say we want to change the number of concurrent clients per Locust instance when defining our Test Configuration.

  1. Add a clients parameter in the Params section.
  2. Use this value within a property using the ${clients} syntax.
  3. When you create your Test Configuration it will ask you to specify a value for clients. This value will then be passed down into your test plan as defined above.

Read more about scenario parameters here.

Runtime Environment

See our Locust runtime environment page for a listing of all environment variables that are passed to the Locust process at test runtime.