Get up and running with the TFE Load Testing Framework in 5 minutes.
- Python 3.11 or higher
- TFE instance (local or cloud)
- TFE API token
- TFE organization
# Clone the repository (if not already done)
cd tfe-load-testing-framework
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt# Copy the example environment file
cp .env.example .env
# Edit .env with your values
nano .env # or use your preferred editorRequired variables:
TFE_TOKEN=your-tfe-api-token-here
TFE_ORGANIZATION=your-organization-nameOptional variables:
TFE_HOSTNAME=tfe.localdemo.me # or app.terraform.io for TFE Cloud
TFE_VERIFY_SSL=false # true for production, false for local dev# Load the environment variables
source .env
# Verify they're set
echo $TFE_TOKEN
echo $TFE_ORGANIZATION# Run all test scenarios with default settings
./run_all_tests.sh
# The script will:
# 1. Validate your environment
# 2. Run workspace operations test
# 3. Run run operations test
# 4. Run state operations test
# 5. Run sentinel policy operations test
# 6. Analyze each test
# 7. Generate reports in reports/run_TIMESTAMP/# Run just the workspace operations test
./examples/run_workspace_test.shAfter the tests complete, open the generated reports:
# The script will automatically open the index page
# Or manually open:
open reports/run_TIMESTAMP/index.htmlSolution:
# Make sure you've loaded the .env file
source .env
# Verify the variable is set
echo $TFE_TOKENSolution:
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtSolution:
# For local development with self-signed certificates
export TFE_VERIFY_SSL=false
# Or add to your .env file
echo "TFE_VERIFY_SSL=false" >> .env
source .envSolution:
# Verify your organization name is correct
# It should match exactly as shown in TFE
export TFE_ORGANIZATION=your-exact-org-name-
Customize Test Parameters:
./run_all_tests.sh --users 50 --spawn-rate 5 --run-time 10m
-
Enable Grafana Metrics:
./run_all_tests.sh --with-grafana --grafana-url http://localhost:3000
-
Run in CI/CD:
./run_all_tests.sh --ci-mode
-
Read Full Documentation:
| Variable | Required | Default | Description |
|---|---|---|---|
TFE_TOKEN |
✅ Yes | - | TFE API token |
TFE_ORGANIZATION |
✅ Yes | - | TFE organization name |
TFE_HOSTNAME |
No | tfe.localdemo.me |
TFE instance hostname |
TFE_VERIFY_SSL |
No | true |
Verify SSL certificates |
CLEANUP_WORKSPACES |
No | true |
Clean up test workspaces |
./run_all_tests.sh [options]
Options:
--max-concurrent-runs NUM Primary load parameter — auto-sets users & spawn-rate (default: 20)
--users NUM Override automatic user count (optional)
--spawn-rate NUM User spawn rate per second (optional)
--run-time TIME Test duration (default: 5m)
--host URL TFE hostname (default: https://tfe.localdemo.me)
--with-grafana Include Grafana metrics
--grafana-url URL Grafana URL (default: http://localhost:3000)
--skip-workspace Skip workspace operations test
--skip-run Skip run operations test
--skip-state Skip state operations test
--skip-sentinel Skip sentinel policy operations test
--ci-mode CI/CD mode (fail fast)
--help Show help messageFor issues or questions:
- Check the Known Limitations
- Review the Troubleshooting Guide
- Check the main README
Last Updated: 2026-08-04 Version: 1.1.0