Skip to content

Commit

Permalink
Update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
unstark committed Jun 15, 2024
1 parent c96f958 commit 4d19fdb
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 10 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"crates/prover_services/sharp_service",
"crates/utils",
"crates/settlement_clients/settlement-client-interface",
"e2e-tests",
]

[workspace.package]
Expand Down Expand Up @@ -37,6 +38,8 @@ starknet = "0.9.0"
tempfile = "3.8.1"
thiserror = "1.0.57"
tokio = { version = "1.37.0" }
tokio-stream = "0.1.15"
tokio-util = "0.7.11"
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18" }
url = { version = "2.5.0", features = ["serde"] }
Expand Down
3 changes: 2 additions & 1 deletion crates/orchestrator/src/tests/jobs/da_job/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ async fn test_process_job() {
let mut da_client = MockDaClient::new();
let internal_id = "1";
da_client.expect_publish_state_diff().times(1).returning(|_| Ok(internal_id.to_string()));
let config = init_config(Some(format!("http://localhost:{}", server.port())), None, None, Some(da_client), None).await;
let config =
init_config(Some(format!("http://localhost:{}", server.port())), None, None, Some(da_client), None).await;

let state_update = MaybePendingStateUpdate::Update(StateUpdate {
block_hash: FieldElement::default(),
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ version = "0.1.0"
edition = "2021"

[dependencies]
tokio.workspace = true
tokio= { workspace = true, features = ["full"] }
tokio-util.workspace = true
tokio-stream.workspace = true
url.workspace = true
reqwest.workspace = true
reqwest = { workspace = true, features = ["json"] }
serde_json.workspace = true

[[test]]
Expand Down
13 changes: 12 additions & 1 deletion e2e-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,18 @@ impl Orchestrator {
let args = [args, vec!["--rpc-address", address.as_str()]].concat();
let port_str = format!("{}", port);

let process = Self::cargo_run(repository_root.as_path(), binary, args, vec![("PORT", port_str.as_str())]);
let process = Self::cargo_run(
repository_root.as_path(),
binary,
args,
vec![
("PORT", port_str.as_str()),
// TODO: mock Madara RPC API
("MADARA_RPC_URL", "http://localhost"),
// TODO: spawn mongo db
("MONGODB_CONNECTION_STRING", "http://localhost"),
],
);

Self { process, address }
}
Expand Down
8 changes: 2 additions & 6 deletions e2e-tests/test_prover_jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ async fn test_sharp_job_completes() {

let client = reqwest::Client::new();

let create_job = json!({ "job_type": "ProofRegistration", "internal_id": "12345" });
let create_job = json!({ "job_type": "ProofCreation", "internal_id": "12345" });

client.get(orchestrator.endpoint().join("/create_job").unwrap())
.json(&create_job)
.send()
.await
.unwrap();
client.get(orchestrator.endpoint().join("/create_job").unwrap()).json(&create_job).send().await.unwrap();
}

0 comments on commit 4d19fdb

Please sign in to comment.