-
Notifications
You must be signed in to change notification settings - Fork 657
Expand file tree
/
Copy pathjustfile
More file actions
316 lines (271 loc) · 14.6 KB
/
Copy pathjustfile
File metadata and controls
316 lines (271 loc) · 14.6 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
set shell := ["bash", "-eu", "-c"]
# The build environment every recipe below needs, so that `just <recipe>` works
# on a clean checkout without anyone rediscovering these three by bisecting a
# link error. An already-exported value always wins.
#
# Homebrew's prefix is macOS only: `opencypher` (and therefore `server-runtime`)
# runs bindgen against libcypher-parser, and `graphblas` links libgraphblas.
# Neither is on the default search path there. CI is Linux and installs both
# from apt, which is why nothing in `ci.yml` sets them.
brew_prefix := if os() == "macos" { shell("brew --prefix 2>/dev/null || echo /opt/homebrew") } else { "" }
export BINDGEN_EXTRA_CLANG_ARGS := env_var_or_default("BINDGEN_EXTRA_CLANG_ARGS", if os() == "macos" { "-I" + brew_prefix + "/include" } else { "" })
export LIBRARY_PATH := env_var_or_default("LIBRARY_PATH", if os() == "macos" { brew_prefix + "/lib" } else { "" })
# OpenCypher's async query futures exceed the 2 MiB default test-thread stack.
# Keep enough headroom for different compiler profiles and platforms so the
# suite reports assertion failures rather than aborting with SIGABRT.
export RUST_MIN_STACK := env_var_or_default("RUST_MIN_STACK", "33554432")
# Show available recipes.
default:
@just --list
# Show available recipes.
help:
@just --list
# Format Rust code.
fmt:
cargo fmt --all
# Check Rust formatting.
fmt-check:
cargo fmt --all --check
# `ci.yml` lints the root package six times, once per shipped feature
# combination, every one of them `--all-targets ... -D warnings`. None of the six
# subsumes another: a lint only fires inside the cfg arms its feature set
# compiles, so the `cfg(not(feature = ...))` arms are visible only to the default
# run and the Bolt and HTTP paths only to the last three. The two
# workspace members are linted inside test-placement and test-telemetry instead,
# because they need an explicit `-p`.
#
# These are `clippy`, not `check`, and `--all-targets` covers examples and tests,
# so each strictly subsumes the same-feature `check`/`check-examples*` recipe
# below — which is why `ci` runs these in their place rather than in addition to
# them. The check recipes stay defined because plans under `docs/` call them by
# name and because they are the faster inner loop.
# Lint the default feature set, as `ci.yml` does.
clippy:
cargo clippy --locked --all-targets -- -D warnings
# Lint the feature-gated hard-fence chaos harness.
clippy-chaos:
cargo clippy --locked --all-targets --features chaos-harness -- -D warnings
# Lint the native OpenCypher parser feature set.
clippy-opencypher:
cargo clippy --locked --all-targets --features opencypher -- -D warnings
# Lint every native feature at once.
clippy-native:
cargo clippy --locked --all-targets --features opencypher,query-transport,query-transport-tls,query-service-discovery,public-client-protocols -- -D warnings
# Lint the public Bolt and HTTP client protocols.
clippy-client-protocols:
cargo clippy --locked --all-targets --features public-client-protocols -- -D warnings
# Lint the production node and indexer runtimes.
clippy-runtime:
cargo clippy --locked --all-targets --features server-runtime,indexer-runtime -- -D warnings
# `default = []`, so this covers the `cfg(not(feature = ...))` arms and nothing
# else — it is a real shipped configuration (`ci.yml` gates it on both Linux and
# macOS), but it is a small slice of the crate. Pair it with check-all-features;
# neither subsumes the other.
#
# It currently reports `AtomicDurationHistogram::{bucket_index, record_micros,
# record}` as dead. That is true *of this feature set* — every caller sits in
# `src/shard/query.rs` behind opencypher — and false of the crate. The fix is a
# cfg on the impl in `src/core/histogram.rs`, not a flag here.
#
# Leaving it standing stopped being free on 2026-07-27: `ci.yml` lints this same
# feature set with `-D warnings`, and `just clippy` now does too, so what reads as
# a tolerated warning here is a hard build failure there. It is a warning in this
# recipe only because `cargo check` does not promote it.
# Check all default-feature targets.
check:
cargo check --locked --all-targets
# The widest compile surface in one line, so a feature that only *this* recipe
# reaches — the root package's `otlp` is reached by nothing else in `ci`, since
# test-telemetry enables the *crate's* otlp under `-p hydradb-telemetry` and
# never the root switch the binaries' cfg arms read — cannot rot unnoticed.
# `--all-features` rather than an enumerated list on purpose: an enumerated list
# silently stops covering the next feature added to Cargo.toml.
# Check every target with every feature enabled.
check-all-features:
cargo check --locked --all-targets --all-features
# `client-api` is the shared client stack that `bolt-server` and `http-api` both
# imply, and until this recipe existed nothing built it alone — not `ci`, not
# `ci.yml`. Every path that reached it dragged a wire protocol in too, so an item
# gated `#[cfg(any(feature = "bolt-server", feature = "http-api"))]` could be
# called from `client-api` code and still compile everywhere anyone looked.
# `QueryResultSet::estimated_resident_bytes` was exactly that, and
# `--features client-api` failed E0599 on it until 2026-07-27.
#
# `--lib`, not `--all-targets`, and not by preference: `src/client/mod.rs`'s
# `#[cfg(test)]` `ClientTestTlsBundle` names `tokio_rustls` with no feature gate,
# so the lib-test target of this configuration does not build either. That is a
# second instance of the same bug and wants a gate on the helper; until it has
# one, widening this line would only make the recipe fail for an unrelated
# reason. Widen it when that lands.
#
# `check` rather than `clippy -D warnings` for the same reason: this
# configuration is the only one in which `PreparedClientQuery::columns` and
# `ClientQueryService::release_server_cursor` are dead — both are reached only
# from `src/client/bolt.rs` — so a `-D warnings` line here would fail on two
# missing cfgs in `src/client/service.rs` rather than on the compile break this
# recipe exists to catch. Promote it once those are gated.
# Check the shared client stack with no wire protocol above it.
check-client-api:
cargo check --locked --features client-api --lib
# `ci.yml`'s "Check standalone Bolt server". check-all-features cannot stand in
# for it: with `http-api` also on, anything this configuration is missing gets
# supplied by the other protocol and the gap stays hidden.
# Check the standalone Bolt server feature set.
check-bolt-server:
cargo check --locked --all-targets --features bolt-server
# Check default-feature examples.
check-examples:
cargo check --locked --examples
# Check examples with the native OpenCypher parser enabled.
check-examples-native:
cargo check --locked --examples --features opencypher
# Check the feature-gated hard-fence chaos harness.
check-examples-chaos:
cargo check --locked --examples --features chaos-harness
# Run default library tests.
test *args:
cargo test --locked --lib {{args}}
# Run library tests with OpenCypher enabled.
test-opencypher:
cargo test --locked --features opencypher --lib
# `--all-targets`, not `--lib`, and it is load-bearing: `--lib` builds the client
# stack as a plain dependency, so `src/client/service/tests.rs` never sees
# `cfg(test)` and its tests silently do not exist. Mirrors `ci.yml`'s "Test full
# native feature set" line exactly.
# Run all targets with every native feature enabled.
test-native:
cargo test --locked --all-targets --features opencypher,query-transport,query-transport-tls,query-service-discovery,public-client-protocols
# The Bolt and HTTP surfaces without query-service-discovery, which is how an
# embedder that brings its own routing builds them. test-native cannot catch a
# `use reqwest::…` that leaked into the shared client path; this can.
# Run all targets with the public Bolt and HTTP client protocols.
test-client-protocols:
cargo test --locked --all-targets --features public-client-protocols
# Run library tests with the feature-gated hard-fence harness enabled.
test-chaos:
cargo test --locked --features chaos-harness --lib
# The library under this feature set is covered by test-native; this recipe is
# the graph-node binary's own config, publisher and heartbeat tests.
# Test the production runtime configuration, as `ci.yml` does.
test-server-runtime:
cargo test --locked --features server-runtime --bin graph-node
# `indexer-runtime` was reached only by compile-only recipes until this existed —
# clippy-runtime lints it and check-all-features builds it, so the binary's seven
# tests were compiled by `ci` and then never run. This is the only line in `ci`
# that *executes* indexer code: the scope-discovery test and the six that pin the
# `/metrics` rendering, including the cell and edge-type dimensions and the
# `MAX_DIMENSIONS` cap. `--bin graph-indexer` because the binary declares
# `required-features = ["indexer-runtime"]`, so no `--lib` or `--all-targets` line
# anywhere else builds its test target.
# Test the indexer runtime configuration.
test-indexer:
cargo test --locked --features indexer-runtime --bin graph-indexer
# The same gap test-indexer closed, one binary over: test-server-runtime omits
# `otlp` and check-all-features only compiles it, so the graph-node binary's OTLP
# export tests were built by `ci` and never run. They are the only tests that
# prove an instrument reaches a collector rather than merely registering — an
# observable instrument whose callback the SDK never invokes is silent, and
# silence is indistinguishable from a counter that is genuinely zero. That is
# the failure mode M1 shipped and `aa53595` was written to close, so it is worth
# a recipe of its own rather than a feature added to the line above: the OTLP
# tests bind a loopback socket and wait on a real export interval, and that
# belongs in a recipe an operator can run alone.
# Test the graph-node binary's OTLP metric export.
test-node-otlp:
cargo test --locked --features server-runtime,otlp --bin graph-node
# Every other recipe here is bare, so it selects the root package only; a
# workspace member needs its own explicit `-p` line or it is never built.
# Lint and test the placement crate.
test-placement:
cargo clippy --locked --all-targets -p hydradb-placement -- -D warnings
cargo test --locked -p hydradb-placement
# The telemetry crate's OTLP-only modules — the sampler, the exporter wiring and
# the log bridge — are behind an off-by-default feature, so neither `just check`
# nor `just test` reaches them. Without `--features otlp` the sampler is not even
# compiled.
# Lint and test the telemetry crate with OTLP export enabled.
test-telemetry:
cargo clippy --locked --all-targets -p hydradb-telemetry --features otlp -- -D warnings
cargo test --locked -p hydradb-telemetry --features otlp
# Verify native libraries required by Rust FFI crates.
native-check:
#!/usr/bin/env bash
set -euo pipefail
pkg-config --exists cypher-parser
if command -v ldconfig >/dev/null 2>&1; then
ldconfig -p | grep -qi libgraphblas
elif command -v brew >/dev/null 2>&1; then
test -f "$(brew --prefix suite-sparse)/lib/libgraphblas.dylib"
else
test -f /opt/homebrew/lib/libgraphblas.dylib || test -f /usr/local/lib/libgraphblas.dylib
fi
# Ordered as `ci.yml` orders it: format, then every lint, then the compile-only
# configurations, then the tests. Lints first because they are the cheapest way
# to fail and because until 2026-07-27 this recipe ran *no* clippy at all on the
# root package — only the two `-p` lines inside test-placement and
# test-telemetry — so a green `just ci` did not imply a green CI, which is the
# one thing it exists to mean.
#
# The clippy-* recipes are `--all-targets`, so they subsume check, check-examples,
# check-examples-native and check-examples-chaos feature-for-feature. Those four
# are deliberately absent from this list rather than deleted: running both halves
# would pay for the same compile twice, once through rustc and once through
# clippy-driver, for no extra coverage.
# Run the local CI-equivalent check set.
ci: native-check fmt-check clippy clippy-chaos clippy-opencypher clippy-native clippy-client-protocols clippy-runtime test-placement test-telemetry check-all-features check-client-api check-bolt-server test test-opencypher test-native test-client-protocols test-chaos test-server-runtime test-indexer test-node-otlp
# Run the local object-store smoke test.
smoke:
#!/usr/bin/env bash
set -euo pipefail
store_root="$(mktemp -d)"
trap 'rm -rf "$store_root"' EXIT
CLOUD_PROVIDER=local LOCAL_PATH="$store_root" \
cargo run --locked --example object_store_smoke
# SuiteSparse is the default kernel now that the cargo feature is gone, so this
# differs from `smoke` only by pinning it — which is the point, since `smoke`
# inherits whatever GRAPH_MATRIX_KERNEL the caller's shell already exports.
# `example/object_store_smoke.rs` also accepts `compact` and `rust`.
# Run the local object-store smoke test pinned to the SuiteSparse kernel.
smoke-graphblas:
#!/usr/bin/env bash
set -euo pipefail
store_root="$(mktemp -d)"
trap 'rm -rf "$store_root"' EXIT
CLOUD_PROVIDER=local LOCAL_PATH="$store_root" GRAPH_MATRIX_KERNEL=graphblas \
cargo run --locked --example object_store_smoke
# Run local multiprocess stress against the local filesystem object store.
stress:
bash scripts/multiprocess_stress.sh
# Run hard write-fence takeover proof against the local filesystem object store.
fence:
bash scripts/fence_takeover.sh
# Run MinIO smoke test. Requires Docker.
minio-smoke:
bash scripts/minio_smoke.sh
# Run Query engine Cypher query benchmarks.
query-bench:
bash scripts/query_bench.sh
# Run low-memory query/build/concurrency profiling.
query-memory-profile:
bash scripts/query_memory_profile.sh
# Run Query engine exact query correctness benchmark.
query-correctness:
bash scripts/query_correctness.sh
# Run Query engine Cypher query benchmarks against MinIO. Requires Docker.
minio-query-bench:
bash scripts/minio_query_bench.sh
# Run Query engine exact query correctness benchmark against MinIO. Requires Docker.
minio-query-correctness:
bash scripts/minio_query_correctness.sh
# Run MinIO chaos test. Requires Docker.
minio-chaos:
bash scripts/minio_chaos.sh
# Run hard write-fence takeover proof against MinIO. Requires Docker.
minio-fence:
bash scripts/minio_fence_takeover.sh
# Replay all six Quint Connect adapters against isolated MinIO paths. Requires Docker.
minio-mbt:
bash scripts/minio_mbt.sh
# Refresh the pinned SlateDB Git dependency in Cargo.lock.
update-slatedb:
cargo update -p slatedb