test(integration-tests): require release guest ELFs

This commit is contained in:
Ricardo Guilherme Schmidt 2026-06-29 13:29:16 -03:00
parent 13080a785a
commit 1f22c34c8b
No known key found for this signature in database
GPG Key ID: 1396EA17DE132FFE
3 changed files with 20 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -32,6 +32,7 @@ type DynError = Box<dyn Error + Send + Sync>;
type DynResult<T> = Result<T, DynError>;
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<Self> {
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()),