> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-ai/use-harness-cli/harness-cli/harness-cli-commands/resilience-testing-commands.md).

# Resilience Testing

Use the Harness CLI to manage the Resilience Testing module, including load tests, test runs, scripts, templates, and usage reports. Supports JMeter, Locust, and k6.

The Resilience Testing module in the Harness CLI manages load tests, test runs, scripts, and templates. It supports JMeter, Locust, and k6.

***

## Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

* **Harness CLI installed and authenticated:** Go to [Install and upgrade](/harness-ai/use-harness-cli/harness-cli/install-and-upgrade.md) and [Authenticate](/harness-ai/use-harness-cli/harness-cli/authenticate.md) to set up the CLI.

***

### Load tests <a href="#load-tests" id="load-tests"></a>

List and inspect load tests:

```sh
harness list loadtest
harness get loadtest my-test
```

Create a load test from a YAML file:

```sh
harness create loadtest -f loadtest.yaml
```

Create from an existing template:

```sh
harness create loadtest:from_template -f config.yaml
```

Create from a JSON definition:

```sh
harness create loadtest:from_json -f definition.json
```

View available runtime variables for a test:

```sh
harness list loadtest:variables my-test
```

Execute a load test and stream results:

```sh
harness execute loadtest my-test --follow
```

Override runtime variables at execution time:

```sh
harness execute loadtest my-test --set targetUsers=50
```

Sync a load test definition:

```sh
harness execute loadtest:sync my-test
```

Update or delete a load test:

```sh
harness update loadtest my-test -f updated-loadtest.yaml
harness delete loadtest my-test
```

***

### Test runs <a href="#test-runs" id="test-runs"></a>

List and inspect test runs:

```sh
harness list loadtest_run my-test
harness get loadtest_run my-test/run-123
```

Inspect run results in detail:

```sh
harness get loadtest_run:summary my-test/run-123
harness list loadtest_run:metrics my-test/run-123
harness list loadtest_run:graph my-test/run-123
harness list loadtest_run:requests my-test/run-123
harness list loadtest_run:endpoints my-test/run-123
```

Stop or rerun a test run:

```sh
harness execute loadtest_run:stop my-test/run-123
harness execute loadtest_run:rerun my-test/run-123
```

***

### Scripts <a href="#scripts" id="scripts"></a>

List and manage load test scripts and their revision history:

```sh
harness list loadtest_script:revisions my-script
harness get loadtest_script my-script
harness get loadtest_script:revision my-script/rev-2
harness update loadtest_script my-script
```

***

### Templates <a href="#templates" id="templates"></a>

List and manage reusable load test templates:

```sh
harness list loadtest_template
harness get loadtest_template my-template
harness create loadtest_template -f template.yaml
harness update loadtest_template my-template -f updated-template.yaml
harness delete loadtest_template my-template
```

View template variables and YAML definition:

```sh
harness list loadtest_template:variables my-template
harness get loadtest_template:yaml my-template
```

Manage template revisions:

```sh
harness list loadtest_template_revision my-template
harness get loadtest_template_revision my-template/rev-1
harness create loadtest_template_revision my-template/v2 -f rev.yaml
harness delete loadtest_template_revision my-template/rev-1
```

***

### Composite load tests <a href="#composite-load-tests" id="composite-load-tests"></a>

A composite load test groups multiple individual load tests to run as a coordinated set. List composite tests to see all defined groupings in the account.

```sh
harness list composite_loadtest
harness list composite_loadtest --format json
harness create composite_loadtest <id> --loadtest <loadtest-id> --probe <probe-id>
```

***

### Usage reports <a href="#usage-reports" id="usage-reports"></a>

View usage summaries and reports. These commands are account-wide and ignore `--org` and `--project`:

```sh
harness list loadtest_usage
harness get loadtest_usage
harness get loadtest_usage:report
```

***

### Next steps <a href="#next-steps" id="next-steps"></a>

* **Supported resources and actions**: View the full [Resilience Testing resource matrix](/harness-ai/use-harness-cli/harness-cli/supported-resources-and-actions.md).
* **Global flags and output**: Learn about [output formats and pagination](/harness-ai/use-harness-cli/harness-cli/global-flags-and-output.md).
