Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

aaron-lane/k6-tfe-test

Repository files navigation

K6 TFE Test

This repository comprises an example of using k6 to test TFE.

The test workflow is to create one workspace and one Terraform run based on the configuration in the terraform directory.

Installation

K6

Install k6 based on the k6 installation document.

TFE

Deploy TFE and create an API token.

Usage

The following sections demonstrate how to perform different types of testing. Each of the *-test.js scripts use the logic defined in test.js with different combinations of virtual users and durations.

The --no-teardown option can be used to preserve the test organization for manual inspection.

Smoke Testing

k6 run \
  --env TFE_URL="https://tfe.example.com/" \
  --env TFE_API_TOKEN="abc123" \
  --env TFE_EMAIL="[email protected]" \
  --env TFE_ORG_NAME="smoke-test" \
  ./smoke-test.js

Load Testing

k6 run \
  --env TFE_URL="https://tfe.example.com/" \
  --env TFE_API_TOKEN="abc123" \
  --env TFE_EMAIL="[email protected]" \
  --env TFE_ORG_NAME="load-test" \
  ./load-test.js

Stress Testing

k6 run \
  --env TFE_URL="https://tfe.example.com/" \
  --env TFE_API_TOKEN="abc123" \
  --env TFE_EMAIL="[email protected]" \
  --env TFE_ORG_NAME="stress-test" \
  ./stress-test.js

Soak Testing

k6 run \
  --env TFE_URL="https://tfe.example.com/" \
  --env TFE_API_TOKEN="abc123" \
  --env TFE_EMAIL="[email protected]" \
  --env TFE_ORG_NAME="soak-test" \
  ./soak-test.js

About

An example of using K6 to test TFE.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published