From cf995f9849098caf7e1d3e40e03921278dddd4c5 Mon Sep 17 00:00:00 2001 From: ThetaSinner Date: Sat, 6 Apr 2024 01:27:39 +0100 Subject: [PATCH] Fix tests --- .github/workflows/test.yaml | 4 ++-- dnas/checked/zomes/coordinator/fetch/src/lib.rs | 6 +++--- package.json | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bad5373..209d009 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,11 +30,11 @@ jobs: - name: Run Rust tests run: | - nix develop --command cargo test + nix develop --command npm run test:unit - name: Run Tryorama tests run: | - nix develop --command npm test + nix develop --command npm run test:integration - name: Run CLI tests run: | diff --git a/dnas/checked/zomes/coordinator/fetch/src/lib.rs b/dnas/checked/zomes/coordinator/fetch/src/lib.rs index 8478373..a08fe18 100644 --- a/dnas/checked/zomes/coordinator/fetch/src/lib.rs +++ b/dnas/checked/zomes/coordinator/fetch/src/lib.rs @@ -522,7 +522,7 @@ mod tests { println!("Picked signatures: {:?}", picked); // All from the first 30 - assert!(picked.iter().all(|sig| { sig.signature[0] <= 30 })); + assert!(picked.iter().all(|sig| { sig.signature.as_bytes()[0] <= 30 })); } #[test] @@ -597,7 +597,7 @@ mod tests { assert_eq!(5, picked.len()); // All from the last 30 - assert!(picked.iter().all(|sig| { sig.signature[0] >= 70 })); + assert!(picked.iter().all(|sig| { sig.signature.as_bytes()[0] >= 70 })); } #[test] @@ -629,7 +629,7 @@ mod tests { assert_eq!(5, picked.len()); // All from the last 30 - assert!(picked.iter().all(|sig| { sig.signature[0] >= 70 })); + assert!(picked.iter().all(|sig| { sig.signature.as_bytes()[0] >= 70 })); } fn current_time() -> Timestamp { diff --git a/package.json b/package.json index 2569891..e609708 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,10 @@ "scripts": { "start": "AGENTS=2 BOOTSTRAP_PORT=$(port) SIGNAL_PORT=$(port) npm run network", "network": "hc s clean && npm run build:happ && UI_PORT=8888 concurrently \"npm start -w ui\" \"npm run launch:happ\" \"echo 'Not running holochain-playground'\"", - "test": "npm run build:zomes && hc app pack workdir --recursive && RUST_LOG=warn WASM_LOG=info npm t -w tests", + "test:unit": "cargo test", + "test:integration": "npm run build:zomes && hc app pack workdir --recursive && RUST_LOG=warn WASM_LOG=info npm t -w tests", + "test:cli": "npm run build:happ && cargo test --manifest-path ./checked_cli/Cargo.toml", + "test": "npm run test:unit && npm run test:integration && npm run test:cli", "launch:happ": "hc-spin -n $AGENTS --ui-port $UI_PORT workdir/checked.happ", "start:tauri": "AGENTS=2 BOOTSTRAP_PORT=$(port) SIGNAL_PORT=$(port) npm run network:tauri", "network:tauri": "hc s clean && npm run build:happ && UI_PORT=8888 concurrently \"npm start -w ui\" \"npm run launch:tauri\" \"echo 'Not running holochain-playground'\"", @@ -16,7 +19,6 @@ "package": "npm run build:happ && npm run package -w ui && hc web-app pack workdir --recursive", "build:happ": "npm run build:zomes && hc app pack workdir --recursive", "build:zomes": "RUSTFLAGS='' CARGO_TARGET_DIR=target cargo build --release --target wasm32-unknown-unknown", - "test:cli": "npm run build:happ && cargo test --manifest-path ./checked_cli/Cargo.toml", "lint": "npm run -w ui lint && npm run -w tests lint && cargo clippy && cargo clippy --manifest-path ./checked_cli/Cargo.toml", "format": "npm run -w ui format && npm run -w tests format && cargo fmt && cargo fmt --manifest-path ./checked_cli/Cargo.toml" },