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

Make integration tests easier to run locally #2880

Closed
TomAFrench opened this issue Sep 28, 2023 · 1 comment · Fixed by #2890
Closed

Make integration tests easier to run locally #2880

TomAFrench opened this issue Sep 28, 2023 · 1 comment · Fixed by #2890
Assignees
Labels
enhancement New feature or request

Comments

@TomAFrench
Copy link
Member

Problem

Currently running the integration tests locally is a bit of a pain as it requires manually copying a number of files around and deploying contracts. We should have shell scripts for this so that the experience can be as simple as opening two shells (one for anvil and another for the javascript tests) and running two commands.

Happy Case

We should define shell scripts which can be run locally to simplify running these tests locally.

forge-init.sh: This should set up the foundry project for the verifier contracts. We should delete any unnecessary files from here as part of this so we're not compiling things we don't need.

- name: Create new Foundry project
run: forge init --no-git --no-commit --force foundry-project

codegen-verifiers.sh: This should codegen the verifier contracts and pull them into the foundry project.

- name: Run codegen-verifier for 1_mul
working-directory: tooling/nargo_cli/tests/execution_success/1_mul
run: nargo codegen-verifier
- name: Run codegen-verifier for main
working-directory: compiler/integration-tests/test/circuits/main
run: nargo codegen-verifier
- name: Copy compiled contracts
run: |
cp tooling/nargo_cli/tests/execution_success/1_mul/contract/1_mul/plonk_vk.sol foundry-project/src/1_mul.sol
cp compiler/integration-tests/test/circuits/main/contract/main/plonk_vk.sol foundry-project/src/main.sol

deploy-verifiers.sh: This would start up an anvil instance and deploy the contracts, writing the contract addresses to a json file.

- name: Run Anvil
run: |
anvil > /dev/null 2>&1 &
sleep 10

- name: Forge build
working-directory: foundry-project
run: forge build
- name: Forge deploy
working-directory: foundry-project
run: |
forge create --rpc-url http://127.0.0.1:8545 --mnemonic "test test test test test test test test test test test junk" src/1_mul.sol:UltraVerifier --json > mul_output.json
forge create --rpc-url http://127.0.0.1:8545 --mnemonic "test test test test test test test test test test test junk" src/main.sol:UltraVerifier --json > main_output.json

We can also have a overarching script to run all of these in order.

Alternatives Considered

We'll probably want to have a yarn command to rebuild any of the dependencies of the integration tests package.

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@TomAFrench TomAFrench added the enhancement New feature or request label Sep 28, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Sep 28, 2023
@jonybur jonybur linked a pull request Sep 29, 2023 that will close this issue
5 tasks
@kobyhallx
Copy link
Contributor

Could we isolate solidity to it's own file? This way I can progress with work in more fine grained fashion.

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants