☁️VoltTest Cloud closed beta is now openJoin the waitlist
Skip to main content

Artisan Commands

The Laravel package provides two Artisan commands for creating and running performance tests.

volttest:make

Generate a new test class.

php artisan volttest:make {name} [options]

Arguments

ArgumentDescription
nameTest class name (e.g., LoginTest, CheckoutFlowTest)

Options

OptionDescription
--routesScaffold test from your Laravel routes
--filter=Filter routes by URI pattern (e.g., api/*, admin/*)
--method=Filter routes by HTTP method (GET, POST, etc.)
--authOnly include routes with auth middleware
--selectInteractively select which routes to include

Examples

Basic test:

php artisan volttest:make LoginTest

From API routes:

php artisan volttest:make ApiTest --routes --filter=api/*

Only authenticated POST routes:

php artisan volttest:make FormTest --routes --method=POST --auth

Interactive route selection:

php artisan volttest:make CustomTest --routes --select

Generated tests are placed in app/VoltTests/ by default (configurable via test_paths in config).


volttest:run

Execute a performance test.

php artisan volttest:run [test] [options]

Arguments

ArgumentDescription
testTest class name or URL (optional — runs all tests if omitted)

Load Options

OptionDescriptionDefault
--users=Number of virtual usersConfig value (10)
--duration=Test duration (e.g., 30s, 2m, 1h)Config value
--stage=*Staged load profile as duration:target (repeatable)None
--streamStream output to console in real timefalse
--debugEnable HTTP debug outputfalse

URL Testing Options

OptionDescriptionDefault
--urlTreat test argument as a URLfalse
--method=HTTP method for URL testGET
--headers=JSON string of headersNone
--body=Request bodyNone
--content-type=Content-Type headerNone
--code-status=Expected HTTP status code200
--scenario-name=Custom scenario nameNone

Cloud Options

OptionDescriptionDefault
--target=Target base URL (overrides config base_url)None
--cloudRun on VoltTest Cloudfalse
--region=*Region distribution as region:weight (repeatable)None

Examples

Run a specific test:

php artisan volttest:run LoginTest

Run with custom load:

php artisan volttest:run LoginTest --users=100 --duration=5m --stream

Staged load profile:

php artisan volttest:run LoginTest --stage=1m:50 --stage=5m:100 --stage=1m:0

Direct URL test:

php artisan volttest:run https://api.example.com/health --url --users=50 --duration=1m

URL test with POST and headers:

php artisan volttest:run https://api.example.com/login \
--url \
--method=POST \
--body='{"email":"test@example.com","password":"secret"}' \
--content-type=application/json \
--code-status=200 \
--users=20

Cloud execution with regions:

php artisan volttest:run LoginTest --cloud --region=us-east-1:60 --region=eu-west-1:40

Run all tests in the default path:

php artisan volttest:run

Search a custom path:

php artisan volttest:run --path=tests/Performance