mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-04-11 13:43:08 +00:00
1.1 KiB
1.1 KiB
NATS Example
This example uses nats-server as the system under test.
The main scenario publishes messages and checks that they can be received back
through NATS. The same behavior can be run against a local nats-server
process or a Docker Compose deployment.
How TF runs this
Each example follows the same pattern:
- TF starts
nats-servereither as a local process or in Docker Compose - a workload publishes and subscribes through the NATS client
- an expectation checks that the server stays healthy during the run
Scenarios
basic_roundtripruns the roundtrip check against a localnats-servercompose_roundtripruns the same check in Docker Composeparity_checkruns compose first and then runs local whennats-serveris available
Run locally
cargo run -p nats-examples --bin basic_roundtrip
If nats-server is not on PATH:
NATS_SERVER_BIN=/path/to/nats-server cargo run -p nats-examples --bin basic_roundtrip
Run with Docker Compose
cargo run -p nats-examples --bin compose_roundtrip
Run the parity check
cargo run -p nats-examples --bin parity_check