Skip to content

Commit

Permalink
Improve docs [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
FabijanC committed May 3, 2024
1 parent f0457b0 commit eca7bc3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ To retrieve the current configuration of Devnet, send a GET request to `/config`

## Development

### Installation

Some developer scripts used in this project depend on Python 3, with dependencies specified in `scripts/requirements.txt`. You may want to [install them in a virtual environment](https://docs.python.org/3/library/venv.html#creating-virtual-environments).

### Development - Visual Studio Code

It is highly recommended to get familiar with [Visual Studio Code Dev Containers](https://code.visualstudio.com/docs/devcontainers/create-dev-container#_dockerfile) and install [rust-analyzer](https://code.visualstudio.com/docs/languages/rust) extension.
Expand Down Expand Up @@ -545,13 +549,13 @@ To speed up development, you can put all the previous steps (and more) in a scri

### Development - Testing

### Prerequisites
#### Prerequisites

Some tests require the `anvil` command, so you need to [install Foundry](https://book.getfoundry.sh/getting-started/installation). The `anvil` command might not be usable by tests if you run them using VS Code's `Run Test` button available just above the test case. Either run tests using a shell which has foundry/anvil in `PATH`, or modify the BackgroundAnvil Command to specify `anvil` by its path on your system.

To ensure that integration tests pass, be sure to have run `cargo build --release` or `cargo run --release` prior to testing. This builds the production target used in integration tests, so spawning BackgroundDevnet won't time out.

### Test execution
#### Test execution

Run all tests using all available CPUs with:

Expand All @@ -565,6 +569,10 @@ The previous command might cause your testing to die along the way due to memory
$ cargo test --jobs <N>
```

#### Benchmarking

To test if your contribution presents an improvement in execution time, check out the script at `scripts/benchmark/command_stat_test.py`.

### Development - Docker

Due to internal needs, images with arch suffix are built and pushed to Docker Hub, but this is not mentioned in the user docs as users should NOT be needing it.
Expand Down
11 changes: 9 additions & 2 deletions scripts/benchmark/command_stat_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/usr/bin/env python

"""
Tests if a command performs faster using independent t-test. You need to define the
command constants and may change the other constants defined at the top of this script.
This program tests if a command performs faster using independent t-test. At the top of the file,
there are command placeholders which you need to define. You may change other constants
if needed. Optionally, modify `performance_program`, a function used to simulate the
work that is timed.
The program will start the command defined in `ORIGINAL_COMMAND`,
run `performance_program` SAMPLE_SIZE times, store these times,
and repeat the same process for `IMPROVED_COMMAND`.
The times shall than be statistically tested and the result printed.
"""

import subprocess
Expand Down

0 comments on commit eca7bc3

Please sign in to comment.