Skip to content

Commit

Permalink
full_test switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Apr 20, 2024
1 parent 8976015 commit 2fcedc5
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 55 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:

jobs:
formatting-and-testing:
setup:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -27,12 +27,26 @@ jobs:

- name: Provision Environment
run: python install.py

- name: Format code
run: cargo fmt --check

- name: Build
run: cargo build

tests:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Run cargo tests
run: cargo test

- name: Run snforge tests
run: snforge test
run: snforge test

full_tests:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Run cargo full_tests
run: cargo test --features full_test
5 changes: 4 additions & 1 deletion crates/prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ strum.workspace = true
tempfile.workspace = true
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
tracing.workspace = true

[features]
full_test = []
2 changes: 1 addition & 1 deletion crates/prover/src/stone_prover/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub mod models;

#[cfg(test)]
#[cfg(all(test, feature = "full_test"))]
pub mod multiple_job;
#[cfg(test)]
pub mod single_job;
27 changes: 17 additions & 10 deletions crates/prover/src/stone_prover/tests/models.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use crate::stone_prover::types::{config::Config, params::Params};
use crate::stone_prover::types::{
config::Config,
params::{Fri, Params, Stark},
};
use sharp_p2p_common::job_trace::JobTrace;
use std::{env, fs, io::Write, path::PathBuf};
use tempfile::NamedTempFile;
Expand All @@ -18,9 +21,6 @@ pub fn fixture() -> TestFixture {
let memory_path = ws_root.join("crates/tests/cairo/memory");
let trace_path = ws_root.join("crates/tests/cairo/trace");

let cpu_air_prover_config_path = ws_root.join("crates/tests/cairo/cpu_air_prover_config.json");
let cpu_air_params_path = ws_root.join("crates/tests/cairo/cpu_air_params.json");

let mut air_public_input = NamedTempFile::new().unwrap();
air_public_input.write_all(&fs::read(air_public_input_path).unwrap()).unwrap();

Expand All @@ -35,11 +35,18 @@ pub fn fixture() -> TestFixture {

TestFixture {
job_trace: JobTrace { air_public_input, air_private_input, memory, trace },
cpu_air_prover_config: serde_json::from_str(
&fs::read_to_string(cpu_air_prover_config_path).unwrap(),
)
.unwrap(),
cpu_air_params: serde_json::from_str(&fs::read_to_string(cpu_air_params_path).unwrap())
.unwrap(),
cpu_air_prover_config: Config::default(),
cpu_air_params: Params {
stark: Stark {
fri: Fri {
fri_step_list: vec![0, 4, 4, 3],
last_layer_degree_bound: 128,
n_queries: 1,
proof_of_work_bits: 1,
},
log_n_cosets: 1,
},
..Default::default()
},
}
}
5 changes: 4 additions & 1 deletion crates/runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ tempfile.workspace = true
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
zip-extensions.workspace = true
zip-extensions.workspace = true

[features]
full_test = []
2 changes: 1 addition & 1 deletion crates/runner/src/cairo_runner/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub mod models;

#[cfg(test)]
#[cfg(all(test, feature = "full_test"))]
pub mod multiple_job;
#[cfg(test)]
pub mod single_job;
5 changes: 4 additions & 1 deletion crates/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ license-file.workspace = true
futures.workspace = true
sharp-p2p-prover.workspace = true
sharp-p2p-runner.workspace = true
tokio.workspace = true
tokio.workspace = true

[features]
full_test = []
28 changes: 0 additions & 28 deletions crates/tests/cairo/cpu_air_params.json

This file was deleted.

9 changes: 0 additions & 9 deletions crates/tests/cairo/cpu_air_prover_config.json

This file was deleted.

1 change: 1 addition & 0 deletions crates/tests/src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#[cfg(all(test, feature = "full_test"))]
mod runner_prover_flow;

0 comments on commit 2fcedc5

Please sign in to comment.