From 1f22c34c8b5a857bb6d1c5ec06d49ec470abdef7 Mon Sep 17 00:00:00 2001 From: Ricardo Guilherme Schmidt <3esmit@gmail.com> Date: Mon, 29 Jun 2026 13:29:16 -0300 Subject: [PATCH] test(integration-tests): require release guest ELFs --- .github/workflows/ci.yml | 1 + README.md | 6 ++++-- programs/integration_tests/src/local_sequencer.rs | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfcf127..32e52b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,6 +153,7 @@ jobs: - name: Local sequencer integration tests run: cargo test -p integration_tests --features local-sequencer-tests -- --nocapture env: + RISC0_BUILD_DEBUG: 0 RISC0_DEV_MODE: 1 RUST_TEST_THREADS: 1 diff --git a/README.md b/README.md index 4de405a..0251766 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,10 @@ RISC0_DEV_MODE=1 cargo test -p token_program -p amm_program -p ata_program -p st # Run integration tests (dev mode skips ZK proof generation) RISC0_DEV_MODE=1 cargo test -p integration_tests -# Run integration tests through scaffold-managed local sequencer test nodes -RISC0_DEV_MODE=1 RUST_TEST_THREADS=1 cargo test -p integration_tests --features local-sequencer-tests -- --nocapture +# Run integration tests through scaffold-managed local sequencer test nodes. +# RISC0_BUILD_DEBUG=0 keeps embedded guest ELFs on the release profile while +# RISC0_DEV_MODE=1 skips proof generation. +RISC0_BUILD_DEBUG=0 RISC0_DEV_MODE=1 RUST_TEST_THREADS=1 cargo test -p integration_tests --features local-sequencer-tests -- --nocapture # Run all tests make test diff --git a/programs/integration_tests/src/local_sequencer.rs b/programs/integration_tests/src/local_sequencer.rs index 60105ea..de86e3b 100644 --- a/programs/integration_tests/src/local_sequencer.rs +++ b/programs/integration_tests/src/local_sequencer.rs @@ -32,6 +32,7 @@ type DynError = Box; type DynResult = Result; const TEST_NODE_CIRCUITS_VERSION_ENV: &str = "LOGOS_SCAFFOLD_TEST_NODE_CIRCUITS_VERSION"; +const RISC0_BUILD_DEBUG_ENV: &str = "RISC0_BUILD_DEBUG"; const DEFAULT_CIRCUITS_VERSION: &str = "0.4.2"; const CF_BLOCK_NAME: &str = "cf_block"; const CF_META_NAME: &str = "cf_meta"; @@ -351,6 +352,19 @@ fn ensure_risc0_dev_mode() -> DynResult<()> { Ok(()) } +fn ensure_release_guest_builds() -> DynResult<()> { + if let Some(value) = env::var_os(RISC0_BUILD_DEBUG_ENV) { + let value = value.to_string_lossy(); + if value.trim() == "1" { + return Err(io::Error::other(format!( + "{RISC0_BUILD_DEBUG_ENV}=1 enables debug-profile guest ELFs, but local sequencer tests require release-profile guest ELFs; unset {RISC0_BUILD_DEBUG_ENV} or set it to 0" + )) + .into()); + } + } + Ok(()) +} + struct LocalSequencer { _node: TestNode, client: TestNodeClient, @@ -359,6 +373,7 @@ struct LocalSequencer { impl LocalSequencer { fn spawn(state: &nssa::V03State) -> DynResult { ensure_risc0_dev_mode()?; + ensure_release_guest_builds()?; let seed_dir = SeedDirGuard::from_state(state)?; let config = TestNodeConfig { state: Some(seed_dir.path().to_path_buf()),