Environment: Linux Mint 17.2 Cinnamon 64-bit
Testing Crate: Crust
I’m sharing my current steps for building and testing crust. I have used @philip_rhoades’s script in the past to update and build everything, but it can take quite a while to build everything from scratch. So, a lot of times including after the latest developer update, I just use the text commands to build a single crate at a time. This is the full process:
- Run a script to update rust nightly to the current version, which just runs this command “
curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly”. I saved it into a bash script so I wouldn’t have to remember that, called update-rust.sh. You don’t need to run under sudo, it will ask for permission during the script.
- If you don’t have the source downloaded, clone the crust repository with “
git clone https://github.com/maidsafe/crust.git”. Otherwise, change dir into the crust directory, and run “
git pull”. (It’s possible this won’t get the latest versions if you’ve been modifying the source, so look in the output for issues like this.)
- From within the crust directory, run “
cargo clean”, removing all previous built code in this crate.
- Run “
cargo update”, updating cargo’s knowledge of its crate repositories.
- Run “
- Run “
EXPORT RUST_TEST_THREADS=1”, setting this environment variable that some tests need (it seems like this can be combined on one line with the test command below separated by space, but I haven’t tried it. I wonder if this sets the value just for the duration of the command.).
- Run “
And the test results were as follows:
running 20 tests
test beacon::test::test_avoid_beacon … ok
test beacon::test::test_beacon … ok
test bootstrap_handler::test::duplicates … ok
test bootstrap_handler::test::max_contacts … ok
test bootstrap_handler::test::oldest … ok
test bootstrap_handler::test::prune … ok
test bootstrap_handler::test::serialisation … ok
test config_utils::test::read_config_file_test … ok
test connection_manager::test::bootstrap … ok
test connection_manager::test::bootstrap_off_list_connects … ok
test connection_manager::test::bootstrap_off_list_connects_multiple … ok
test connection_manager::test::connection_manager … ok
test connection_manager::test::connection_manager_start … ok
test connection_manager::test::network … ignored
test getifaddrs::test::test_filter_loopback … ok
test getifaddrs::test::test_getifaddrs … ok
test tcp_connections::test::test_multiple_nodes_small_stream … ok
test tcp_connections::test::test_small_stream … ok
test test::check_rust_unit_testing_is_not_parallel … ok
test transport::test::test_ord … ok
test result: ok. 19 passed; 0 failed; 1 ignored; 0 measured
If you’re building other crates, you don’t need to update rust or update cargo again. That is a global update. Let me know if you have any questions for me about the process.