Skip to content

Commit dac5289

Browse files
authored
tests: put large regression tests behind feature flag (#1778)
Put the regression tests for sector sizes > 32KiB behind the `big-tests` feature flag. This way a test run without the flag doesn't need the parameter files for all sector sizes. For running with the `big-tests` flag, the parameter files for all sector sizes are expected.
1 parent 0116b28 commit dac5289

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

filecoin-proofs/tests/regression.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ use std::path::Path;
44

55
use anyhow::Result;
66
use filecoin_proofs::{
7-
verify_seal, SectorShape16KiB, SectorShape1GiB, SectorShape2KiB, SectorShape32GiB,
8-
SectorShape32KiB, SectorShape4KiB, SectorShape512MiB, SectorShape64GiB, SectorShape8MiB,
7+
verify_seal, SectorShape16KiB, SectorShape2KiB, SectorShape32KiB, SectorShape4KiB,
98
SECTOR_SIZE_16_KIB, SECTOR_SIZE_1_GIB, SECTOR_SIZE_2_KIB, SECTOR_SIZE_32_GIB,
109
SECTOR_SIZE_32_KIB, SECTOR_SIZE_4_KIB, SECTOR_SIZE_512_MIB, SECTOR_SIZE_64_GIB,
1110
SECTOR_SIZE_8_MIB,
1211
};
12+
#[cfg(feature = "big-tests")]
13+
use filecoin_proofs::{
14+
SectorShape1GiB, SectorShape32GiB, SectorShape512MiB, SectorShape64GiB, SectorShape8MiB,
15+
};
16+
1317
use log::{error, info};
1418
use serde::{Deserialize, Serialize};
1519

@@ -172,6 +176,7 @@ pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Res
172176
r.seed,
173177
&r.proof,
174178
),
179+
#[cfg(feature = "big-tests")]
175180
SECTOR_SIZE_8_MIB => verify_seal::<SectorShape8MiB>(
176181
&r.porep_config,
177182
r.comm_r,
@@ -182,6 +187,7 @@ pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Res
182187
r.seed,
183188
&r.proof,
184189
),
190+
#[cfg(feature = "big-tests")]
185191
SECTOR_SIZE_512_MIB => verify_seal::<SectorShape512MiB>(
186192
&r.porep_config,
187193
r.comm_r,
@@ -192,6 +198,7 @@ pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Res
192198
r.seed,
193199
&r.proof,
194200
),
201+
#[cfg(feature = "big-tests")]
195202
SECTOR_SIZE_1_GIB => verify_seal::<SectorShape1GiB>(
196203
&r.porep_config,
197204
r.comm_r,
@@ -202,6 +209,7 @@ pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Res
202209
r.seed,
203210
&r.proof,
204211
),
212+
#[cfg(feature = "big-tests")]
205213
SECTOR_SIZE_32_GIB => verify_seal::<SectorShape32GiB>(
206214
&r.porep_config,
207215
r.comm_r,
@@ -212,6 +220,7 @@ pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Res
212220
r.seed,
213221
&r.proof,
214222
),
223+
#[cfg(feature = "big-tests")]
215224
SECTOR_SIZE_64_GIB => verify_seal::<SectorShape64GiB>(
216225
&r.porep_config,
217226
r.comm_r,
@@ -222,6 +231,15 @@ pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Res
222231
r.seed,
223232
&r.proof,
224233
),
234+
#[cfg(not(feature = "big-tests"))]
235+
SECTOR_SIZE_8_MIB | SECTOR_SIZE_512_MIB | SECTOR_SIZE_1_GIB | SECTOR_SIZE_32_GIB
236+
| SECTOR_SIZE_64_GIB => {
237+
info!(
238+
"`big-tests` feature is disabled, hence skipping verification for sector size [{}]",
239+
sector_size
240+
);
241+
Ok(true)
242+
}
225243
_ => {
226244
error!(
227245
"Cannot verify proof: Unsupported sector size [{}]",

0 commit comments

Comments
 (0)