-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathjustfile
More file actions
134 lines (94 loc) · 4.99 KB
/
justfile
File metadata and controls
134 lines (94 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Light Protocol - Program Tests
default:
@just --list
build:
cd create-address-test-program && cargo build-sbf
# === Full test suite (mirrors CI) ===
test: build test-account-compression test-registry test-system test-system-cpi test-system-cpi-v2 test-compressed-token test-e2e
# === Individual test packages ===
test-account-compression:
RUSTFLAGS="-D warnings" cargo test-sbf -p account-compression-test
test-registry:
RUST_MIN_STACK=16777216 RUSTFLAGS="-D warnings" cargo test-sbf -p registry-test
# System program tests
test-system: test-system-address test-system-compression test-system-re-init
test-system-address:
RUSTFLAGS="-D warnings" cargo test-sbf -p system-test -- test_with_address
test-system-compression:
RUSTFLAGS="-D warnings" cargo test-sbf -p system-test -- test_with_compression
test-system-re-init:
RUSTFLAGS="-D warnings" cargo test-sbf -p system-test --test test_re_init_cpi_account
# System CPI tests (v1)
test-system-cpi:
RUSTFLAGS="-D warnings" cargo test-sbf -p system-cpi-test
# System CPI tests (v2)
test-system-cpi-v2: test-system-cpi-v2-main test-system-cpi-v2-event-parse test-system-cpi-v2-functional
test-system-cpi-v2-main:
RUSTFLAGS="-D warnings" cargo test-sbf -p system-cpi-v2-test -- --skip functional_ --skip event::parse
test-system-cpi-v2-event-parse:
RUSTFLAGS="-D warnings" cargo test-sbf -p system-cpi-v2-test -- event::parse
test-system-cpi-v2-functional: test-system-cpi-v2-functional-read-only test-system-cpi-v2-functional-account-infos
test-system-cpi-v2-functional-read-only:
RUSTFLAGS="-D warnings" cargo test-sbf -p system-cpi-v2-test -- functional_read_only
test-system-cpi-v2-functional-account-infos:
RUSTFLAGS="-D warnings" cargo test-sbf -p system-cpi-v2-test -- functional_account_infos
# Compressed token tests
test-compressed-token: test-compressed-token-unit test-compressed-token-v1 test-compressed-token-mint test-compressed-token-light-token test-compressed-token-transfer2 test-compressed-token-token-pool
test-compressed-token-unit:
RUSTFLAGS="-D warnings" cargo test -p light-compressed-token
test-compressed-token-v1:
RUSTFLAGS="-D warnings" cargo test-sbf -p compressed-token-test --test v1
test-compressed-token-mint:
RUSTFLAGS="-D warnings" cargo test-sbf -p compressed-token-test --test mint
test-compressed-token-light-token:
RUSTFLAGS="-D warnings" cargo test-sbf -p compressed-token-test --test light_token
test-compressed-token-transfer2:
RUSTFLAGS="-D warnings" cargo test-sbf -p compressed-token-test --test transfer2
test-compressed-token-token-pool:
RUSTFLAGS="-D warnings" cargo test-sbf -p compressed-token-test --test token_pool
# Compressed token batched tree test (flaky, may need retries)
test-compressed-token-batched-tree:
RUSTFLAGS="-D warnings" cargo test-sbf -p compressed-token-test -- test_transfer_with_photon_and_batched_tree
# E2E tests
test-e2e:
RUSTFLAGS="-D warnings" cargo test-sbf -p e2e-test
# E2E extended tests (requires building compressed-token-small first)
test-e2e-extended: build-compressed-token-small
RUSTFLAGS="-D warnings" cargo test-sbf -p e2e-test -- --test test_10_all
# Pinocchio unit tests
test-pinocchio:
RUSTFLAGS="-D warnings" cargo test -p light-system-program-pinocchio
# === Build targets ===
build-compressed-token-small:
pnpm --filter @lightprotocol/programs run build-compressed-token-small
# === CI-equivalent grouped tests ===
# Matches CI: account-compression-and-registry
ci-account-compression-and-registry: test-account-compression test-registry
# Matches CI: light-system-program-address
ci-system-address: test-system-address test-e2e test-e2e-extended test-compressed-token-light-token
# Matches CI: light-system-program-compression
ci-system-compression: test-system-compression test-system-re-init
# Matches CI: compressed-token-and-e2e
ci-compressed-token-and-e2e: test-compressed-token-unit test-compressed-token-v1 test-compressed-token-mint test-compressed-token-token-pool
# Matches CI: compressed-token-batched-tree (with retry for flaky test)
ci-compressed-token-batched-tree:
#!/usr/bin/env bash
set -euo pipefail
attempt=1
max_attempts=3
until RUSTFLAGS="-D warnings" cargo test-sbf -p compressed-token-test -- test_transfer_with_photon_and_batched_tree; do
attempt=$((attempt + 1))
if [ $attempt -gt $max_attempts ]; then
echo "Test failed after $max_attempts attempts"
exit 1
fi
echo "Attempt $attempt/$max_attempts failed, retrying in 5s..."
sleep 5
done
echo "Test passed on attempt $attempt"
# Matches CI: system-cpi-test
ci-system-cpi: test-system-cpi test-pinocchio test-system-cpi-v2-main test-system-cpi-v2-event-parse test-compressed-token-transfer2
# Matches CI: system-cpi-test-v2-functional-read-only
ci-system-cpi-v2-functional-read-only: test-system-cpi-v2-functional-read-only
# Matches CI: system-cpi-test-v2-functional-account-infos
ci-system-cpi-v2-functional-account-infos: test-system-cpi-v2-functional-account-infos