Skip to content

Commit 6aac0d0

Browse files
authored
chore(levm): improve organization of new levm test runner (#3958)
**Motivation** - this runner was inside the same folder as the other runner and also the internal structure wasn't the most organized **Description** - move files - improve makefile - improve files structure <img width="290" height="416" alt="image" src="https://github.com/user-attachments/assets/7d4f6583-2af1-4b3f-b77b-dcf355dee897" />
1 parent d744176 commit 6aac0d0

File tree

22 files changed

+101
-40
lines changed

22 files changed

+101
-40
lines changed

Cargo.lock

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
members = [
33
"cmd/ef_tests/blockchain",
44
"cmd/ef_tests/state",
5+
"cmd/ef_tests/state_v2",
56
"cmd/ethrex",
67
"cmd/ethrex_replay",
78
"crates/blockchain",

cmd/ef_tests/state/Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,3 @@ blst = ["ethrex-vm/blst"]
4949
[[test]]
5050
name = "all"
5151
harness = false
52-
53-
[[test]]
54-
name = "new_runner"
55-
harness = false
56-
path = "./runner_v2/run.rs"

cmd/ef_tests/state/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,3 @@ samply-benchmarks: ## ⚡️ Run benchmarks and create samply profiling file
159159
$(call run_samply,ERC20Approval,REPETITIONS_SLOW,BENCH_APPROVAL_ITERATIONS)
160160
$(call run_samply,ERC20Transfer,REPETITIONS_SLOW,BENCH_TRANSFER_ITERATIONS)
161161
$(call run_samply,ERC20Mint,REPETITIONS_SLOW,BENCH_MINT_ITERATIONS)
162-
163-
## New EF state tests runner
164-
run-new-runner:
165-
cargo test --package ef_tests-state --test new_runner --release -- $(flags)

cmd/ef_tests/state/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ mod deserialize;
22
pub mod parser;
33
mod report;
44
pub mod runner;
5-
pub mod runner_v2;
65
pub mod types;
76
mod utils;

cmd/ef_tests/state_v2/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
./success_report.txt
2+
./failure_report.txt
3+
# vectors is not yet part of this folder but will be soon.
4+
./vectors

cmd/ef_tests/state_v2/Cargo.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[package]
2+
name = "ef_tests-statev2"
3+
version.workspace = true
4+
edition.workspace = true
5+
6+
[dependencies]
7+
ethrex-blockchain.workspace = true
8+
ethrex-common.workspace = true
9+
ethrex-storage.workspace = true
10+
ethrex-rlp.workspace = true
11+
ethrex-vm.workspace = true
12+
ethrex-levm.workspace = true
13+
14+
serde.workspace = true
15+
serde_json.workspace = true
16+
bytes.workspace = true
17+
hex.workspace = true
18+
keccak-hash.workspace = true
19+
thiserror.workspace = true
20+
clap.workspace = true
21+
clap_complete.workspace = true
22+
tokio = { workspace = true, features = ["full"] }
23+
colored = "2.1.0"
24+
alloy-rlp = "0.3.12"
25+
26+
[dev-dependencies]
27+
hex = "0.4.3"
28+
29+
[features]
30+
default = ["c-kzg", "blst"]
31+
c-kzg = ["ethrex-vm/c-kzg", "ethrex-levm/c-kzg", "ethrex-common/c-kzg"]
32+
blst = ["ethrex-vm/blst"]

cmd/ef_tests/state_v2/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.PHONY: help run-tests
2+
3+
help: ## 📚 Show help for each of the Makefile recipes
4+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
5+
6+
run-tests: ## 🧪 Run all tests with optional flags. Usage: make run-tests flags="--flag1 --flag2"
7+
cargo test --package ef_tests-statev2 --test all --release -- $(flags)
8+

cmd/ef_tests/state/runner_v2/README.md renamed to cmd/ef_tests/state_v2/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ make run-new-runner
2727

2828
This will parse and execute everything in the `./vectors` directory by default.
2929

30-
> You can also run `cargo test --package ef_tests-state --test new_runner --release`
30+
> You can also run `cargo run --package ef_tests-statev2 --release`
3131
3232
## Execution options
3333
In case you do not want to parse and execute everything in the `vectors/` directory there are three flags that can be used to specify files to be run:
@@ -64,9 +64,9 @@ make run-new-runner flags="--skip-files chainId.json,transStorageReset.json"
6464

6565
## Reports
6666
For tests that succeded, a report can be found at:
67-
`cmd/ef_tests/state/runner_v2/success_report.txt`
67+
`cmd/ef_tests/state_v2/success_report.txt`
6868

6969
For tests that failed, a report can be found at:
70-
`cmd/ef_tests/state/runner_v2/failure_report.txt`
70+
`cmd/ef_tests/state_v2/failure_report.txt`
7171

7272
If none of the tests failed the report will not get generated at all. In case any of the tests did fail, the report will show the differences with the expected post state for each failing test case.

cmd/ef_tests/state_v2/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod modules;

0 commit comments

Comments
 (0)