subsystem-summary-of-test

Installation
SKILL.md

Test Subsystem — Test Utilities and Infrastructure

The src/test/ directory contains test infrastructure, helpers, and utilities used across the entire stellar-core test suite. It does NOT contain the actual test cases (those live alongside their subsystems). This document covers the test framework, helper classes, and conventions.

Test Framework and Runner (test.h / test.cpp)

Test Entry Point

  • runTest(CommandLineArgs const& args) — Main test runner entry point. Configures Catch2 session, parses CLI args (log level, metrics, version selection, tx meta recording), seeds PRNGs, and runs all tests.
  • Uses Catch2 as the underlying test framework (wrapped via Catch2.h).

Test Configuration

  • getTestConfig(int instanceNumber, Config::TestDbMode mode) — Returns a lazily-created, cached Config for the given instance number. Configs are stored in gTestCfg[mode] arrays. Default mode is TESTDB_BUCKET_DB_VOLATILE. Key config settings:
    • RUN_STANDALONE = true, FORCE_SCP = true, MANUAL_CLOSE = true
    • WORKER_THREADS = 3, invariant checks enabled (except EventsAreConsistentWithEntryDiffs)
    • Test root directories created via TmpDir in gTestRoots
    • Node seed derived deterministically from instance number + command-line seed
    • Single-node quorum with UNSAFE_QUORUM = true
    • NETWORK_PASSPHRASE = "(V) (;,,;) (V)"
    • DB can be in-memory SQLite, file-backed SQLite, or PostgreSQL
Related skills
Installs
1
GitHub Stars
3.3K
First Seen
14 days ago