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

test: fix tests to run standalone in wallet #4526

Merged

Conversation

stringhandler
Copy link
Collaborator

Allow tests to be run individually, i.e. cargo test -p tari_wallet in the wallet.

The main reason this didn't work was that the wallet excluded the base_node feature from tari_core. I've added it as a dev-dependency, but not sure if it breaks the libwallet build

@AaronFeickert
Copy link
Collaborator

Tested manually, and this fix appears to work for individual wallet tests. Have not tested any other build consequences.

@sdbondi
Copy link
Member

sdbondi commented Aug 24, 2022

Unfortunately it appears that rust still has the issue where it uses features from dev dependencies in release builds.
Tested with cargo build --package tari_wallet --release and croaring is included in the build.

I think the following works in tari_core/lib.rs:

#[cfg(feature = "base_node")]
mod domain_hash {
    use tari_crypto::{hash::blake2::Blake256, hash_domain, hashing::DomainSeparatedHasher};
    use tari_mmr::{pruned_hashset::PrunedHashSet, Hash, MerkleMountainRange, MutableMmr};

    hash_domain!(
        KernelMmrHashDomain,
        "com.tari.tari_project.base_layer.core.kernel_mmr",
 // (snip..)
}
#[cfg(feature = "base_node")]
pub use domain_hash::*;

@AaronFeickert
Copy link
Collaborator

Any manual tests/processes that should be run to confirm this works as expected?

@stringhandler
Copy link
Collaborator Author

@AaronFeickert I need to fix the CI jobs

@stringhandler stringhandler merged commit 8289493 into tari-project:development Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants