Imported from lightninglabs/wavelength (
systest/AGENTS.md). Install upstream withnpx skills add lightninglabs/wavelength --skill systest. Copyright stays with the author.
systest
Purpose
System-level end-to-end tests, gated by the systest build tag, that
exercise real components against Docker-backed Bitcoin/LND infrastructure.
Some tests drive only the boarding-wallet actor via SysTestHarness; others
(send_vtxo_test.go, leave_strand_test.go, refresh_strand_test.go) stand
up a full in-process waved daemon plus round/serverconn/mailbox pieces
for round and OOR-send scenarios.
Key Types
SysTestHarness— Per-test wrapper aroundharness.Harness(Docker bitcoind + lnd) plus a per-testactor.ActorSystem, in-memory SQLitedb.BoardingWalletStore, a runningledger.LedgerActorregistered underledger.NewServiceKey(), and subsystem loggers.NewSysTestHarnessisolates every test's Docker infra, actor system, and database.BoardingWalletFixture— Higher-level fixture built onSysTestHarness: wires a chain source actor,wallet.BoardingBackend, and a runningwallet.Arkactor, and exposes helpers (CreateBoardingAddress,FundAddress,WaitForBalance,RegisterNotifier,AssertAddressStored,AssertIntentStored) so boarding tests skip setup boilerplate.ParallelN(t)/TestMain— Caps concurrent systest execution via a semaphore sized by the-test.parallelismflag (default 4), since each test's Docker harness is resource-heavy.
Relationships
- Depends on:
harness(Docker bitcoind/lnd test environment),wallet(boarding wallet actor under test),chainsource/chainbackends/lndbackend(chain backend wiring),waved(full in-process daemon for round/send-VTXO tests),db/db/actordelivery(test-scoped SQLite stores and the TX-aware delivery store),ledger(durable accounting actor behind the wallet's ledger sink). - Depended on by: nothing (test-only,
systest-tagged).
Invariants
- All files require the
systestbuild tag; nothing here compiles into default builds. - Background goroutines and actor systems are per-test, not shared: each
SysTestHarness/BoardingWalletFixturecleans itself up viat.Cleanup, so tests must not share a harness acrosst.Parallel()subtests. - Tests that need to run concurrently must call
ParallelN(t)(not rawt.Parallel()) so the Docker-resource semaphore is respected. - The harness must run a real ledger actor, not a dangling sink. The wallet commits its deposit leg inside the boarding intent's transaction, so a ledger sink with no actor behind it rolls every confirmed deposit back. The actor shares the wallet's database and delivery store precisely so that leg joins the same transaction it does in the daemon.
Deep Docs
- ARCHITECTURE.md — System-wide package map.