4
4
# # print the help
5
5
help :
6
6
just -l
7
-
8
7
deps :
9
8
cargo install sqlx-cli --no-default-features --features native-tls,postgres
10
-
11
9
url :
12
10
@ echo export DATABASE_URL=postgresql:// postgres:postgres@127.0.0.1 :5432
13
-
14
11
clippy :
15
12
cargo + nightly clippy --all-targets --all-features
16
-
17
13
# run everything that is needed for ci to pass
18
14
ci :
19
15
just fmt
20
16
just clippy
21
17
just test
22
18
just sqlx-prepare
23
-
24
-
25
19
test :
26
20
RUST_LOG=debug cargo nextest run
27
-
28
21
review :
29
22
RUST_LOG=debug cargo insta review
30
-
31
23
fmt :
32
24
cargo + nightly fmt
33
-
34
25
sqlx-prepare :
35
26
cargo sqlx prepare --workspace -- --all-targets --all-features
36
-
37
27
psql-up :
38
28
@ docker run -d --name indexer-rs-psql -p 5432 :5432 -e POSTGRES_PASSWORD=postgres postgres
39
29
@ sleep 5
@@ -42,24 +32,34 @@ psql-up:
42
32
psql-down :
43
33
docker stop indexer-rs-psql
44
34
docker rm indexer-rs-psql
45
-
46
35
migrate :
47
36
sqlx migrate run --database-url postgresql:// postgres:postgres@127.0.0.1 :5432
48
37
38
+ # Creates symlink to contrib/local-network/.env file
39
+ # Required for scripts that need to read contract addresses and network config
40
+ # Assumes the local-network submodule is present (run 'just setup' if missing)
41
+ setup-integration-env :
42
+ @ if [ ! -f integration-tests/ .env ]; then \
43
+ ln -sf ../ contrib/ local-network/ .env integration-tests/ .env ; \
44
+ echo " Symlink to local-network .env created" ; \
45
+ else \
46
+ echo " Integration tests .env already exists" ; \
47
+ fi
49
48
50
49
# Development workflow commands
51
50
# -----------------------------
52
-
53
- # Full setup for testing
54
- # using a local network
51
+ # Full setup for testing using a local network
52
+ # This deploys all containers, contracts, and funds escrow
55
53
setup :
56
54
./ setup-test-network.sh
57
55
58
56
# Rebuild binaries and restart services after code changes
59
- reload :
57
+ # Assumes local network is already running (run 'just setup' if not)
58
+ reload : setup-integration-env
60
59
./ dev-reload.sh
61
60
62
61
# Watch log output from services
62
+ # Assumes local network is already running (run 'just setup' if not)
63
63
logs :
64
64
@ cd contrib && docker compose -f docker-compose.dev.yml logs -f
65
65
@@ -69,32 +69,35 @@ down:
69
69
@ cd contrib/ local-network && docker compose down
70
70
docker rm -f indexer-service tap-agent gateway block-oracle indexer-agent graph-node redpanda tap-aggregator tap-escrow-manager 2 >/ dev/ null || true
71
71
72
-
73
72
# Profiling commands
74
73
# -----------------------------
75
-
76
74
# Profile indexer-service with flamegraph
77
- profile-flamegraph :
75
+ # Assumes local network is already running (run 'just setup' if not)
76
+ profile-flamegraph : setup-integration-env
78
77
@ mkdir -p contrib/ profiling/ output
79
78
./ prof-reload.sh flamegraph
80
79
81
80
# Profile indexer-service with valgrind
82
- profile-valgrind :
81
+ # Assumes local network is already running (run 'just setup' if not)
82
+ profile-valgrind : setup-integration-env
83
83
@ mkdir -p contrib/ profiling/ output
84
84
./ prof-reload.sh valgrind
85
85
86
86
# Profile indexer-service with strace
87
- profile-strace :
87
+ # Assumes local network is already running (run 'just setup' if not)
88
+ profile-strace : setup-integration-env
88
89
@ mkdir -p contrib/ profiling/ output
89
90
./ prof-reload.sh strace
90
91
91
- profile-callgrind :
92
+ # Profile indexer-service with callgrind
93
+ # Assumes local network is already running (run 'just setup' if not)
94
+ profile-callgrind : setup-integration-env
92
95
@ mkdir -p contrib/ profiling/ output
93
96
./ prof-reload.sh callgrind
94
97
95
98
# Stop the running indexer-service (useful after profiling)
96
99
# This sends SIGTERM, allowing the trap in start-perf.sh to handle cleanup (e.g., generate flamegraph)
97
- stop-profiling : # <-- New Rule Added Here
100
+ stop-profiling :
98
101
@ echo " 🛑 Stopping the indexer-service container (allowing profiling data generation)..."
99
102
cd contrib && docker compose -f docker-compose.prof.yml stop indexer-service tap-agent
100
103
@ echo " ✅ Service stop signal sent. Check profiling output directory."
@@ -105,15 +108,27 @@ profile-restore:
105
108
cd contrib && docker compose -f docker-compose.prof.yml up -d --force-recreate indexer-service tap-agent
106
109
@ echo " ✅ Normal service restored"
107
110
111
+ # Integration test commands (assume local network is already running)
112
+ # For fresh setup, run 'just setup' first to deploy all infrastructure
113
+ # -----------------------------------------------------------------------------
108
114
109
- test-local :
115
+ # Test RAV v1 receipts (legacy TAP)
116
+ # Assumes local network is running - run 'just setup' if services are not available
117
+ test-local : setup-integration-env
118
+ @ echo " Running RAV v1 integration tests (assumes local network is running)..."
110
119
@ cd integration-tests && ./ fund_escrow.sh
111
120
@ cd integration-tests && cargo run -- rav1
112
121
113
- test-local-v2 :
122
+ # Test RAV v2 receipts (Horizon TAP)
123
+ # Assumes local network is running - run 'just setup' if services are not available
124
+ test-local-v2 : setup-integration-env
125
+ @ echo " Running RAV v2 integration tests (assumes local network is running)..."
114
126
@ cd integration-tests && ./ fund_escrow.sh
115
127
@ cd integration-tests && cargo run -- rav2
116
128
117
- load-test-v2 num_receipts = " 1000":
129
+ # Load test with v2 receipts
130
+ # Assumes local network is running - run 'just setup' if services are not available
131
+ load-test-v2 num_receipts = " 1000": setup-integration-env
132
+ @ echo " Running load test with {{ num_receipts}} receipts (assumes local network is running)..."
118
133
@ cd integration-tests && ./ fund_escrow.sh
119
134
@ cd integration-tests && cargo run -- load-v2 --num-receipts {{ num_receipts}}
0 commit comments