Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

How to run rtf-orchestrator tests

The rtf-orchestrator crate partitions its tests into three categories, each requiring a different level of infrastructure. This guide explains how to run each category.

Prerequisites

  • cargo (via rustup)
  • make
  • Docker with Compose support
  • tilt
  • kind

Unit tests

Unit tests require no external infrastructure and run via the standard workspace test command:

cargo test -p rtf-orchestrator --lib

Stack-dependent tests are skipped automatically and reported as ignored in the output.

DB tests

DB tests require a running PostgreSQL instance.

Start the lightweight database stack:

cd crates/rtf-orchestrator
make db-up

In a second terminal, run the DB tests:

make db-tests

Stop the stack when done:

make db-down

The DB tests can also be run against the tilt stack (documented in the section below).

Integration tests

Integration tests exercise the full HTTP API and require the complete tilt stack (Orchestrator server + database).

Set up the cluster:

cd crates/rtf-orchestrator
make cluster-setup

Then start the tilt stack (and view the status of the resources via the link provided in the output):

make cluster-up

In a second terminal, run the integration tests:

make integration-tests

Stop the stack when done:

make cluster-teardown

Running all tests as CI does

To replicate the full CI flow — start stack, wait for readiness, run all tests, tear down:

cd crates/rtf-orchestrator
make ci-tests

Feature flags reference

FlagWhat it gates
db_testsUnit tests requiring a live PostgreSQL database
k8s_testsFull integration tests in tests/suite.rs (implies db_tests)

To test a feature flag directly, use the make targets as these also set required environment variables that are necessary for the tests to work:

make db-tests
make integration-tests

See the HTTP API integration test reference for details on test organization and the TestHelper infrastructure.