Skip to content

Commit

Permalink
Merge pull request #129 from near/zkasm_scripts
Browse files Browse the repository at this point in the history
Add ability to pass arguments to zkasm-result.py
  • Loading branch information
aborg-dev authored Dec 1, 2023
2 parents cacbb5f + 5938dd5 commit 2b6eeef
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ jobs:
cache: 'npm'
cache-dependency-path: tests/zkasm/package-lock.json
- run: npm ci --prefix tests/zkasm
- run: ./ci/test-zkasm.sh
- run: ./ci/spectest-zkasm.sh
- run: ./ci/test-all-zkasm.sh


rustfmt:
Expand Down
11 changes: 0 additions & 11 deletions ci/spectest-zkasm.sh

This file was deleted.

16 changes: 16 additions & 0 deletions ci/test-all-zkasm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -o pipefail
set -eux

ALL_ARGS=$@

function run_tests() {
./ci/test-zkasm.sh $1 $ALL_ARGS
}

run_tests "cranelift/zkasm_data"
run_tests "cranelift/zkasm_data/spectest/i32"
run_tests "cranelift/zkasm_data/spectest/i64"
run_tests "cranelift/zkasm_data/spectest/conversions"
run_tests "cranelift/zkasm_data/benchmarks/fibonacci"
7 changes: 5 additions & 2 deletions ci/test-zkasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ if [ ! -d "tests/zkasm/node_modules" ]; then
npm install --prefix tests/zkasm
fi

TEST_PATH=${1:-"cranelift/zkasm_data"}
# All arguments will be forwarded to `ci/zkasm-result.py`.
ALL_ARGS=$@
# The first argument is expected to be a path to a folder with tests.
TEST_PATH=$1
TEST_RESULTS_PATH=$(mktemp)
npm test --prefix tests/zkasm "../../${TEST_PATH}/generated" $TEST_RESULTS_PATH
python3 ci/zkasm-result.py $TEST_PATH < $TEST_RESULTS_PATH
python3 ci/zkasm-result.py $ALL_ARGS < $TEST_RESULTS_PATH

0 comments on commit 2b6eeef

Please sign in to comment.