Skip to content

Commit

Permalink
Add README.md to integration-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbesraa committed Dec 16, 2024
1 parent e503478 commit 1f80f31
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions roles/tests-integration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SV2 Integration Tests

This is a test crate and it can be used in order to test the behavior of different roles when
working together. Each role should have a `start_[role_name]` function under `common` folder that
can be called in order to run the role. In order to assert the behavior of the role or the messages
it exchanges with other roles, you can use the `Sniffer` helper in order to listen to the messages
exchanged between the roles, and assert those messages using the `assert_message_[message_type]`
function. For examples on how to use the `Sniffer` helper, you can check the
`sniffer_integration.rs` module or other tests in the `tests` folder.

All of our tests run in regtest network. We download the Template Provider node from
https://github.com/Sjors/bitcoin/releases/download. This is a pre-built binary that we use to run an
Stratum V2 compatible bitcoin node. Note that this is the only external dependency(and Role) that we
have in our tests.

## Running Instructions

In order to run the integration tests, you can use the following command:

```bash
$ git clone [email protected]:stratum-mining/stratum.git
$ cargo test --manifest-path=roles/Cargo.toml --verbose --test '*' -- --nocapture
```

## License
MIT OR Apache-2.0

0 comments on commit 1f80f31

Please sign in to comment.