Skip to content

Commit

Permalink
fix: skip regression tests on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptonemo committed Oct 4, 2024
1 parent 08ef3a1 commit 771e9f2
Showing 1 changed file with 3 additions and 62 deletions.
65 changes: 3 additions & 62 deletions filecoin-proofs/tests/regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,70 +108,8 @@ pub(crate) fn load_regression_records(records: &Path) -> Result<Vec<SealRegressi
Ok(records)
}

// On MacOS, we only verify production parameter sizes and published test sector sizes
#[cfg(target_os = "macos")]
pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Result<bool> {
let r = record;

let sector_size: u64 = r.porep_config.sector_size.into();
let verified = match sector_size {
SECTOR_SIZE_2_KIB | SECTOR_SIZE_4_KIB | SECTOR_SIZE_16_KIB | SECTOR_SIZE_32_KIB => Ok(true),
SECTOR_SIZE_8_MIB => verify_seal::<SectorShape8MiB>(
&r.porep_config,
r.comm_r,
r.comm_d,
r.prover_id,
r.sector_id,
r.ticket,
r.seed,
&r.proof,
),
SECTOR_SIZE_512_MIB => verify_seal::<SectorShape512MiB>(
&r.porep_config,
r.comm_r,
r.comm_d,
r.prover_id,
r.sector_id,
r.ticket,
r.seed,
&r.proof,
),
SECTOR_SIZE_1_GIB => Ok(true),
SECTOR_SIZE_32_GIB => verify_seal::<SectorShape32GiB>(
&r.porep_config,
r.comm_r,
r.comm_d,
r.prover_id,
r.sector_id,
r.ticket,
r.seed,
&r.proof,
),
SECTOR_SIZE_64_GIB => verify_seal::<SectorShape64GiB>(
&r.porep_config,
r.comm_r,
r.comm_d,
r.prover_id,
r.sector_id,
r.ticket,
r.seed,
&r.proof,
),
_ => {
error!(
"Cannot verify proof: Unsupported sector size [{}]",
sector_size
);
Ok(false)
}
}?;

Ok(verified)
}

#[allow(non_snake_case)]
#[allow(unused_variables)]
#[cfg(not(target_os = "macos"))]
pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Result<bool> {
let r = record;

Expand Down Expand Up @@ -279,7 +217,10 @@ pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Res
Ok(verified)
}

// Skip this test on MacOS since it does not have the required
// parameters for verification
#[test]
#[cfg(not(target_os = "macos"))]
fn run_seal_regression_tests() -> Result<()> {
fil_logger::maybe_init();

Expand Down

0 comments on commit 771e9f2

Please sign in to comment.