Skip to content

Commit

Permalink
Run expensive tests regularly, but not on every pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
hrxi committed Jan 29, 2024
1 parent 209e971 commit 72d08aa
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions blockchain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ nimiq-test-utils = { workspace = true }
nimiq-zkp-primitives = { workspace = true }

[features]
expensive-tests = []
metrics = ["prometheus-client"]
2 changes: 1 addition & 1 deletion blockchain/tests/push_with_chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ fn can_ignore_chunks_with_invalid_start_key() {
}

#[test]
#[ignore]
#[cfg_attr(not(feature = "expensive-tests"), ignore)]
fn can_rebranch_and_revert_chunks() {
let temp_producer1 = TemporaryBlockProducer::new();
let temp_producer2 = TemporaryBlockProducer::new_incomplete();
Expand Down
1 change: 1 addition & 0 deletions consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@ nimiq-trie = { workspace = true }
nimiq-zkp-component = { workspace = true, features = ["zkp-prover", "parallel"] }

[features]
expensive-tests = []
full = ["nimiq-blockchain", "nimiq-blockchain-proxy/full"]
default = ["full"]
1 change: 0 additions & 1 deletion consensus/tests/history_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ async fn two_peers_can_sync_two_epochs() {
}

#[test(tokio::test)]
#[ignore]
async fn three_peers_can_sync() {
// FIXME: Add more tests
// // Setup third peer (not synced yet).
Expand Down
2 changes: 1 addition & 1 deletion consensus/tests/request_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use nimiq_test_utils::{
validator::seeded_rng,
};

#[ignore]
#[test(tokio::test(flavor = "multi_thread", worker_threads = 4))]
#[cfg_attr(not(feature = "expensive-tests"), ignore)]
async fn test_request_component() {
let mut hub = Some(MockHub::default());
let env = VolatileDatabase::new(20).expect("Could not open a volatile database");
Expand Down
2 changes: 1 addition & 1 deletion primitives/account/tests/staking_contract/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ fn revert_penalize_inherent(
}

// The following code is kept as a reference on how to generate the constants.
#[ignore]
#[test]
#[ignore]
fn generate_contract_2() {
let mut active_validators = BTreeMap::new();
active_validators.insert(
Expand Down
1 change: 1 addition & 0 deletions validator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,6 @@ nimiq-test-log = { workspace = true }
nimiq-test-utils = { workspace = true }

[features]
expensive-tests = []
metrics = ["nimiq-mempool/metrics"]
trusted_push = []
2 changes: 1 addition & 1 deletion validator/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async fn validator_update() {
}

#[test(tokio::test(flavor = "multi_thread"))]
#[ignore]
#[cfg_attr(not(feature = "expensive-tests"), ignore)]
async fn four_validators_can_create_an_epoch() {
let env = VolatileDatabase::new(20).expect("Could not open a volatile database");

Expand Down
2 changes: 1 addition & 1 deletion validator/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ fn create_skip_block_update(
)
}

#[ignore]
#[test(tokio::test)]
#[cfg_attr(not(feature = "expensive-tests"), ignore)]
async fn validator_can_catch_up() {
// remove first block producer in order to trigger a skip block. Never connect him again
// remove the second block producer to trigger another skip block after the first one (which we want someone to catch up to). Never connect him again
Expand Down
1 change: 1 addition & 0 deletions zkp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ nimiq-test-utils = { workspace = true }
nimiq-zkp-circuits = { workspace = true, features = ["zkp-prover"] }

[features]
expensive-tests = []
parallel = ["nimiq-zkp-circuits/parallel", "nimiq-zkp-primitives/parallel", "ark-crypto-primitives/parallel", "ark-ec/parallel", "ark-ff/parallel", "ark-std/parallel", "ark-groth16/parallel"]
zkp-prover = ["nimiq-zkp-circuits/zkp-prover", "nimiq-zkp-primitives/zkp-prover", "ark-crypto-primitives/r1cs", "ark-mnt4-753/r1cs", "ark-mnt6-753/r1cs", "ark-groth16/r1cs"]

Expand Down
2 changes: 1 addition & 1 deletion zkp/tests/prover/recursive_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl ConstraintSynthesizer<FqMNT6> for OuterCircuit {

// This test takes a very long time to finish, so run it only when necessary.
#[test]
#[ignore]
#[cfg_attr(not(feature = "expensive-tests"), ignore)]
fn recursive_input_works() {
// Create random number generator.
let rng = &mut test_rng(false);
Expand Down

0 comments on commit 72d08aa

Please sign in to comment.