Skip to content

Commit

Permalink
Put expensive tests behind an additional expensive-tests feature flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Mar 25, 2024
1 parent 0d8f569 commit bda72e3
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
--release
--workspace
${{ steps.prepare.outputs.feature-flags }}
--features expensive-tests
-- --ignored
- name: Verify working directory is clean
run: git diff --exit-code
Expand Down
3 changes: 3 additions & 0 deletions zcash_client_sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,8 @@ transparent-inputs = [
## Exposes unstable APIs. Their behaviour may change at any time.
unstable = ["zcash_client_backend/unstable"]

## A feature used to isolate tests that are expensive to run. Test-only.
expensive-tests = []

[lib]
bench = false
1 change: 1 addition & 0 deletions zcash_client_sqlite/src/wallet/orchard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ pub(crate) mod tests {

#[test]
#[ignore] // FIXME: #1316 This requires support for dust outputs.
#[cfg(not(feature = "expensive-tests"))]
fn zip317_spend() {
testing::pool::zip317_spend::<OrchardPoolTester>()
}
Expand Down
1 change: 1 addition & 0 deletions zcash_client_sqlite/src/wallet/sapling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ pub(crate) mod tests {

#[test]
#[ignore] // FIXME: #1316 This requires support for dust outputs.
#[cfg(not(feature = "expensive-tests"))]
fn zip317_spend() {
testing::pool::zip317_spend::<SaplingPoolTester>()
}
Expand Down
3 changes: 3 additions & 0 deletions zcash_primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ test-dependencies = [
"zcash_protocol/test-dependencies",
]

## A feature used to isolate tests that are expensive to run. Test-only.
expensive-tests = []

[lib]
bench = false

Expand Down
6 changes: 6 additions & 0 deletions zcash_primitives/src/transaction/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ fn check_roundtrip(tx: Transaction) -> Result<(), TestCaseError> {
proptest! {
#[test]
#[ignore]
#[cfg(feature = "expensive-tests")]
fn tx_serialization_roundtrip_sprout(tx in arb_tx(BranchId::Sprout)) {
check_roundtrip(tx)?;
}
Expand All @@ -70,6 +71,7 @@ proptest! {
proptest! {
#[test]
#[ignore]
#[cfg(feature = "expensive-tests")]
fn tx_serialization_roundtrip_overwinter(tx in arb_tx(BranchId::Overwinter)) {
check_roundtrip(tx)?;
}
Expand All @@ -78,6 +80,7 @@ proptest! {
proptest! {
#[test]
#[ignore]
#[cfg(feature = "expensive-tests")]
fn tx_serialization_roundtrip_sapling(tx in arb_tx(BranchId::Sapling)) {
check_roundtrip(tx)?;
}
Expand All @@ -86,6 +89,7 @@ proptest! {
proptest! {
#[test]
#[ignore]
#[cfg(feature = "expensive-tests")]
fn tx_serialization_roundtrip_blossom(tx in arb_tx(BranchId::Blossom)) {
check_roundtrip(tx)?;
}
Expand All @@ -94,6 +98,7 @@ proptest! {
proptest! {
#[test]
#[ignore]
#[cfg(feature = "expensive-tests")]
fn tx_serialization_roundtrip_heartwood(tx in arb_tx(BranchId::Heartwood)) {
check_roundtrip(tx)?;
}
Expand All @@ -119,6 +124,7 @@ proptest! {
proptest! {
#[test]
#[ignore]
#[cfg(feature = "expensive-tests")]
fn tx_serialization_roundtrip_future(tx in arb_tx(BranchId::ZFuture)) {
check_roundtrip(tx)?;
}
Expand Down
3 changes: 3 additions & 0 deletions zcash_proofs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ local-prover = ["directories"]
## Enables multithreading support for creating proofs.
multicore = ["bellman/multicore", "zcash_primitives/multicore"]

## A feature used to isolate tests that are expensive to run. Test-only.
expensive-tests = []

[lib]
bench = false

Expand Down
1 change: 1 addition & 0 deletions zcash_proofs/src/circuit/sprout/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ where

#[test]
#[ignore]
#[cfg(feature = "expensive-tests")]
fn test_sprout_constraints() {
use bellman::gadgets::test::*;
use bls12_381::Scalar;
Expand Down

0 comments on commit bda72e3

Please sign in to comment.