Skip to content

Commit

Permalink
separate integrations tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zeegomo committed Sep 5, 2024
1 parent 71b46fc commit 6661b67
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 95 deletions.
75 changes: 55 additions & 20 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ jobs:
profile: minimal
toolchain: stable
override: true
- uses: cargo-bins/cargo-binstall@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install risc0
run: cargo install cargo-risczero && cargo risczero install
run: cargo binstall -y cargo-risczero && cargo risczero install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions-rs/cargo@v1
Expand Down Expand Up @@ -74,28 +77,22 @@ jobs:
- name: Setup build environment (Windows)
if: matrix.os == 'windows-latest'
uses: ./.github/actions/mingw-env
- name: Install risc0
run: cargo install cargo-risczero && cargo risczero install
- uses: cargo-bins/cargo-binstall@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cargo build (Other OSes)
if: matrix.os != 'macos-latest-xlarge'
- name: Install risc0
run: cargo binstall -y cargo-risczero && cargo risczero install
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --all --no-default-features --features ${{ matrix.feature }}
- name: Cargo build (MacOS)
if: matrix.os == 'macos-latest-xlarge'
uses: actions-rs/cargo@v1
with:
command: build
args: --all --no-default-features --features ${{ matrix.feature }},metal
- name: Cargo test (Ubuntu)
if: matrix.os == 'ubuntu-latest'
- name: Cargo test (Other OSes)
if: matrix.os != 'windows-latest'
uses: actions-rs/cargo@v1
with:
command: test
args: --all --no-default-features --features ${{ matrix.feature }}
args: --all --no-default-features --features ${{ matrix.feature }} --exclude tests
- name: Cargo test (Windows)
if: matrix.os == 'windows-latest'
uses: actions-rs/cargo@v1
Expand All @@ -104,15 +101,51 @@ jobs:
SLOW_TEST_ENV: true
with:
command: test
args: --workspace --no-default-features --features ${{ matrix.feature }} --exclude tests
- uses: actions/upload-artifact@v3
if: failure()
with:
name: integration-test-artifacts
path: tests/.tmp*

integration:
name: Integration tests
strategy:
fail-fast: false # all OSes should be tested even if one fails (default: true)
matrix:
feature: [ libp2p, "libp2p,mixnet" ]
os: [ ubuntu-latest, macos-latest ] # drop windows for now as risc0 does not support it
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Rust toolchain (Other OSes)
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: cargo-bins/cargo-binstall@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install risc0
run: cargo binstall -y cargo-risczero && cargo risczero install
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --all --no-default-features --features ${{ matrix.feature }}
- name: Cargo Test (MacOs)
if: matrix.os == 'macos-latest-xlarge' # need metal acceleration
- name: Cargo test
uses: actions-rs/cargo@v1
env:
CONSENSUS_SLOT_TIME: 15
CONSENSUS_SLOT_TIME: 270
with:
command: test
args: --all --no-default-features --features ${{ matrix.feature }},prove,metal -- --include-ignored
args: --manifest-path tests/Cargo.toml --features ${{ matrix.feature }},prove
- uses: actions/upload-artifact@v3
if: failure()
with:
Expand All @@ -138,9 +171,11 @@ jobs:
toolchain: stable
override: true
components: rustfmt, clippy

- uses: cargo-bins/cargo-binstall@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install risc0
run: cargo install cargo-risczero && cargo risczero install
run: cargo binstall -y cargo-risczero && cargo risczero install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run cargo fmt
Expand Down
74 changes: 0 additions & 74 deletions .github/workflows/nightly.yml

This file was deleted.

17 changes: 17 additions & 0 deletions cl/cl/src/nullifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@ mod test {

use super::*;

#[ignore = "nullifier test vectors not stable yet"]
#[test]
fn test_nullifier_commitment_vectors() {
assert_eq!(
NullifierSecret([0u8; 16]).commit().hex(),
"384318f9864fe57647bac344e2afdc500a672dedb29d2dc63b004e940e4b382a"
);
assert_eq!(
NullifierSecret([1u8; 16]).commit().hex(),
"0fd667e6bb39fbdc35d6265726154b839638ea90bcf4e736953ccf27ca5f870b"
);
assert_eq!(
NullifierSecret([u8::MAX; 16]).commit().hex(),
"1cb78e487eb0b3116389311fdde84cd3f619a4d7f487b29bf5a002eed3784d75"
);
}

#[test]
fn test_nullifier_same_sk_different_nonce() {
let mut rng = rand::thread_rng();
Expand Down
1 change: 0 additions & 1 deletion proof_of_leadership/risc0/prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ mod test {
}

#[test]
#[ignore]
fn test_leader_prover() {
let mut rng = thread_rng();

Expand Down

0 comments on commit 6661b67

Please sign in to comment.