Examples
Rocketship comes with example test suites that demonstrate different features and use cases. Each example includes detailed explanations and ready-to-use test specifications.
Available Examples
HTTP Testing
- Request Chaining & Delays - Learn how to chain HTTP requests, handle responses, and use delays in your test suites
Variables
- Variables Overview - Quick comparison of environment, config, and runtime variables with decision guide
- Environment Variables - Detailed guide for secrets and environment-specific configuration
- Config & Runtime Variables - Detailed guide for test parameters and runtime values
Database Testing
- SQL Testing - Learn how to test database operations with PostgreSQL, MySQL, SQLite, and SQL Server
Scripting & Custom Logic
- Custom Scripting - Learn how to add custom JavaScript logic to your test suites
Debugging & Logging
- Log Plugin - Learn how to add custom logging messages to your test suites for debugging and monitoring
Running the Examples
The examples use the hosted test server at tryme.rocketship.sh
. This server provides a simple HTTP API that you can use to experiment with Rocketship's features. Details:
- Test CRUD operations for a resource type
- Resources are isolated based off a session header
- FYI: Resource cleanup is done hourly (every :00)
Then, run an example:
# Run the request chaining example
rocketship run -af examples/request-chaining/rocketship.yaml
# Run the configuration variables example
rocketship run -af examples/config-variables/rocketship.yaml
# Run with variable overrides
rocketship run -af examples/config-variables/rocketship.yaml --var environment=production
# Run the custom scripting example
rocketship run -af examples/custom-scripting/rocketship.yaml
# Run the log plugin example
rocketship run -af examples/simple-log/rocketship.yaml
Database Examples
You have two options for running the SQL examples:
- Minikube stack – run
scripts/install-minikube.sh
, port-forward the engine, then executerocketship run -af examples/sql-testing/rocketship.yaml
. - Standalone Docker containers – start databases locally:
Then configure the DSNs in
docker run --rm -d --name rocketship-postgres -e POSTGRES_PASSWORD=testpass -e POSTGRES_DB=testdb -p 5433:5432 postgres:13 docker run --rm -d --name rocketship-mysql -e MYSQL_ROOT_PASSWORD=testpass -e MYSQL_DATABASE=testdb -p 3306:3306 mysql:8.0
examples/sql-testing/rocketship.yaml
to point to the exposed ports. Stop the containers when you're done:
You can find the test server's source code in the for-contributors/test-server
directory.