-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1297 from jbesraa/2024-12-13-int-test-cleanup
Integration tests cleanup
- Loading branch information
Showing
15 changed files
with
656 additions
and
643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
name: Integration Tests | ||
|
||
jobs: | ||
ci: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-musl | ||
|
||
steps: | ||
- name: Use stable toolchain | ||
uses: actions/checkout@v4 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Roles Integration Tests | ||
run: | | ||
cargo test --manifest-path=roles/Cargo.toml --verbose --test '*' -- --nocapture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.