@@ -118,11 +118,6 @@ jobs:
118118 sudo apt-get install -y -qq mold
119119 mold --version
120120
121- - name : Install FoundationDB client library
122- run : |
123- wget -q https://github.com/apple/foundationdb/releases/download/7.3.69/foundationdb-clients_7.3.69-1_amd64.deb
124- sudo dpkg -i foundationdb-clients_7.3.69-1_amd64.deb
125-
126121 - name : Cache Rust dependencies
127122 uses : step-security/rust-cache@f8fba7098297c8c53a7c9a30575ec2ad4ad85056 # v2.8.2
128123 with :
@@ -170,11 +165,6 @@ jobs:
170165 install_args : protobuf cargo:cargo-nextest
171166 cache : true
172167
173- - name : Install FoundationDB client library
174- run : |
175- wget -q https://github.com/apple/foundationdb/releases/download/7.3.69/foundationdb-clients_7.3.69-1_amd64.deb
176- sudo dpkg -i foundationdb-clients_7.3.69-1_amd64.deb
177-
178168 - name : Cache Rust dependencies
179169 uses : step-security/rust-cache@f8fba7098297c8c53a7c9a30575ec2ad4ad85056 # v2.8.2
180170 with :
@@ -231,11 +221,6 @@ jobs:
231221 install_args : protobuf cargo:cargo-nextest
232222 cache : true
233223
234- - name : Install FoundationDB client library
235- run : |
236- wget -q https://github.com/apple/foundationdb/releases/download/7.3.69/foundationdb-clients_7.3.69-1_amd64.deb
237- sudo dpkg -i foundationdb-clients_7.3.69-1_amd64.deb
238-
239224 - name : Download nextest archive
240225 uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
241226 with :
@@ -265,6 +250,85 @@ jobs:
265250 path : target/nextest/ci/junit.xml
266251 retention-days : 7
267252
253+ # Ledger Integration Tests
254+ # Runs Control tests against a real Ledger server to verify storage backend integration.
255+ # Uses Docker Compose to start a single-node Ledger cluster, then runs native cargo tests.
256+ ledger-integration-tests :
257+ name : Ledger Integration Tests
258+ needs : build
259+ runs-on : ubuntu-latest
260+ permissions :
261+ contents : read
262+ timeout-minutes : 10
263+ env :
264+ CARGO_INCREMENTAL : 0
265+ RUSTFLAGS : " -C codegen-units=16 -C link-arg=-fuse-ld=mold"
266+ steps :
267+ - name : Harden the runner (Audit all outbound calls)
268+ uses : step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
269+ with :
270+ egress-policy : audit
271+
272+ - name : Checkout code
273+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
274+
275+ - name : Install Rust toolchain
276+ uses : dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
277+ with :
278+ toolchain : stable
279+
280+ - name : Install mold linker
281+ run : |
282+ sudo apt-get update -qq
283+ sudo apt-get install -y -qq mold
284+
285+ - name : Install development tools via Mise
286+ uses : step-security/mise-action@2fa1b2b4fa1577588d8ac75f4dfa0f67c266d2a0 # v3.4.1
287+ with :
288+ install_args : protobuf cargo:cargo-nextest
289+ cache : true
290+
291+ - name : Cache Rust dependencies
292+ uses : step-security/rust-cache@f8fba7098297c8c53a7c9a30575ec2ad4ad85056 # v2.8.2
293+ with :
294+ shared-key : management-ubuntu-latest-x86_64-unknown-linux-gnu
295+ save-if : false
296+
297+ - name : Start Ledger server
298+ working-directory : docker/ledger-integration-tests
299+ run : |
300+ docker-compose up -d ledger
301+ echo "Waiting for Ledger to be ready..."
302+ for i in {1..30}; do
303+ if docker-compose exec -T ledger nc -z localhost 50051 2>/dev/null; then
304+ echo "Ledger is ready!"
305+ break
306+ fi
307+ echo "Attempt $i/30: Ledger not ready yet..."
308+ sleep 2
309+ done
310+ # Final check
311+ docker-compose exec -T ledger nc -z localhost 50051 || (docker-compose logs ledger && exit 1)
312+
313+ - name : Run Ledger integration tests
314+ env :
315+ RUN_LEDGER_INTEGRATION_TESTS : " 1"
316+ LEDGER_ENDPOINT : " http://localhost:50052"
317+ LEDGER_NAMESPACE_ID : " 1"
318+ RUST_BACKTRACE : " 1"
319+ run : |
320+ cargo nextest run \
321+ --package inferadb-control-storage \
322+ --test ledger_integration_tests \
323+ --features ledger \
324+ --profile ci \
325+ --no-fail-fast
326+
327+ - name : Stop Ledger server
328+ if : always()
329+ working-directory : docker/ledger-integration-tests
330+ run : docker-compose down -v
331+
268332 # Test code coverage (nightly only to reduce CI costs)
269333 coverage :
270334 name : Code Coverage
@@ -303,11 +367,6 @@ jobs:
303367 install_args : protobuf cargo:cargo-llvm-cov
304368 cache : true
305369
306- - name : Install FoundationDB client library
307- run : |
308- wget -q https://github.com/apple/foundationdb/releases/download/7.3.69/foundationdb-clients_7.3.69-1_amd64.deb
309- sudo dpkg -i foundationdb-clients_7.3.69-1_amd64.deb
310-
311370 - name : Restore build cache
312371 uses : step-security/rust-cache@f8fba7098297c8c53a7c9a30575ec2ad4ad85056 # v2.8.2
313372 with :
@@ -363,7 +422,7 @@ jobs:
363422 # Overall status check
364423 ci-success :
365424 name : CI Success
366- needs : [changes, fmt, clippy, build, test, coverage, dependencies]
425+ needs : [changes, fmt, clippy, build, test, ledger-integration-tests, coverage, dependencies]
367426 runs-on : ubuntu-latest
368427 permissions :
369428 contents : read
@@ -394,6 +453,11 @@ jobs:
394453 echo "Tests failed"
395454 exit 1
396455 fi
456+ # Ledger integration tests verify storage backend
457+ if [[ "${{ needs.ledger-integration-tests.result }}" != "success" && "${{ needs.ledger-integration-tests.result }}" != "skipped" ]]; then
458+ echo "Ledger integration tests failed"
459+ exit 1
460+ fi
397461 # Coverage and dependencies can be skipped for Dependabot PRs
398462 if [[ "${{ needs.coverage.result }}" != "success" && "${{ needs.coverage.result }}" != "skipped" ]]; then
399463 echo "Coverage check failed"
0 commit comments