Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

[Tests] Refactor execution_test.go #1278

Open
silasdavis opened this issue Sep 30, 2019 · 0 comments
Open

[Tests] Refactor execution_test.go #1278

silasdavis opened this issue Sep 30, 2019 · 0 comments

Comments

@silasdavis
Copy link
Contributor

execution_test.go is particularly painful to work with because:

  • It has layers of cruft from legacy refactors that relate to previous ways of handling events etc
  • It has different types of harness for different tests
  • It has some helper functions that obscure the reason for failures (e.g. snatives tests)
  • It mixes styles of test assertion (notable it does not use testify for some assertions where it could
  • It mixes testing the execution/transaction machinery with testing low-level details of the EVM

We should factor out all EVM bytecode tests into evm_test.go so we should tackle #1277 before this ticket.

execution_test.go should test the plumbing our executor and state and only test EVM code as a side-effect. We should therefore attempt to test all EVM code in isolation first before considering failures in execution_test.go. We will need variety of EVM code to illicit all failure modes so we should just test all of it with each execution test.

We need to distill the fundamentals of what we are testing with the executor. I think we should probably have a single test that loops over each transaction type each of which loops over different payloads and then different commit conditions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants