Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/ethereum-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ethereum Tests
name: Eth

concurrency:
cancel-in-progress: true
Expand All @@ -11,8 +11,7 @@ on:
branches: [main, "release/**"]

jobs:
tests-stable:
name: Ethereum Tests (Stable)
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
Expand Down Expand Up @@ -40,14 +39,14 @@ jobs:
- name: Install cross
run: cargo install cross

- name: Run Ethereum tests
- name: Statetests
run: |
cross run --target ${{matrix.target}} --profile ${{ matrix.profile }} -p revme -- statetest \
ethtests/GeneralStateTests/ \
ethtests/LegacyTests/Constantinople/GeneralStateTests/ \
tests/eof/state_tests \
tests/stable/state_tests
- name: Run EOF validation tests
- name: EOF validation
run: |
cross run --target ${{matrix.target}} --profile ${{ matrix.profile }} -p revme -- eof-validation \
tests/eof/eof_tests
Expand Down
16 changes: 9 additions & 7 deletions bins/revme/src/cmd/eofvalidation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,33 @@ pub fn run_test(path: &Path) -> Result<(), Error> {
}
let mut types_of_error: BTreeMap<ErrorType, usize> = BTreeMap::new();
for test_file in test_files {
let s = std::fs::read_to_string(test_file).unwrap();
let s = std::fs::read_to_string(&test_file).unwrap();
let suite: TestSuite = serde_json::from_str(&s).unwrap();
for (name, test_unit) in suite.0 {
for (vector_name, test_vector) in test_unit.vectors {
if skip_test(&vector_name) {
continue;
}
test_sum += 1;
let kind = if test_vector.container_kind.is_some() {
Some(CodeType::Initcode)
} else {
Some(CodeType::Runtime)
let kind = match test_vector.container_kind.as_deref() {
Some("RUNTIME") => CodeType::Runtime,
Some("INITCODE") => CodeType::Initcode,
None => CodeType::Runtime,
_ => return Err(Error::Custom("Invalid container kind")),
};
// In future this can be generalized to cover multiple forks, Not just Osaka.
let Some(test_result) = test_vector.results.get("Osaka") else {
// if test does not have a result that we can compare to, we skip it
println!("Test without result: {} - {}", name, vector_name);
continue;
};
let res = validate_raw_eof_inner(test_vector.code.clone(), kind);
let res = validate_raw_eof_inner(test_vector.code.clone(), Some(kind));
if test_result.result != res.is_ok() {
println!(
"\nTest failed: {} - {}\nresult:{:?}\nrevm err_result:{:#?}\nExpected exception:{:?}\nbytes:{:?}\n",
"\nTest failed: {} - {}\nPath:{:?}\nresult:{:?}\nrevm err_result:{:#?}\nExpected exception:{:?}\nbytes:{:?}\n",
name,
vector_name,
test_file,
test_result.result,
res.as_ref().err(),
test_result.exception,
Expand Down
Loading