Skip to content

Commit 281f517

Browse files
committed
test: wire lmdblib + wsdb C++ tests into the CI test engine
The native-package tests were built but never run in CI: neither bootstrap had a test_cmds function and there were no Makefile -tests targets, so nothing was appended to /tmp/test_cmds for them. Following the ipc-runtime pattern: - lmdblib/wsdb bootstrap build now also builds the gtest binary (lmdblib_tests / wsdb_tests), and each exposes test_cmds emitting the binary as a test command. - Makefile gains lmdblib-tests + wsdb-tests targets, added to the 'fast' test set so the test engine runs them (lmdblib 47 tests; wsdb 152 decoupled tests). kvdb has no C++ tests (its NAPI is covered by yarn-project's kv-store tests). The bb-header parity/equivalence tests stay manual behind WSDB_BUILD_BB_TESTS. Note: ipc-runtime-tests is similarly defined but absent from fast/full — a pre-existing gap, left as-is here.
1 parent 17b4d41 commit 281f517

3 files changed

Lines changed: 41 additions & 6 deletions

File tree

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ endef
5555

5656
# Fast bootstrap.
5757
fast: release-image barretenberg boxes playground docs aztec-up \
58-
bb-tests l1-contracts-tests yarn-project-tests boxes-tests playground-tests aztec-up-tests docs-tests noir-protocol-circuits-tests release-image-tests spartan claude-tests ipc-codegen-tests
58+
bb-tests l1-contracts-tests yarn-project-tests boxes-tests playground-tests aztec-up-tests docs-tests noir-protocol-circuits-tests release-image-tests spartan claude-tests ipc-codegen-tests lmdblib-tests wsdb-tests
5959

6060
# Full bootstrap.
6161
full: fast bb-full-tests bb-cpp-full yarn-project-benches
@@ -326,7 +326,7 @@ ipc-runtime-cross: ipc-runtime ipc-runtime-cross-arm64-linux ipc-runtime-cross-a
326326

327327
# lmdblib and kvdb are barretenberg-free: they build against their own deps
328328
# (lmdb, msgpack-c, node-addon-api) only, never bb.
329-
.PHONY: lmdblib kvdb
329+
.PHONY: lmdblib kvdb lmdblib-tests wsdb-tests
330330
lmdblib:
331331
$(call build,$@,native-packages/lmdblib)
332332

@@ -336,6 +336,15 @@ kvdb: lmdblib
336336
wsdb: ipc-codegen ipc-runtime bb-cpp-native lmdblib
337337
$(call build,$@,native-packages/wsdb)
338338

339+
# Native-package C++ tests (self-contained gtest binaries). kvdb has no C++ tests
340+
# (its NAPI is exercised by yarn-project's kv-store tests). wsdb_tests use no bb
341+
# headers; the bb-header parity/equivalence target is manual (WSDB_BUILD_BB_TESTS).
342+
lmdblib-tests: lmdblib
343+
$(call test,$@,native-packages/lmdblib)
344+
345+
wsdb-tests: wsdb
346+
$(call test,$@,native-packages/wsdb)
347+
339348
#==============================================================================
340349
# .claude tooling
341350
#==============================================================================

native-packages/lmdblib/bootstrap.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,31 @@ hash=$(hash_str \
1313
function build_native {
1414
local build_dir="cpp/build"
1515
CC=$(which clang) CXX=$(which clang++) cmake -S cpp -B "$build_dir" -G Ninja >/dev/null
16-
cmake --build "$build_dir" --target lmdblib
16+
cmake --build "$build_dir" --target lmdblib lmdblib_tests
1717
}
1818

1919
function build {
2020
echo_header "lmdblib build"
2121
build_native
2222
}
2323

24+
# Emit test commands for the CI test engine (one self-contained gtest binary).
25+
function test_cmds {
26+
echo "$hash:CPUS=2:TIMEOUT=120s native-packages/lmdblib/cpp/build/lmdblib_tests"
27+
}
28+
29+
# Manual: build then run the tests directly.
30+
function test {
31+
echo_header "lmdblib test"
32+
build
33+
test_cmds | filter_test_cmds | parallelize
34+
}
35+
2436
function clean {
2537
rm -rf cpp/build
2638
}
2739

28-
export -f build_native build clean
40+
export -f build_native build test_cmds test clean
2941

3042
case "$cmd" in
3143
"")

native-packages/wsdb/bootstrap.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function generate_ts_package {
3333
function build_native {
3434
local build_dir="cpp/build"
3535
CC=$(which clang) CXX=$(which clang++) cmake -S cpp -B "$build_dir" -G Ninja >/dev/null
36-
cmake --build "$build_dir" --target "$WSDB_BINARY"
36+
cmake --build "$build_dir" --target "$WSDB_BINARY" wsdb_tests
3737
local target_dir="ts/build/$(arch)-$(os)"
3838
mkdir -p "$target_dir"
3939
cp "$build_dir/bin/$WSDB_BINARY" "$target_dir/$WSDB_BINARY"
@@ -48,6 +48,20 @@ function build {
4848
(cd ts && ./scripts/prepare_arch_packages.sh "$(arch)-$(os)=build/$(arch)-$(os)/$WSDB_BINARY")
4949
}
5050

51+
# Emit test commands for the CI test engine. The decoupled wsdb_tests use no
52+
# barretenberg headers; they link libbarretenberg.a only for the poseidon2 c_bind.
53+
# (The optional bb-header parity/equivalence target, WSDB_BUILD_BB_TESTS, is manual.)
54+
function test_cmds {
55+
echo "$hash:CPUS=8:TIMEOUT=600s native-packages/wsdb/cpp/build/bin/wsdb_tests"
56+
}
57+
58+
# Manual: build then run the tests directly.
59+
function test {
60+
echo_header "wsdb test"
61+
build
62+
test_cmds | filter_test_cmds | parallelize
63+
}
64+
5165
function clean {
5266
rm -rf ts node_modules cpp/build
5367
}
@@ -64,7 +78,7 @@ function release {
6478
(cd ts && retry "deploy_npm ${REF_NAME#v}")
6579
}
6680

67-
export -f generate_ts_package build_native build clean release
81+
export -f generate_ts_package build_native build test_cmds test clean release
6882

6983
case "$cmd" in
7084
"")

0 commit comments

Comments
 (0)