Skip to content

Commit

Permalink
Skip generating Copier files for failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-dc committed May 21, 2024
1 parent 5081ad5 commit dcd2850
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion test/unittests/state_transition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void state_transition::TearDown()
EXPECT_TRUE(expect.post.contains(addr)) << "unexpected account " << addr;
}

if (!export_file_path.empty())
if (!export_file_path.empty() && !skip_generate_copier)

Check warning on line 150 in test/unittests/state_transition.cpp

View check run for this annotation

Codecov / codecov/patch

test/unittests/state_transition.cpp#L150

Added line #L150 was not covered by tests
export_state_test(res, state);
}

Expand Down
1 change: 1 addition & 0 deletions test/unittests/state_transition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class state_transition : public ExportableFixture
std::string_view trace;
};

bool skip_generate_copier = false;

evmc_revision rev = EVMC_SHANGHAI;
uint64_t block_reward = 0;
Expand Down
14 changes: 14 additions & 0 deletions test/unittests/state_transition_block_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ TEST_F(state_transition, block_apply_withdrawal)
block.withdrawals = {{0, 0, withdrawal_address, 3}};
tx.to = To;
expect.post[withdrawal_address].balance = intx::uint256{3} * 1'000'000'000;

skip_generate_copier = true; // Skip ethereum test generation because the withdrawals are not available in

Check warning on line 19 in test/unittests/state_transition_block_test.cpp

View check run for this annotation

Codecov / codecov/patch

test/unittests/state_transition_block_test.cpp#L19

Added line #L19 was not covered by tests
// retesteth.
}

TEST_F(state_transition, known_block_hash)
Expand All @@ -30,6 +33,9 @@ TEST_F(state_transition, known_block_hash)
0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421_bytes32;
expect.post[To].storage[0x01_bytes32] =
0x0000000000000000000000000000000000000000000000000000000000000111_bytes32;

skip_generate_copier = true; // Skip generating test because the block hash is not available in

Check warning on line 37 in test/unittests/state_transition_block_test.cpp

View check run for this annotation

Codecov / codecov/patch

test/unittests/state_transition_block_test.cpp#L37

Added line #L37 was not covered by tests
// retesteth.
}

TEST_F(state_transition, known_block_hash_fake)
Expand All @@ -41,6 +47,9 @@ TEST_F(state_transition, known_block_hash_fake)
0x044852b2a670ade5407e78fb2863c51de9fcb96542a07186fe3aeda6bb8a116d_bytes32;
expect.post[To].storage[0x01_bytes32] =
0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6_bytes32;

skip_generate_copier = true; // Skip generating test because evmone-t8n does not return the

Check warning on line 51 in test/unittests/state_transition_block_test.cpp

View check run for this annotation

Codecov / codecov/patch

test/unittests/state_transition_block_test.cpp#L51

Added line #L51 was not covered by tests
// fake block hash
}

TEST_F(state_transition, block_apply_ommers_reward)
Expand All @@ -59,6 +68,8 @@ TEST_F(state_transition, block_apply_ommers_reward)

// Two ommers +1/32 * block_reward for each. +21000 cost of the tx goes to coinbase.
expect.post[Coinbase].balance = 21000 + intx::uint256{block_reward} + block_reward / 16;

skip_generate_copier = true; // Skip ethereum test generation because the ommers are not available in ethereum state tests.

Check warning on line 72 in test/unittests/state_transition_block_test.cpp

View check run for this annotation

Codecov / codecov/patch

test/unittests/state_transition_block_test.cpp#L72

Added line #L72 was not covered by tests
}

TEST_F(state_transition, eip7516_blob_base_fee)
Expand All @@ -70,4 +81,7 @@ TEST_F(state_transition, eip7516_blob_base_fee)
pre.insert(*tx.to, {.code = sstore(0x4a, OP_BLOBBASEFEE)});

expect.post[To].storage[0x4a_bytes32] = 0xabcd_bytes32;

skip_generate_copier = true; // Skip ethereum test generation because the blob base fee is not available in

Check warning on line 85 in test/unittests/state_transition_block_test.cpp

View check run for this annotation

Codecov / codecov/patch

test/unittests/state_transition_block_test.cpp#L85

Added line #L85 was not covered by tests
// retesteth.
}
2 changes: 2 additions & 0 deletions test/unittests/state_transition_call_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ TEST_F(state_transition, delegatecall_static_legacy)
// SSTORE failed.
expect.post[callee1].storage[0x01_bytes32] = 0xdd_bytes32;
expect.post[callee2].storage[0x01_bytes32] = 0xdd_bytes32;

skip_generate_copier = true;

Check warning on line 57 in test/unittests/state_transition_call_test.cpp

View check run for this annotation

Codecov / codecov/patch

test/unittests/state_transition_call_test.cpp#L57

Added line #L57 was not covered by tests
}
5 changes: 5 additions & 0 deletions test/unittests/state_transition_eip663_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ TEST_F(state_transition, dupn)
});
expect.post[*tx.to].storage[0x00_bytes32] = 0x01_bytes32;
expect.post[*tx.to].storage[0x01_bytes32] = 0x02_bytes32;
skip_generate_copier = true;

Check warning on line 22 in test/unittests/state_transition_eip663_test.cpp

View check run for this annotation

Codecov / codecov/patch

test/unittests/state_transition_eip663_test.cpp#L22

Added line #L22 was not covered by tests
}

TEST_F(state_transition, swapn)
Expand All @@ -32,6 +33,8 @@ TEST_F(state_transition, swapn)
});
expect.post[*tx.to].storage[0x00_bytes32] = 0x01_bytes32;
expect.post[*tx.to].storage[0x01_bytes32] = 0x02_bytes32;

skip_generate_copier = true;

Check warning on line 37 in test/unittests/state_transition_eip663_test.cpp

View check run for this annotation

Codecov / codecov/patch

test/unittests/state_transition_eip663_test.cpp#L37

Added line #L37 was not covered by tests
}

TEST_F(state_transition, exchange)
Expand All @@ -46,4 +49,6 @@ TEST_F(state_transition, exchange)
expect.post[*tx.to].storage[0x00_bytes32] = 0x03_bytes32;
expect.post[*tx.to].storage[0x01_bytes32] = 0x01_bytes32;
expect.post[*tx.to].storage[0x02_bytes32] = 0x02_bytes32;

skip_generate_copier = true;

Check warning on line 53 in test/unittests/state_transition_eip663_test.cpp

View check run for this annotation

Codecov / codecov/patch

test/unittests/state_transition_eip663_test.cpp#L53

Added line #L53 was not covered by tests
}

0 comments on commit dcd2850

Please sign in to comment.