Skip to content

Commit

Permalink
revert testing changes and use risc0 dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
zeegomo committed Sep 9, 2024
1 parent 43e6c5d commit d75c0e8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 52 deletions.
53 changes: 5 additions & 48 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,70 +92,27 @@ jobs:
- name: Cargo test (Other OSes)
if: matrix.os != 'windows-latest'
uses: actions-rs/cargo@v1
env:
RISC0_DEV_MODE: true
with:
command: test
args: --all --no-default-features --features ${{ matrix.feature }} --exclude tests
args: --all --no-default-features --features ${{ matrix.feature }}
- name: Cargo test (Windows)
if: matrix.os == 'windows-latest'
uses: actions-rs/cargo@v1
env:
# Because Windows runners in Github Actions tend to be slow.
SLOW_TEST_ENV: true
RISC0_DEV_MODE: true
with:
command: test
args: --workspace --no-default-features --features ${{ matrix.feature }} --exclude tests
args: --no-default-features --features ${{ matrix.feature }}
- 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: [ prove, "prove,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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --all --no-default-features --features ${{ matrix.feature }}
- name: Cargo test
uses: actions-rs/cargo@v1
env:
CONSENSUS_SLOT_TIME: 520 # one proof takes about 240s, but multiple leaders share the same hardware
with:
command: test
args: --manifest-path tests/Cargo.toml --features ${{ matrix.feature }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: integration-test-artifacts
path: nomos-node/tests/.tmp*

lints:
name: Rust lints
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ time = "0.3"
[[test]]
name = "test_cryptarchia_happy_path"
path = "src/tests/cryptarchia/happy.rs"
required-features = ["prove"]

[[test]]
name = "test_cli"
Expand All @@ -56,4 +55,3 @@ path = "src/tests/cli.rs"
[features]
mixnet = ["nomos-network/mixnet"]
metrics = ["nomos-node/metrics"]
prove = []
2 changes: 1 addition & 1 deletion tests/src/nodes/nomos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const CRYPTARCHIA_INFO_API: &str = "cryptarchia/info";
const GET_HEADERS_INFO: &str = "cryptarchia/headers";
const NOMOS_BIN: &str = "../target/debug/nomos-node";
const STORAGE_BLOCKS_API: &str = "storage/block";
const DEFAULT_SLOT_TIME: u64 = 30;
const DEFAULT_SLOT_TIME: u64 = 2;
const CONSENSUS_SLOT_TIME_VAR: &str = "CONSENSUS_SLOT_TIME";
#[cfg(feature = "mixnet")]
const NUM_MIXNODE_CANDIDATES: usize = 2;
Expand Down
2 changes: 1 addition & 1 deletion tests/src/tests/cryptarchia/happy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tests::{adjust_timeout, nodes::NomosNode, Node, SpawnConfig};
// how many times more than the expected time to produce a predefined number of blocks we wait before timing out
const TIMEOUT_MULTIPLIER: f64 = 3.0;
// how long we let the chain grow before checking the block at tip - k is the same in all chains
const CHAIN_LENGTH_MULTIPLIER: u32 = 1;
const CHAIN_LENGTH_MULTIPLIER: u32 = 2;

async fn happy_test(nodes: &[NomosNode]) {
let config = nodes[0].config();
Expand Down

0 comments on commit d75c0e8

Please sign in to comment.