Writing Tests

Describe your test scenario in YAML — which services to start, what to do, and what to check. Spark takes care of the rest.

Test Overview

The five parts of every Spark test: metadata, services, setup, execution, and assertions.

File Structure

How to organize .spark files, suites, and environment variables.

Services

Define Docker containers your tests need — databases, API servers, caches.

Setup

Prepare state before your test runs — seed data, run migrations, clear caches.

Execution

Send HTTP requests or run CLI commands against your services.

Assertions

Verify status codes, exit codes, output content, and snapshots.