Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/nightly-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:
run: yarn --immutable

- name: Run all tests (including oracle tests)
working-directory: ./fuzz_test
run: ./run_direct_test.sh
run: ./scripts/run.sh

- name: Run formatter
run: nargo fmt --check
Expand All @@ -52,4 +51,3 @@ jobs:
with:
update_existing: true
filename: .github/NIGHTLY_CANARY_DIED.md

3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ jobs:
run: yarn --immutable

- name: Run all tests
working-directory: ./fuzz_test
run: ./run.sh
run: ./scripts/run.sh

format:
runs-on: ubuntu-latest
Expand Down
18 changes: 0 additions & 18 deletions fuzz_test/run.sh

This file was deleted.

38 changes: 38 additions & 0 deletions scripts/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
set -eu

# Allow callers to override the RPC server port.
export RPC_PORT="${RPC_PORT:-8095}"

# Resolve repository paths relative to this script.
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
project_dir="$(cd "$script_dir/.." && pwd)"
fuzz_test_dir="$project_dir/fuzz_test"

(
# Run the TypeScript oracle server from its package directory.
cd "$fuzz_test_dir"

# Install oracle server dependencies when running from a fresh clone.
if [ ! -d "node_modules" ]; then
echo "Installing RPC server dependencies..."
yarn install --frozen-lockfile 2>&1 || yarn install 2>&1
fi

# Start the TypeScript RPC server in the background.
echo "Starting direct TypeScript RPC server..."
yarn tsx rpc_server.ts &
TS_SERVER_PID=$!

# Stop the RPC server when the test command exits.
cleanup() {
kill "$TS_SERVER_PID" 2>/dev/null || true
}
trap cleanup EXIT

# Wait briefly for the RPC server to accept requests.
sleep 2

# Run the Noir tests against the local oracle resolver.
nargo --program-dir="$project_dir" test --oracle-resolver "http://localhost:${RPC_PORT}"
)
Loading