Add local sequencer integration tests#140
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an opt-in local sequencer integration harness to the existing Rust integration test suites, plus a local-sequencer helper tool to clone/build the pinned LEZ checkout (and circuits cache) and run the feature-gated tests in CI and locally.
Changes:
- Introduces
tools/local-sequencerto manage a pinned LEZ checkout, circuits caching, and asetup/testworkflow. - Adds a
local-sequencer-testsfeature tointegration_teststhat swapsV03Stateusage behind aTestStatewrapper that mirrors transitions through a spawned sequencer. - Wires documentation, Makefile clippy, and CI to run the local sequencer integration suite.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/local-sequencer/src/main.rs | New helper CLI to prepare LEZ checkout, circuits cache, and run feature-gated integration tests |
| tools/local-sequencer/Cargo.toml | New workspace tool crate definition |
| README.md | Documents local sequencer harness usage and stablecoin integration coverage |
| programs/integration_tests/tests/token.rs | Switches to integration_tests::TestState alias and adds local-sequencer-specific assertions |
| programs/integration_tests/tests/stablecoin.rs | Switches to integration_tests::TestState alias |
| programs/integration_tests/tests/ata.rs | Switches to integration_tests::TestState alias |
| programs/integration_tests/tests/amm.rs | Switches to integration_tests::TestState alias |
| programs/integration_tests/src/local_sequencer.rs | New feature-gated local sequencer harness (spawn, seed, submit/poll, mirror state) |
| programs/integration_tests/src/lib.rs | Feature-gated TestState export (wrapper vs type alias) |
| programs/integration_tests/Cargo.toml | Adds local-sequencer-tests feature + optional deps (base64/borsh/rocksdb/serde_json) |
| Makefile | Runs clippy for integration_tests with local-sequencer-tests enabled |
| CLAUDE.md | Updates repository structure notes to include stablecoin integration tests |
| Cargo.toml | Adds tools/local-sequencer and workspace deps for base64/rocksdb |
| Cargo.lock | Adds dependency graph entries for new optional deps (e.g., rocksdb/librocksdb-sys/bindgen) |
| .github/workflows/ci.yml | Adds CI job to run cargo run -p local-sequencer -- test with caching |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I've found some issues/PRs and created new issues that would make the local-sequencer wrapper unnecessary and let us depend on scaffold tool directly. Existing scaffold work that is adjacent, but not enough:
Missing pieces were submitted as issues as follow-up scaffold requirements:
|
| fn command_output(command: &mut Command) -> DynResult<String> { | ||
| let output = command.output()?; | ||
| if !output.status.success() { | ||
| return Err(format!( | ||
| "command failed with {}: {}", | ||
| output.status, | ||
| render_command(command) | ||
| ) | ||
| .into()); | ||
| } | ||
| Ok(String::from_utf8(output.stdout)?) | ||
| } | ||
|
|
||
| fn run_checked(command: &mut Command) -> DynResult<()> { | ||
| println!("$ {}", render_command(command)); | ||
| let status = command.status()?; | ||
| if !status.success() { | ||
| return Err(format!("command failed with {status}: {}", render_command(command)).into()); | ||
| } | ||
| Ok(()) | ||
| } |
| "--", | ||
| "--nocapture", | ||
| ]); | ||
| run_checked(&mut command) |
| fn require_cmd(cmd: &str) -> DynResult<()> { | ||
| let status = Command::new(cmd).arg("--version").status(); | ||
| match status { | ||
| Ok(_) => Ok(()), | ||
| Err(err) if err.kind() == std::io::ErrorKind::NotFound => { | ||
| Err(format!("missing required command: {cmd}").into()) | ||
| } | ||
| Err(err) => Err(format!("failed to probe command `{cmd}`: {err}").into()), | ||
| } | ||
| } |
Summary
Introduce a local sequencer integration harness to enhance testing capabilities. This addition allows for end-to-end testing of various programs, including stablecoin, through a spawned sequencer, ensuring that transitions and outcomes are accurately asserted. Update documentation to reflect these changes and provide guidance on usage.
local-sequencerhelper that prepares the pinned sequencer checkout, caches circuits, and runs the feature-gated test suiteCloses #134
Notes
Validation