Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate Precompile E2E Tests #458

Closed
5 tasks
aaronbuchwald opened this issue Jan 26, 2023 · 2 comments
Closed
5 tasks

Automate Precompile E2E Tests #458

aaronbuchwald opened this issue Jan 26, 2023 · 2 comments

Comments

@aaronbuchwald
Copy link
Collaborator

We currently write precompile unit tests in HardHat where we specify a genesis file that activates the precompile to launch a network and then run a HardHat test suite on top of the network.

This currently requires adding a precompile test explicitly that specifies the HardHat file and the genesis file to use in ginkgo.

We should change this test in ginkgo to scan the repo for all of the HardHat files and corresponding genesis.json files, so that it can automagically orchestrate and run each test. To do this, it should scan the directory of HardHat test files, find a genesis file with the corresponding name, and then spin up a Subnet with that genesis file, and execute the HardHat tests on top of that Subnet.

To make sure that we do not accidentally create HardHat tests that are not caught and do not run in CI, the precompile test should make sure that there are the same number of HardHat test files as there are genesis files and that each test file has a corresponding genesis file.

This will reduce the number of places that precompile developers need to touch code within Subnet-EVM in order to write their e2e tests.

  • Align the names of all genesis files with the names of the corresponding Hardhat tests in contract-examples/
  • Move all genesis JSON files into the contract-examples/ directory
  • Update the precompile ginkgo tests to scan the HardHat and genesis JSON files as described and spin up the Subnets to run them
  • Add a check to ensure that there is a HardHat test for each precompile (number of precompile addresses or registered modules)
  • Update the PrecompileGen tutorial to reflect the new process for writing e2e tests for a precompile
@ceyonur
Copy link
Collaborator

ceyonur commented Jun 16, 2023

We have slightly changed e2e tests to be run in a custom environments and commands. We should not force e2e tests to use only hardhat, but they should be able to run various test commands as well. See #672

@aaronbuchwald
Copy link
Collaborator Author

Closing this issue as not worthwhile for now. May be worth re-considering in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

No branches or pull requests

2 participants