Skip to content

Commit 6f736b5

Browse files
Bengt Lofgrena5-pickle
authored andcommitted
README updated to actually show how to run the tests
1 parent 70539c2 commit 6f736b5

File tree

1 file changed

+27
-1
lines changed
  • solana/modules/matching-engine-testing/tests

1 file changed

+27
-1
lines changed

solana/modules/matching-engine-testing/tests/README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,36 @@ Each test is a function that is annotated with `#[tokio::test]`.
1010

1111
Each test is a test for a specific scenario, and uses the `TestingEngine` to execute a series of instruction triggers.
1212

13-
The `TestingEngine` is initialized with a `TestingContext`. The `TestingContext` holds the solana program test context, the actors, the transfer direction, created vaas, as well as some constants.
13+
The `TestingEngine` is initialized with a `TestingContext`. The `TestingContext` holds the the `TestingActors`, the transfer direction, created vaas, as well as some constants.
14+
15+
The `TestingActors` are structs that hold information for any keypair that is setup before the tests are conducted. These include the `owner` the `owner_assistant` and the `Solvers`.
1416

1517
The `TestingEngine` is used to execute the instruction triggers in the order they are provided. See the `testing_engine/engine.rs` file for more details.
1618

19+
## How to run the tests
20+
21+
### Setup for running the tests
22+
23+
The program must be built. This is done by entering the `solana/programs/matching-enginge` directory and running `cargo build-sbf --features mainnet`. With an incorrect `so` file, the tests will not be run against the correct program.
24+
25+
```bash
26+
cd solana/programs/matching-engine
27+
cargo build-sbf --features mainnet
28+
```
29+
30+
### Running the tests
31+
32+
The tests are run by the following command
33+
34+
```bash
35+
cd solana/modules/matching-engine-testing
36+
cargo test-sbf --features mainnet -- --show-output --test-threads 5
37+
```
38+
39+
#### ❗❗ NOTE when running tests
40+
In order to run tests successfully and avoiding an annoying error due to an RpcTimeout, use a low number of `--test-threads`. This will depend on the local machine. The current recommended threads is `5`.
41+
42+
1743
## Happy path integration tests
1844

1945
### Initialize program

0 commit comments

Comments
 (0)