Skip to content

Commit

Permalink
Ignored most of expensive dkg tests and made them run only on PRs to …
Browse files Browse the repository at this point in the history
…develop/master
  • Loading branch information
jstuczyn committed Jun 14, 2022
1 parent 81bbb61 commit 088b7ab
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ jobs:
command: test
args: --workspace --all-features

- name: Run expensive tests
if: github.ref == 'refs/heads/develop' || github.event.pull_request.base.ref == 'develop' || github.event.pull_request.base.ref == 'master'
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-features -- --ignored

- name: Check formatting
uses: actions-rs/cargo@v1
with:
Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
test-all: test cargo-test-expensive
test: build clippy-all cargo-test wasm fmt
no-clippy: build cargo-test wasm fmt
happy: fmt clippy-happy test
clippy-all: clippy-all-main clippy-all-contracts clippy-all-wallet clippy-all-connect
clippy-happy: clippy-happy-main clippy-happy-contracts clippy-happy-wallet clippy-happy-connect
cargo-test: test-main test-contracts test-wallet test-connect
cargo-test-expensive: test-main-expensive test-contracts-expensive test-wallet-expensive test-connect-expensive
build: build-contracts build-wallet build-main build-connect
fmt: fmt-main fmt-contracts fmt-wallet fmt-connect

Expand Down Expand Up @@ -34,15 +36,27 @@ clippy-all-connect:
test-main:
cargo test --all-features --workspace

test-main-expensive:
cargo test --all-features --workspace -- --ignored

test-contracts:
cargo test --manifest-path contracts/Cargo.toml --all-features

test-contracts-expensive:
cargo test --manifest-path contracts/Cargo.toml --all-features -- --ignored

test-wallet:
cargo test --manifest-path nym-wallet/Cargo.toml --all-features

test-wallet-expensive:
cargo test --manifest-path nym-wallet/Cargo.toml --all-features -- --ignored

test-connect:
cargo test --manifest-path nym-connect/Cargo.toml --all-features

test-connect-expensive:
cargo test --manifest-path nym-connect/Cargo.toml --all-features -- --ignored

build-main:
cargo build --workspace

Expand Down
7 changes: 7 additions & 0 deletions common/crypto/dkg/src/bte/encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn share_decryption_20() {
let dummy_seed = [1u8; 32];
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
Expand Down Expand Up @@ -487,6 +488,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn share_encryption_under_nonzero_epoch() {
let dummy_seed = [1u8; 32];
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
Expand Down Expand Up @@ -557,6 +559,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn update_and_decrypt_10() {
let dummy_seed = [1u8; 32];
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
Expand All @@ -581,6 +584,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn reblinding_node_doesnt_affect_decryption() {
let dummy_seed = [1u8; 32];
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
Expand Down Expand Up @@ -623,6 +627,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn ciphertext_integrity_check_passes_for_valid_data() {
let params = setup();

Expand All @@ -640,6 +645,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn ciphertext_integrity_check_passes_fails_for_malformed_data() {
let params = setup();

Expand Down Expand Up @@ -668,6 +674,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn ciphertext_integrity_check_passes_fails_for_wrong_epoch() {
let params = setup();

Expand Down
4 changes: 4 additions & 0 deletions common/crypto/dkg/src/bte/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ mod tests {
use rand_core::SeedableRng;

#[test]
#[ignore] // expensive test
fn basic_coverage_nodes() {
// it's some basic test I've been performing when writing the update function, but figured
// might as well put it into a unit test. note that it doesn't check the entire structure,
Expand Down Expand Up @@ -761,6 +762,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn updating_to_next_epoch() {
let params = setup();

Expand Down Expand Up @@ -816,6 +818,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn bte_node_roundtrip() {
let params = setup();

Expand All @@ -839,6 +842,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn decryption_key_node_roundtrip() {
let params = setup();

Expand Down
1 change: 1 addition & 0 deletions common/crypto/dkg/src/bte/proof_chunking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn should_verify_a_valid_proof() {
let dummy_seed = [1u8; 32];
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
Expand Down
3 changes: 3 additions & 0 deletions common/crypto/dkg/src/dealing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ mod tests {
use rand_core::SeedableRng;

#[test]
#[ignore] // expensive test
fn recovering_partial_verification_keys() {
// START OF SETUP
let dummy_seed = [42u8; 32];
Expand Down Expand Up @@ -419,6 +420,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn verifying_partial_verification_keys() {
let dummy_seed = [42u8; 32];
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
Expand Down Expand Up @@ -467,6 +469,7 @@ mod tests {
}

#[test]
#[ignore] // expensive test
fn dealing_roundtrip() {
let dummy_seed = [1u8; 32];
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
Expand Down
3 changes: 3 additions & 0 deletions common/crypto/dkg/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use rand_core::SeedableRng;
use std::collections::BTreeMap;

#[test]
#[ignore] // expensive test
fn single_sender() {
// makes it easier to understand than `full_threshold_secret_sharing`
// and is a good stepping stone, because its everything each node will have to perform (from one point of view)
Expand Down Expand Up @@ -66,6 +67,7 @@ fn single_sender() {
}

#[test]
#[ignore] // expensive test
fn full_threshold_secret_sharing() {
let dummy_seed = [42u8; 32];
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
Expand Down Expand Up @@ -161,6 +163,7 @@ fn full_threshold_secret_sharing() {
}

#[test]
#[ignore] // expensive test
fn full_threshold_secret_resharing() {
let dummy_seed = [42u8; 32];
let mut rng = rand_chacha::ChaCha20Rng::from_seed(dummy_seed);
Expand Down

0 comments on commit 088b7ab

Please sign in to comment.