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

chore: move suite of test programs up to repository root #3485

Merged
merged 7 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/auto-pr-rebuild-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
git config --local user.email [email protected]

- name: Run rebuild script
working-directory: tooling/nargo_cli/tests
working-directory: test_programs
run: |
chmod +x ./rebuild.sh
./rebuild.sh
Expand All @@ -108,14 +108,14 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: acir-artifacts
path: ./tooling/nargo_cli/tests/acir_artifacts
path: ./test_programs/acir_artifacts
retention-days: 10

- name: Check for changes in acir_artifacts directory
id: check_changes
if: ${{ github.ref_name }} == "master"
run: |
git diff --quiet tooling/nargo_cli/tests/acir_artifacts/ || echo "::set-output name=changes::true"
git diff --quiet test_programs/acir_artifacts/ || echo "::set-output name=changes::true"

- name: Create or Update PR
if: steps.check_changes.outputs.changes == 'true'
Expand All @@ -125,6 +125,6 @@ jobs:
commit-message: "chore: update acir artifacts"
title: "chore: Update ACIR artifacts"
body: "Automatic PR to update acir artifacts"
add-paths: tooling/nargo_cli/tests/acir_artifacts/*.gz
add-paths: test_programs/acir_artifacts/*.gz
labels: "auto-pr"
branch: "auto-pr-rebuild-script-branch"
8 changes: 3 additions & 5 deletions .github/workflows/gates_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/checkout@v4

- name: Download nargo binary
uses: actions/download-artifact@v3
Expand All @@ -69,10 +67,10 @@ jobs:
nargo -V

- name: Generate gates report
working-directory: ./tooling/nargo_cli/tests
working-directory: ./test_programs
run: |
./gates_report.sh
mv gates_report.json ../../../gates_report.json
mv gates_report.json ../gates_report.json

- name: Compare gates reports
id: gates_diff
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ result
*.pk
*.vk
**/Verifier.toml
**/contract
**/target
!tooling/nargo_cli/tests/acir_artifacts/*/target
!tooling/nargo_cli/tests/acir_artifacts/*/target/witness.gz
!test_programs/acir_artifacts/*/target
!test_programs/acir_artifacts/*/target/witness.gz
!compiler/wasm/noir-script/target

gates_report.json
Expand Down
5 changes: 0 additions & 5 deletions compiler/integration-tests/circuits/main/Nargo.toml

This file was deleted.

10 changes: 5 additions & 5 deletions compiler/integration-tests/scripts/codegen-verifiers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ self_path=$(dirname "$(readlink -f "$0")")
repo_root=$self_path/../../..

# Run codegen-verifier for 1_mul
mul_dir=$repo_root/tooling/nargo_cli/tests/execution_success/1_mul
mul_dir=$repo_root/test_programs/execution_success/1_mul
nargo --program-dir $mul_dir codegen-verifier

# Run codegen-verifier for main
main_dir=$repo_root/compiler/integration-tests/circuits/main
nargo --program-dir $main_dir codegen-verifier
# Run codegen-verifier for assert_statement
assert_statement_dir=$repo_root/test_programs/execution_success/assert_statement
nargo --program-dir $assert_statement_dir codegen-verifier

# Copy compiled contracts from the root of compiler/integration-tests
contracts_dir=$self_path/../contracts
mkdir $contracts_dir

cp $mul_dir/contract/1_mul/plonk_vk.sol $contracts_dir/1_mul.sol
cp $main_dir/contract/main/plonk_vk.sol $contracts_dir/main.sol
cp $assert_statement_dir/contract/assert_statement/plonk_vk.sol $contracts_dir/assert_statement.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ compilerLogLevel('INFO');

const test_cases = [
{
case: 'tooling/nargo_cli/tests/execution_success/1_mul',
case: 'test_programs/execution_success/1_mul',
numPublicInputs: 0,
},
{
case: 'compiler/integration-tests/circuits/main',
case: 'test_programs/execution_success/assert_statement',
numPublicInputs: 1,
},
];
Expand Down
2 changes: 1 addition & 1 deletion compiler/integration-tests/test/browser/recursion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ await initACVM();
compilerLogLevel('INFO');

const base_relative_path = '../../../../..';
const circuit_main = 'compiler/integration-tests/circuits/main';
const circuit_main = 'test_programs/execution_success/assert_statement';
const circuit_recursion = 'compiler/integration-tests/circuits/recursion';

function getCircuit(noirSource: string): CompiledProgram {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ compilerLogLevel('INFO');

const test_cases = [
{
case: 'tooling/nargo_cli/tests/execution_success/1_mul',
case: 'test_programs/execution_success/1_mul',
compiled: 'contracts/1_mul.sol:UltraVerifier',
numPublicInputs: 0,
},
{
case: 'compiler/integration-tests/circuits/main',
compiled: 'contracts/main.sol:UltraVerifier',
case: 'test_programs/execution_success/assert_statement',
compiled: 'contracts/assert_statement.sol:UltraVerifier',
numPublicInputs: 1,
},
];
Expand Down
12 changes: 6 additions & 6 deletions release-tests/test/6_array.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ test("promise resolved", async () => {
promiseResolved = true;
});

test("nargo builds ../tooling/nargo_cli/tests/execution_success/6_array sucessfully", async () => {
test("nargo builds ../test_programs/execution_success/6_array sucessfully", async () => {
await within(async () => {
cd("../tooling/nargo_cli/tests/execution_success/6_array");
cd("../test_programs/execution_success/6_array");
const command = `${NARGO_BIN} check`;

await $`${command}`.nothrow();
});
});

test("nargo creates proof ../tooling/nargo_cli/tests/execution_success/6_array sucessfully", async () => {
test("nargo creates proof ../test_programs/execution_success/6_array sucessfully", async () => {
await within(async () => {
cd("../tooling/nargo_cli/tests/execution_success/6_array");
cd("../test_programs/execution_success/6_array");
const command = `${NARGO_BIN} prove 6_array`;

await $`${command}`.nothrow();
});
});

test("nargo verifies proof ../tooling/nargo_cli/tests/execution_success/6_array sucessfully", async () => {
test("nargo verifies proof ../test_programs/execution_success/6_array sucessfully", async () => {
await within(async () => {
cd("../tooling/nargo_cli/tests/execution_success/6_array");
cd("../test_programs/execution_success/6_array");
const command = `${NARGO_BIN} verify 6_array`;

await $`${command}`.nothrow();
Expand Down
File renamed without changes.
Loading
Loading