Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(starknet_integration_tests): removing node compilation #2712

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use papyrus_storage::StorageReader;
use starknet_api::block::BlockNumber;
use starknet_api::core::{ContractAddress, Nonce};
use starknet_api::state::StateNumber;
use starknet_sequencer_node::test_utils::compilation::{get_node_executable_path, spawn_run_node};
use starknet_sequencer_node::test_utils::node_runner::{get_node_executable_path, spawn_run_node};
use starknet_types_core::felt::Felt;
use tracing::info;

Expand Down
3 changes: 1 addition & 2 deletions crates/starknet_sequencer_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repository.workspace = true
license.workspace = true

[features]
testing = ["papyrus_proc_macros", "thiserror"]
testing = ["papyrus_proc_macros"]

[lints]
workspace = true
Expand Down Expand Up @@ -40,7 +40,6 @@ starknet_sequencer_infra.workspace = true
starknet_sierra_compile.workspace = true
starknet_state_sync.workspace = true
starknet_state_sync_types.workspace = true
thiserror = { workspace = true, optional = true }
tokio.workspace = true
tracing.workspace = true
validator.workspace = true
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion crates/starknet_sequencer_node/src/test_utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub mod compilation;
pub mod node_runner;
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::io;
use std::path::PathBuf;
use std::process::{ExitStatus, Stdio};
use std::process::Stdio;

use infra_utils::command::create_shell_command;
use infra_utils::path::resolve_project_relative_path;
Expand All @@ -10,48 +9,6 @@ use tracing::{error, info};

pub const NODE_EXECUTABLE_PATH: &str = "target/debug/starknet_sequencer_node";

#[cfg(test)]
#[path = "compilation_test.rs"]
mod compilation_test;

#[derive(thiserror::Error, Debug)]
pub enum NodeCompilationError {
#[error(transparent)]
IO(#[from] io::Error),
#[error("Exit status: {0}.")]
Status(ExitStatus),
}

/// Compiles the node using `cargo build` for testing purposes.
async fn compile_node() -> io::Result<ExitStatus> {
info!(
"Compiling the starknet_sequencer_node binary, expected destination: \
{NODE_EXECUTABLE_PATH}"
);

// Run `cargo build` to compile the project
let compilation_result = create_shell_command("cargo")
.arg("build")
.arg("--bin")
.arg("starknet_sequencer_node")
.arg("--quiet")
.stderr(Stdio::inherit())
.stdout(Stdio::inherit())
.status()
.await?;

info!("Compilation result: {:?}", compilation_result);
Ok(compilation_result)
}

pub async fn compile_node_result() -> Result<(), NodeCompilationError> {
match compile_node().await {
Ok(status) if status.success() => Ok(()),
Ok(status) => Err(NodeCompilationError::Status(status)),
Err(e) => Err(NodeCompilationError::IO(e)),
}
}

pub async fn spawn_run_node(node_config_path: PathBuf) -> JoinHandle<()> {
task::spawn(async move {
info!("Running the node from its spawned task.");
Expand Down
Loading