Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update zcash local net pt2 #102

Merged
merged 4 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
- To run client rpc tests:
1) Simlink or copy compiled `zebrad`, zcashd` and `zcash-cli` binaries to `$ zaino/test_binaries/bins/*`
2) Build release binary `cargo build --release` WARNING: these tests do not use the binary built by cargo nextest
3) Generate the chain cache `cargo nextest run generate_zcashd_chain_cach --run-ignored ignored-only --features test_fixtures`
3) Generate the chain cache `cargo nextest run generate_zcashd_chain_cache --run-ignored ignored-only`
4) Run `cargo nextest run --test client_rpcs`

- To Run client rpc testnet tests i.e. `get_subtree_roots_sapling`:
1) sync Zebrad testnet to at least 2 sapling and 2 orchard shards
2) copy the Zebrad cache to `zaino/integration-tests/chain_cache/testnet_get_subtree_roots_sapling` directory.
3) copy the Zebrad cache to `zaino/integration-tests/chain_cache/testnet_get_subtree_roots_orchard` directory.
- To run client rpc test `get_subtree_roots_sapling`:
1) sync Zebrad testnet to at least 2 sapling shards
2) copy the Zebrad testnet `state` cache to `zaino/integration-tests/chain_cache/get_subtree_roots_sapling` directory.
See the `get_subtree_roots_sapling` test fixture doc comments in zcash_local_net for more details.

- To run client rpc test `get_subtree_roots_orchard`:
1) sync Zebrad mainnet to at least 2 orchard shards
2) copy the Zebrad mainnet `state` cache to `zaino/integration-tests/chain_cache/get_subtree_roots_orchard` directory.
See the `get_subtree_roots_orchard` test fixture doc comments in zcash_local_net for more details.

8 changes: 1 addition & 7 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,12 @@ authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }


[features]
# Used by zcash-local-net:
test_fixtures = []

[dependencies]
# Test utility
zaino-testutils = { path = "../zaino-testutils" }

# Test fixtures
zcash_local_net = { git = "https://github.com/Oscar-Pepper/zcash-local-net.git", branch = "testnet_framework", features = [ "test_fixtures" ] }
# zcash_local_net = { git = "https://github.com/zingolabs/zcash-local-net.git", branch = "dev", features = [ "test_fixtures" ] }
zcash_local_net = { git = "https://github.com/zingolabs/zcash-local-net.git", branch = "dev", features = [ "test_fixtures" ] }

# Lightclient
zingolib = { workspace = true }
Expand Down

This file was deleted.

This file was deleted.

9 changes: 7 additions & 2 deletions integration-tests/tests/client_rpcs.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
//! Tests Zainod release binary against the `zcash_local_net` client RPC test fixtures.
//!
//! Ensure the release binary is up-to-date with `cargo build --release` before running this test-suite.
//!
//! See `Testing` section of README.md for more details.

use std::path::PathBuf;

use once_cell::sync::Lazy;
use zcash_local_net::network::Network;

static ZCASHD_BIN: Lazy<Option<PathBuf>> = Lazy::new(|| {
let mut workspace_root_path = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
Expand Down Expand Up @@ -372,7 +375,7 @@ async fn get_latest_tree_state() {
}

/// This test requires Zebrad testnet to be already synced to at least 2 sapling shards with the cache at
/// `zaino/chain_cache/testnet_get_subtree_roots`
/// `zaino/chain_cache/get_subtree_roots_sapling`
///
/// See doc comments of test_fixture for more details.
#[tokio::test]
Expand All @@ -383,12 +386,13 @@ async fn get_subtree_roots_sapling() {
ZEBRAD_BIN.clone(),
ZAINOD_BIN.clone(),
LIGHTWALLETD_BIN.clone(),
Network::Testnet,
)
.await;
}

/// This test requires Zebrad testnet to be already synced to at least 2 orchard shards with the cache at
/// `zaino/chain_cache/testnet_get_subtree_roots`
/// `zaino/chain_cache/get_subtree_roots_orchard`
///
/// See doc comments of test_fixture for more details.
#[tokio::test]
Expand All @@ -399,6 +403,7 @@ async fn get_subtree_roots_orchard() {
ZEBRAD_BIN.clone(),
ZAINOD_BIN.clone(),
LIGHTWALLETD_BIN.clone(),
Network::Mainnet,
)
.await;
}
Expand Down
Loading