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: 2 additions & 2 deletions .github/workflows/cli-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ jobs:

- name: Build CLI
run: |
just cli build
just cli::build

- name: Run CLI tests with V1
run: |
just cli test
just cli::test

- name: Display prover logs on failure
if: failure()
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cli-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ jobs:

- name: Build CLI with V2
run: |
just cli build
just cli::build

- name: Run CLI tests with V2
run: |
just cli test
just cli::test

- name: Display prover logs on failure
if: failure()
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/forester-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ jobs:
du -sh /home/runner/work/* | sort -hr | head -n 10

- name: Build CLI
run: just cli build
run: just cli::build

- name: Test
run: just forester test
run: just forester::test

compressible-tests:
name: Forester compressible tests
Expand Down Expand Up @@ -112,13 +112,13 @@ jobs:
cache-key: "rust"

- name: Build CLI
run: just cli build
run: just cli::build

- name: Test compressible PDA
run: just forester test-compressible-pda
run: just forester::test-compressible-pda

- name: Test compressible Mint
run: just forester test-compressible-mint
run: just forester::test-compressible-mint

- name: Test compressible ctoken
run: just forester test-compressible-ctoken
run: just forester::test-compressible-ctoken
11 changes: 5 additions & 6 deletions .github/workflows/js-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ jobs:

- name: Build CLI
run: |
just cli build
just cli::build

- name: Run stateless.js tests with V2
run: |
echo "Running stateless.js tests with retry logic (max 2 attempts)..."
attempt=1
max_attempts=2
until just js test-stateless; do
until just js::test-stateless; do
attempt=$((attempt + 1))
if [ $attempt -gt $max_attempts ]; then
echo "Tests failed after $max_attempts attempts"
Expand All @@ -84,7 +84,7 @@ jobs:
echo "Running compressed-token unit tests with retry logic (max 2 attempts)..."
attempt=1
max_attempts=2
until just js test-compressed-token-unit-v2; do
until just js::test-compressed-token-unit-v2; do
attempt=$((attempt + 1))
if [ $attempt -gt $max_attempts ]; then
echo "Tests failed after $max_attempts attempts"
Expand All @@ -100,8 +100,7 @@ jobs:
echo "Running compressed-token ctoken tests with retry logic (max 2 attempts)..."
attempt=1
max_attempts=2
cd js/compressed-token
until LIGHT_PROTOCOL_VERSION=V2 pnpm test:e2e:ctoken:all; do
until just js::test-compressed-token-e2e-ctoken-v2; do
attempt=$((attempt + 1))
if [ $attempt -gt $max_attempts ]; then
echo "Tests failed after $max_attempts attempts"
Expand All @@ -114,7 +113,7 @@ jobs:

- name: Run sdk-anchor-test TypeScript tests with V2
run: |
just sdk-tests build-anchor-test
just sdk-tests::build-anchor-test
cd sdk-tests/sdk-anchor-test && npm run test-ts

- name: Display prover logs on failure
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ jobs:

- name: Build CLI
run: |
just cli build
just cli::build

- name: Run stateless.js tests with V1
run: |
echo "Running stateless.js tests with retry logic (max 2 attempts)..."
attempt=1
max_attempts=2
until just js test-stateless; do
until just js::test-stateless; do
attempt=$((attempt + 1))
if [ $attempt -gt $max_attempts ]; then
echo "Tests failed after $max_attempts attempts"
Expand All @@ -84,7 +84,7 @@ jobs:
echo "Running compressed-token tests with retry logic (max 2 attempts)..."
attempt=1
max_attempts=2
until just js test-compressed-token; do
until just js::test-compressed-token; do
attempt=$((attempt + 1))
if [ $attempt -gt $max_attempts ]; then
echo "Tests failed after $max_attempts attempts"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
rustup component add --toolchain nightly rustfmt
rustup component add --toolchain nightly clippy
rustup component add --toolchain 1.86-x86_64-unknown-linux-gnu clippy
./scripts/lint.sh
just lint
42 changes: 19 additions & 23 deletions .github/workflows/programs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,21 @@ jobs:
matrix:
include:
- program: account-compression-and-registry
sub-tests: '["cargo-test-sbf -p account-compression-test", "cargo-test-sbf -p registry-test"]'
test-targets: '["test-account-compression", "test-registry"]'
- program: light-system-program-address
sub-tests: '["cargo-test-sbf -p system-test -- test_with_address", "cargo-test-sbf -p e2e-test", "cargo-test-sbf -p compressed-token-test --test light_token"]'
test-targets: '["test-system-address", "test-e2e", "test-compressed-token-light-token"]'
- program: light-system-program-compression
sub-tests: '["cargo-test-sbf -p system-test -- test_with_compression", "cargo-test-sbf -p system-test --test test_re_init_cpi_account"]'
test-targets: '["test-system-compression", "test-system-re-init"]'
- program: compressed-token-and-e2e
sub-tests: '["cargo test -p light-compressed-token", "cargo-test-sbf -p compressed-token-test --test v1", "cargo-test-sbf -p compressed-token-test --test mint"]'
test-targets: '["test-compressed-token-unit", "test-compressed-token-v1", "test-compressed-token-mint"]'
- program: compressed-token-batched-tree
sub-tests: '["cargo-test-sbf -p compressed-token-test -- test_transfer_with_photon_and_batched_tree"]'
test-targets: '["test-compressed-token-batched-tree"]'
- program: system-cpi-test
sub-tests:
'["cargo-test-sbf -p system-cpi-test", "cargo test -p light-system-program-pinocchio",
"cargo-test-sbf -p system-cpi-v2-test -- --skip functional_ --skip event::parse", "cargo-test-sbf -p system-cpi-v2-test -- event::parse",
"cargo-test-sbf -p compressed-token-test --test transfer2"
]'
test-targets: '["test-system-cpi", "test-system-program-pinocchio", "test-system-cpi-v2", "test-system-cpi-v2-event-parse", "test-compressed-token-transfer2"]'
- program: system-cpi-test-v2-functional-read-only
sub-tests: '["cargo-test-sbf -p system-cpi-v2-test -- functional_read_only"]'
test-targets: '["test-system-cpi-v2-functional-read-only"]'
- program: system-cpi-test-v2-functional-account-infos
sub-tests: '["cargo-test-sbf -p system-cpi-v2-test -- functional_account_infos"]'
test-targets: '["test-system-cpi-v2-functional-account-infos"]'
steps:
- name: Checkout sources
uses: actions/checkout@v6
Expand All @@ -85,22 +81,21 @@ jobs:

- name: Build CLI
run: |
just cli build
just cli::build

- name: ${{ matrix.program }}
run: |

IFS=',' read -r -a sub_tests <<< "${{ join(fromJSON(matrix['sub-tests']), ', ') }}"
for subtest in "${sub_tests[@]}"
IFS=',' read -r -a test_targets <<< "${{ join(fromJSON(matrix['test-targets']), ', ') }}"
for target in "${test_targets[@]}"
do
echo "$subtest"
echo "Running: just program-tests::$target"

# Retry logic for flaky batched-tree test
if [[ "$subtest" == *"test_transfer_with_photon_and_batched_tree"* ]]; then
if [[ "$target" == "test-compressed-token-batched-tree" ]]; then
echo "Running flaky test with retry logic (max 3 attempts)..."
attempt=1
max_attempts=3
until RUSTFLAGS="-D warnings" eval "$subtest"; do
until just program-tests::"$target"; do
attempt=$((attempt + 1))
if [ $attempt -gt $max_attempts ]; then
echo "Test failed after $max_attempts attempts"
Expand All @@ -111,10 +106,11 @@ jobs:
done
echo "Test passed on attempt $attempt"
else
RUSTFLAGS="-D warnings" eval "$subtest"
if [ "$subtest" == "cargo-test-sbf -p e2e-test" ]; then
just programs build-compressed-token-small
RUSTFLAGS="-D warnings" eval "$subtest -- --test test_10_all"
just program-tests::"$target"
# Run additional e2e-all test after e2e test
if [ "$target" == "test-e2e" ]; then
echo "Running: just program-tests::test-e2e-all"
just program-tests::test-e2e-all
fi
fi
done
60 changes: 33 additions & 27 deletions .github/workflows/prover-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ jobs:
matrix:
test-suite:
- name: "Unit tests"
command: "go test ./prover/... -timeout 60m"
target: "test-unit"
- name: "Worker selection tests"
command: "go test -v -run TestWorkerSelection -timeout 5m"
target: "test-worker-selection"
- name: "Batch operations queue routing tests"
command: "go test -v -run TestBatchOperations -timeout 5m"
target: "test-batch-operations"
steps:
- name: Checkout sources
uses: actions/checkout@v6
Expand All @@ -93,10 +93,12 @@ jobs:
restore-keys: |
${{ runner.os }}-go-

- name: Install just
uses: extractions/setup-just@v2

- name: Run ${{ matrix.test-suite.name }}
run: |
cd prover/server
${{ matrix.test-suite.command }}
just prover::${{ matrix.test-suite.target }}

test-with-redis:
needs: build
Expand All @@ -107,13 +109,13 @@ jobs:
matrix:
test-suite:
- name: "Redis Queue tests"
command: "go test -v -run TestRedis -timeout 10m"
target: "test-redis"
- name: "Queue cleanup tests"
command: "go test -v -run TestCleanup -timeout 5m"
target: "test-cleanup"
- name: "Queue processing flow tests"
command: "go test -v -run TestJobProcessingFlow -timeout 5m"
target: "test-job-processing-flow"
- name: "Failed job status tests"
command: "go test -v -run TestFailedJobStatus -timeout 5m"
target: "test-failed-job-status"
services:
redis:
image: redis:7-alpine
Expand Down Expand Up @@ -143,12 +145,14 @@ jobs:
restore-keys: |
${{ runner.os }}-go-

- name: Install just
uses: extractions/setup-just@v2

- name: Run ${{ matrix.test-suite.name }}
env:
TEST_REDIS_URL: redis://localhost:6379/15
run: |
cd prover/server
${{ matrix.test-suite.command }}
just prover::${{ matrix.test-suite.target }}

integration-test-lightweight:
needs: build
Expand Down Expand Up @@ -178,10 +182,12 @@ jobs:
restore-keys: |
${{ runner.os }}-go-

- name: Install just
uses: extractions/setup-just@v2

- name: Lightweight integration tests
run: |
cd prover/server
go test -run TestLightweight -timeout 15m
just prover::test-lightweight

integration-test-lightweight-lazy:
needs: build
Expand Down Expand Up @@ -211,10 +217,12 @@ jobs:
restore-keys: |
${{ runner.os }}-go-

- name: Install just
uses: extractions/setup-just@v2

- name: Lightweight lazy loading integration tests
run: |
cd prover/server
go test -run TestLightweightLazy -timeout 15m
just prover::test-lightweight-lazy

integration-test-full:
needs: build
Expand Down Expand Up @@ -243,10 +251,12 @@ jobs:
restore-keys: |
${{ runner.os }}-go-

- name: Install just
uses: extractions/setup-just@v2

- name: Full integration tests
run: |
cd prover/server
go test -run TestFull -timeout 120m
just prover::test-full

lean-verification:
needs: build
Expand All @@ -270,9 +280,12 @@ jobs:
- name: Make binary executable
run: chmod +x prover/server/light-prover

- name: Install just
uses: extractions/setup-just@v2

- name: Install Elan
run: |
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y -v --default-toolchain leanprover/lean4:v4.2.0
just prover::lean-install

- name: Get Lake version for cache key
id: lake-version
Expand All @@ -287,13 +300,6 @@ jobs:
restore-keys: |
lean-${{ steps.lake-version.outputs.version }}-

- name: Extract circuit to Lean
run: |
cd prover/server
./light-prover extract-circuit --output formal-verification/FormalVerification/Circuit.lean --address-tree-height 40 --compressed-accounts 8 --state-tree-height 32

- name: Build Lean project
- name: Extract circuit and build Lean
run: |
cd prover/server/formal-verification
~/.elan/bin/lake exe cache get
~/.elan/bin/lake build
just prover::verify
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
matrix:
group:
- name: batched-merkle-tree-simulate
test_cmd: just program-libs test-simulate
test_cmd: just program-libs::test-simulate
- name: program-libs-fast
test_cmd: just program-libs test-fast
test_cmd: just program-libs::test-fast
- name: program-libs-slow
test_cmd: just program-libs test-slow
test_cmd: just program-libs::test-slow

name: Test ${{ matrix.group.name }}

Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:

- name: Build CLI
run: |
just cli build
just cli::build

- name: Run tests for ${{ matrix.group.name }}
run: |
Expand Down
Loading
Loading