josecelano / cargo-pretty-test

A Rust command that prettifies the ugly `cargo test` output into a beautiful one.
https://users.rust-lang.org/t/cargo-test-output-with-indentation/100149
135 stars 1 forks source link

Missing doc tests #12

Closed josecelano closed 11 months ago

josecelano commented 11 months ago
$ cargo pretty-test
thread 'main' panicked at /home/josecelano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-pretty-test-0.2.0/src/parsing.rs:430:5:
assertion `left == right` failed: the parsed amount of running tests [265, 0, 96, 31] should equal to the number in stats.total [265, 0, 96, 0]
  left: [265, 0, 96, 31]
 right: [265, 0, 96, 0]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The whole cargo test output I'm using:

cargo_test_ouput.txt

zjp-CN commented 11 months ago

Is there any reproducible code?

The error shows the amount of last type test is 31 directly from the raw output, but zero tests are actually computed afterr parsing.

Or try the patch to see if it works as expected: cargo install cargo-pretty-test --git https://github.com/zjp-CN/pretty-test.git --branch experimental

josecelano commented 11 months ago

Is there any reproducible code?

I'm trying to use the command on a new workflow: https://github.com/torrust/torrust-tracker/pull/463

The error shows the amount of last type test is 31 directly from the raw output, but zero tests are actually computed afterr parsing.

Or try the patch to see if it works as expected: cargo install cargo-pretty-test --git https://github.com/zjp-CN/pretty-test.git --branch experimental

Output after running the patch:

josecelano@josecelano-desktop:~/Documents/git/committer/me/github/torrust/torrust-tracker$ cargo pretty-test
thread 'main' panicked at /home/josecelano/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-pretty-test-0.2.0/src/parsing.rs:430:5:
assertion `left == right` failed: the parsed amount of running tests [265, 0, 96, 31] should equal to the number in stats.total [265, 0, 96, 0]
  left: [265, 0, 96, 31]
 right: [265, 0, 96, 0]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
josecelano@josecelano-desktop:~/Documents/git/committer/me/github/torrust/torrust-tracker$ cargo install cargo-pretty-test --git https://github.com/zjp-CN/pretty-test.git --branch experimental
    Updating git repository `https://github.com/zjp-CN/pretty-test.git`
  Installing cargo-pretty-test v0.2.0 (https://github.com/zjp-CN/pretty-test.git?branch=experimental#ecec4f94)
    Updating crates.io index
  Downloaded strip-ansi-escapes v0.2.0
  Downloaded vte v0.11.1
  Downloaded 2 crates (49.1 KB) in 0.52s
   Compiling proc-macro2 v1.0.67
   Compiling unicode-ident v1.0.12
   Compiling rustix v0.38.14
   Compiling linux-raw-sys v0.4.7
   Compiling bitflags v2.4.0
   Compiling utf8parse v0.2.1
   Compiling hashbrown v0.14.0
   Compiling equivalent v1.0.1
   Compiling lazy_static v1.4.0
   Compiling termtree v0.4.1
   Compiling regex-lite v0.1.0
   Compiling indexmap v2.0.0
   Compiling quote v1.0.33
   Compiling vte_generate_state_changes v0.1.1
   Compiling is-terminal v0.4.9
   Compiling colored v2.0.4
   Compiling vte v0.11.1
   Compiling strip-ansi-escapes v0.2.0
   Compiling cargo-pretty-test v0.2.0 (/home/josecelano/.cargo/git/checkouts/pretty-test-8746edcc72aa2d6a/ecec4f9)
    Finished release [optimized] target(s) in 4.31s
   Replacing /home/josecelano/.cargo/bin/cargo-pretty-test
    Replaced package `cargo-pretty-test v0.2.0` with `cargo-pretty-test v0.2.0 (https://github.com/zjp-CN/pretty-test.git?branch=experimental#ecec4f94)` (executable `cargo-pretty-test`)
josecelano@josecelano-desktop:~/Documents/git/committer/me/github/torrust/torrust-tracker$ cargo pretty-test
[src/parsing.rs:369] stderr = "    Finished test [optimized + debuginfo] target(s) in 0.08s\n     Running unittests src/lib.rs (target/debug/deps/torrust_tracker-a256eb0529c2bbb0)\n     Running unittests src/main.rs (target/debug/deps/torrust_tracker-38f57505b4e1d4a0)\n     Running tests/integration.rs (target/debug/deps/integration-e462217af0c9a895)\n   Doc-tests torrust-tracker\n"
[src/parsing.rs:370] parse_stderr_inner(&cap) = TestRunner {
    ty: UnitLib,
    src: Src {
        src_path: "src/lib.rs",
        bin_name: "torrust_tracker",
    },
}
[src/parsing.rs:370] parse_stderr_inner(&cap) = TestRunner {
    ty: UnitBin,
    src: Src {
        src_path: "src/main.rs",
        bin_name: "torrust_tracker",
    },
}
[src/parsing.rs:370] parse_stderr_inner(&cap) = TestRunner {
    ty: Tests,
    src: Src {
        src_path: "tests/integration.rs",
        bin_name: "integration",
    },
}
[src/parsing.rs:370] parse_stderr_inner(&cap) = TestRunner {
    ty: Doc,
    src: Src {
        src_path: "torrust-tracker",
        bin_name: "torrust-tracker",
    },
}
thread 'main' panicked at src/parsing.rs:437:5:
assertion `left == right` failed: the parsed amount of running tests [265, 0, 96, 31] should equal to the number in stats.total [265, 0, 96, 0]
  left: [265, 0, 96, 31]
 right: [265, 0, 96, 0]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/josecelano/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.74.0-nightly (37390d656 2023-09-24)
josecelano commented 11 months ago

And the whole cargo test output:

josecelano@josecelano-desktop:~/Documents/git/committer/me/github/torrust/torrust-tracker$ cargo test
    Finished test [optimized + debuginfo] target(s) in 0.07s
     Running unittests src/lib.rs (target/debug/deps/torrust_tracker-a256eb0529c2bbb0)

running 265 tests
test servers::apis::v1::context::stats::resources::tests::stats_resource_should_be_converted_from_tracker_metrics ... ok
test servers::apis::v1::context::torrent::resources::torrent::tests::torrent_resource_list_item_should_be_converted_from_the_basic_torrent_info ... ok
test servers::apis::v1::context::auth_key::resources::tests::it_should_be_convertible_into_an_auth_key ... ok
test servers::apis::v1::context::auth_key::resources::tests::it_should_be_convertible_from_an_auth_key ... ok
test servers::apis::v1::context::torrent::resources::torrent::tests::torrent_resource_should_be_converted_from_torrent_info ... ok
test servers::apis::v1::context::auth_key::resources::tests::it_should_be_convertible_into_json ... ok
test bootstrap::config::tests::it_should_load_with_default_config ... ok
test servers::http::percent_encoding::tests::it_should_decode_a_percent_encoded_info_hash ... ok
test servers::http::percent_encoding::tests::it_should_decode_a_percent_encoded_peer_id ... ok
test servers::http::percent_encoding::tests::it_should_fail_decoding_an_invalid_percent_encoded_info_hash ... ok
test servers::http::percent_encoding::tests::it_should_fail_decoding_an_invalid_percent_encoded_peer_id ... ok
test servers::http::v1::extractors::announce_request::tests::it_should_reject_a_request_with_a_query_that_cannot_be_parsed ... ok
test servers::http::v1::extractors::announce_request::tests::it_should_reject_a_request_without_query_params ... ok
test servers::http::v1::extractors::scrape_request::tests::it_should_reject_a_request_with_a_query_that_cannot_be_parsed ... ok
test servers::http::v1::extractors::announce_request::tests::it_should_extract_the_announce_request_from_the_url_query_params ... ok
test servers::http::v1::extractors::announce_request::tests::it_should_reject_a_request_with_a_query_that_cannot_be_parsed_into_an_announce_request ... ok
test servers::http::v1::extractors::scrape_request::tests::it_should_extract_the_scrape_request_from_the_url_query_params ... ok
test servers::http::v1::extractors::scrape_request::tests::it_should_reject_a_request_without_query_params ... ok
test servers::http::v1::extractors::scrape_request::tests::it_should_reject_a_request_with_a_query_that_cannot_be_parsed_into_a_scrape_request ... ok
test servers::http::v1::extractors::scrape_request::tests::it_should_extract_the_scrape_request_from_the_url_query_params_with_more_than_one_info_hash ... ok
test servers::http::v1::extractors::authentication_key::tests::it_should_return_an_authentication_error_if_the_key_cannot_be_parsed ... ok
test servers::http::v1::handlers::common::peer_ip::tests::it_should_map_a_peer_ip_resolution_error_into_an_error_response ... ok
test servers::http::v1::query::tests::url_query::param_name_value_pair::should_parse_a_single_query_param ... ok
test servers::http::v1::query::tests::url_query::param_name_value_pair::should_fail_parsing_an_invalid_query_param ... ok
test servers::http::v1::query::tests::url_query::should_be_instantiated_from_a_string_pair_vector ... ok
test servers::http::v1::query::tests::url_query::should_fail_parsing_an_invalid_query_string ... ok
test servers::http::v1::query::tests::url_query::should_trim_whitespaces ... ok
test servers::http::v1::query::tests::url_query::param_name_value_pair::should_be_displayed ... ok
test servers::http::v1::query::tests::url_query::should_ignore_the_preceding_question_mark_if_it_exists ... ok
test servers::http::v1::requests::announce::tests::announce_request::when_it_is_instantiated_from_the_url_query_params::it_should_fail_if_the_left_param_is_invalid ... ok
test servers::http::v1::query::tests::url_query::should_parse_the_query_params_from_an_url_query_string ... ok
test servers::http::v1::requests::announce::tests::announce_request::when_it_is_instantiated_from_the_url_query_params::it_should_fail_if_the_info_hash_param_is_invalid ... ok
test servers::http::v1::requests::announce::tests::announce_request::when_it_is_instantiated_from_the_url_query_params::it_should_fail_if_the_downloaded_param_is_invalid ... ok
test servers::http::v1::requests::announce::tests::announce_request::when_it_is_instantiated_from_the_url_query_params::it_should_fail_if_the_peer_id_param_is_invalid ... ok
test servers::http::v1::requests::announce::tests::announce_request::when_it_is_instantiated_from_the_url_query_params::it_should_fail_if_the_event_param_is_invalid ... ok
test servers::http::v1::requests::announce::tests::announce_request::should_be_instantiated_from_the_url_query_params ... ok
test servers::http::v1::requests::announce::tests::announce_request::when_it_is_instantiated_from_the_url_query_params::it_should_fail_if_the_port_param_is_invalid ... ok
test servers::http::v1::requests::announce::tests::announce_request::when_it_is_instantiated_from_the_url_query_params::it_should_fail_if_the_query_does_not_include_all_the_mandatory_params ... ok
test servers::http::v1::requests::announce::tests::announce_request::when_it_is_instantiated_from_the_url_query_params::it_should_fail_if_the_uploaded_param_is_invalid ... ok
test servers::http::v1::requests::scrape::tests::scrape_request::should_be_instantiated_from_the_url_query_with_only_one_infohash ... ok
test servers::http::v1::requests::scrape::tests::scrape_request::when_it_is_instantiated_from_the_url_query_params::it_should_fail_if_the_info_hash_param_is_invalid ... ok
test servers::http::v1::requests::scrape::tests::scrape_request::when_it_is_instantiated_from_the_url_query_params::it_should_fail_if_the_query_does_not_include_the_info_hash_param ... ok
test servers::http::v1::query::tests::url_query::should_allow_more_than_one_value_for_the_same_param::parsed_from_an_string ... ok
test servers::http::v1::query::tests::url_query::should_be_displayed::with_multiple_params ... ok
test servers::http::v1::requests::announce::tests::announce_request::should_be_instantiated_from_the_url_query_with_only_the_mandatory_params ... ok
test servers::http::v1::query::tests::url_query::should_be_displayed::with_multiple_values_for_the_same_param ... ok
test servers::http::v1::query::tests::url_query::should_allow_more_than_one_value_for_the_same_param::instantiated_from_a_vector ... ok
test servers::http::v1::query::tests::url_query::should_be_displayed::with_one_param ... ok
test servers::http::v1::requests::announce::tests::announce_request::when_it_is_instantiated_from_the_url_query_params::it_should_fail_if_the_compact_param_is_invalid ... ok
test servers::http::v1::responses::error::tests::http_tracker_errors_can_be_bencoded ... ok
test servers::http::v1::responses::announce::tests::compact_announce_response_can_be_bencoded ... ok
test servers::http::v1::responses::scrape::tests::scrape_response::should_be_bencoded ... ok
test servers::http::v1::responses::announce::tests::non_compact_announce_response_can_be_bencoded ... ok
test servers::http::v1::responses::scrape::tests::scrape_response::should_be_converted_from_scrape_data ... ok
test servers::http::v1::services::peer_ip_resolver::tests::working_on_reverse_proxy::it_should_get_the_peer_ip_from_the_right_most_ip_in_the_x_forwarded_for_header ... ok
test servers::http::v1::services::peer_ip_resolver::tests::working_without_reverse_proxy::it_should_return_an_error_if_it_cannot_get_the_peer_ip_from_the_connection_info ... ok
test servers::http::v1::services::peer_ip_resolver::tests::working_without_reverse_proxy::it_should_get_the_peer_ip_from_the_connection_info ... ok
test servers::udp::connection_cookie::tests::it_should_be_valid_for_the_next_time_extent ... ok
test servers::udp::connection_cookie::tests::it_should_be_valid_for_the_last_time_extent ... ok
test servers::udp::connection_cookie::tests::it_should_make_different_cookies_for_the_next_time_extent ... ok
test servers::udp::connection_cookie::tests::it_should_be_valid_for_this_time_extent ... ok
test servers::udp::connection_cookie::tests::it_should_make_the_different_connection_cookie_for_different_ip ... ok
test servers::http::v1::services::peer_ip_resolver::tests::working_on_reverse_proxy::it_should_return_an_error_if_it_cannot_get_the_right_most_ip_from_the_x_forwarded_for_header ... ok
test servers::udp::connection_cookie::tests::it_should_make_the_different_connection_cookie_for_different_ip_version ... ok
test servers::udp::connection_cookie::tests::it_should_make_the_different_connection_cookie_for_different_time_extents ... ok
test servers::udp::connection_cookie::tests::it_should_make_a_connection_cookie ... ok
test servers::udp::connection_cookie::tests::it_should_make_the_different_connection_cookie_for_different_socket ... ok
test servers::udp::connection_cookie::tests::it_should_make_the_same_connection_cookie_for_the_same_input_data ... ok
test servers::udp::connection_cookie::tests::it_should_be_not_valid_after_their_last_time_extent - should panic ... ok
test servers::apis::server::tests::it_should_be_able_to_start_from_stopped_state_and_then_stop_again ... ok
test servers::http::v1::handlers::announce::tests::with_tracker_on_reverse_proxy::it_should_fail_when_the_right_most_x_forwarded_for_header_ip_is_not_available ... ok
test servers::http::v1::services::announce::tests::with_tracker_in_any_mode::it_should_send_the_tcp_4_announce_event_when_the_peer_uses_ipv4 ... ok
test servers::http::v1::handlers::scrape::tests::with_tracker_in_private_mode::it_should_return_zeroed_swarm_metadata_when_the_authentication_key_is_missing ... ok
test servers::udp::handlers::tests::announce_request::using_ipv4::an_announced_peer_should_be_added_to_the_tracker ... ok
test servers::http::v1::services::announce::tests::with_tracker_in_any_mode::it_should_return_the_announce_data ... ok
test servers::http::v1::handlers::scrape::tests::with_tracker_in_private_mode::it_should_return_zeroed_swarm_metadata_when_the_authentication_key_is_invalid ... ok
test servers::http::v1::handlers::scrape::tests::with_tracker_in_listed_mode::it_should_return_zeroed_swarm_metadata_when_the_torrent_is_not_whitelisted ... ok
test servers::http::v1::handlers::announce::tests::with_tracker_not_on_reverse_proxy::it_should_fail_when_the_client_ip_from_the_connection_info_is_not_available ... ok
test servers::udp::handlers::tests::announce_request::using_ipv4::from_a_loopback_ip::the_peer_ip_should_be_changed_to_the_external_ip_in_the_tracker_configuration_if_defined ... ok
test servers::udp::handlers::tests::announce_request::using_ipv4::should_send_the_upd4_announce_event ... ok
test servers::http::v1::handlers::announce::tests::with_tracker_in_listed_mode::it_should_fail_when_the_announced_torrent_is_not_whitelisted ... ok
test servers::http::v1::handlers::announce::tests::with_tracker_in_private_mode::it_should_fail_when_the_authentication_key_is_missing ... ok
test servers::http::v1::handlers::announce::tests::with_tracker_in_private_mode::it_should_fail_when_the_authentication_key_is_invalid ... ok
test shared::bit_torrent::info_hash::tests::an_info_hash_can_be_created_from_a_byte_vector ... ok
test shared::bit_torrent::info_hash::tests::an_info_hash_can_be_created_from_a_valid_20_byte_array ... ok
test shared::bit_torrent::info_hash::tests::an_info_hash_can_be_created_from_a_valid_20_byte_array_slice ... ok
test shared::bit_torrent::info_hash::tests::an_info_hash_can_be_created_from_a_valid_40_utf8_char_string_representing_an_hexadecimal_value ... ok
test shared::bit_torrent::info_hash::tests::an_info_hash_can_be_deserialized ... ok
test shared::bit_torrent::info_hash::tests::an_info_hash_can_be_serialized ... ok
test shared::bit_torrent::info_hash::tests::an_info_hash_can_not_be_created_from_a_utf8_string_representing_a_not_valid_hexadecimal_value ... ok
test shared::bit_torrent::info_hash::tests::an_info_hash_can_only_be_created_from_a_40_utf8_char_string ... ok
test shared::bit_torrent::info_hash::tests::an_info_hash_should_by_displayed_like_a_40_utf8_lowercased_char_hex_string ... ok
test shared::bit_torrent::info_hash::tests::an_info_hash_should_return_its_a_40_utf8_lowercased_char_hex_representations_as_string ... ok
test shared::bit_torrent::info_hash::tests::it_should_fail_trying_to_create_an_info_hash_from_a_byte_vector_with_less_than_20_bytes ... ok
test shared::bit_torrent::info_hash::tests::it_should_fail_trying_to_create_an_info_hash_from_a_byte_vector_with_more_than_20_bytes ... ok
test shared::clock::stopped_clock::detail::tests::it_should_get_app_start_time ... ok
test shared::clock::stopped_clock::detail::tests::it_should_get_the_zero_start_time_when_testing ... ok
test shared::clock::stopped_clock::tests::it_should_default_to_zero_on_thread_exit ... ok
test shared::clock::stopped_clock::tests::it_should_default_to_zero_when_testing ... ok
test shared::clock::stopped_clock::tests::it_should_possible_to_set_the_time ... ok
test servers::http::v1::services::scrape::tests::with_real_data::it_should_send_the_tcp_6_scrape_event_when_the_peer_uses_ipv6 ... ok
test shared::clock::tests::it_should_be_the_stopped_clock_as_default_when_testing ... ok
test shared::clock::tests::it_should_have_different_times ... ok
test shared::clock::tests::timestamp::should_be_converted_from_datetime_utc ... ok
test shared::clock::tests::timestamp::should_be_converted_from_datetime_utc_in_iso_8601 ... ok
test shared::clock::tests::timestamp::should_be_converted_to_datetime_utc ... ok
test shared::clock::time_extent::test::fn_checked_duration_from_nanos::it_should_be_the_same_as_duration_implementation_for_u64_numbers ... ok
test servers::http::v1::services::scrape::tests::with_zeroed_data::it_should_send_the_tcp_4_scrape_event_when_the_peer_uses_ipv4 ... ok
test shared::clock::time_extent::test::fn_checked_duration_from_nanos::it_should_give_zero_for_zero_input ... ok
test servers::udp::handlers::tests::announce_request::using_ipv6::the_tracker_should_always_use_the_remote_client_ip_but_not_the_port_in_the_udp_request_header_instead_of_the_peer_address_in_the_announce_request ... ok
test shared::clock::time_extent::test::fn_checked_duration_from_nanos::it_should_fail_for_numbers_that_are_too_large ... ok
test shared::clock::time_extent::test::fn_checked_duration_from_nanos::it_should_work_for_some_numbers_larger_than_u64 ... ok
test shared::clock::time_extent::test::make_time_extent::fn_now::it_should_fail_for_zero ... ok
test shared::clock::time_extent::test::make_time_extent::fn_now::it_should_fail_if_amount_exceeds_bounds ... ok
test shared::clock::time_extent::test::make_time_extent::fn_now::it_should_give_a_time_extent ... ok
test shared::clock::time_extent::test::make_time_extent::fn_now_after::it_should_give_a_time_extent ... ok
test shared::clock::time_extent::test::make_time_extent::fn_now_after::it_should_fail_if_amount_exceeds_bounds ... ok
test shared::clock::time_extent::test::make_time_extent::fn_now_after::it_should_fail_for_zero ... ok
test shared::clock::time_extent::test::make_time_extent::fn_now_before::it_should_fail_for_zero ... ok
test shared::clock::time_extent::test::make_time_extent::fn_now_before::it_should_fail_if_amount_exceeds_bounds ... ok
test shared::clock::time_extent::test::time_extent::fn_decrease::it_should_decrease ... ok
test shared::clock::time_extent::test::time_extent::fn_decrease::it_should_fail_when_attempting_to_decrease_beyond_bounds ... ok
test servers::http::v1::handlers::scrape::tests::with_tracker_on_reverse_proxy::it_should_fail_when_the_right_most_x_forwarded_for_header_ip_is_not_available ... ok
test shared::clock::time_extent::test::time_extent::fn_decrease::it_should_not_decrease_for_zero ... ok
test shared::clock::time_extent::test::time_extent::fn_default::it_should_default_initialize_to_zero ... ok
test shared::clock::time_extent::test::make_time_extent::fn_now_before::it_should_give_a_time_extent ... ok
test shared::clock::time_extent::test::time_extent::fn_from_sec::it_should_make_empty_for_zero ... ok
test shared::clock::time_extent::test::time_extent::fn_from_sec::it_should_make_from_seconds ... ok
test shared::clock::time_extent::test::time_extent::fn_increase::it_should_fail_when_attempting_to_increase_beyond_bounds ... ok
test shared::clock::time_extent::test::time_extent::fn_increase::it_should_increase ... ok
test shared::clock::time_extent::test::time_extent::fn_increase::it_should_not_increase_for_zero ... ok
test shared::clock::time_extent::test::time_extent::fn_new::it_should_make_empty_for_zero ... ok
test shared::clock::time_extent::test::time_extent::fn_new::it_should_make_new ... ok
test shared::clock::time_extent::test::time_extent::fn_total::it_should_be_zero_for_zero ... ok
test shared::clock::time_extent::test::time_extent::fn_total::it_should_fail_when_product_is_too_large ... ok
test shared::clock::time_extent::test::time_extent::fn_total::it_should_fail_when_too_large ... ok
test shared::clock::time_extent::test::time_extent::fn_total::it_should_give_a_total ... ok
test shared::clock::time_extent::test::time_extent::fn_total_next::it_should_be_zero_for_zero ... ok
test shared::clock::time_extent::test::time_extent::fn_total_next::it_should_fail_when_product_is_too_large ... ok
test shared::clock::time_extent::test::time_extent::fn_total_next::it_should_fail_when_too_large ... ok
test shared::clock::time_extent::test::time_extent::fn_total_next::it_should_give_a_total ... ok
test shared::crypto::keys::seeds::detail::tests::it_should_default_to_zeroed_seed_when_testing ... ok
test shared::crypto::keys::seeds::detail::tests::it_should_have_a_large_random_seed ... ok
test shared::crypto::keys::seeds::detail::tests::it_should_have_a_zero_test_seed ... ok
test shared::crypto::keys::seeds::tests::the_default_seed_and_the_instance_seed_should_be_different_when_testing ... ok
test shared::crypto::keys::seeds::tests::the_default_seed_and_the_zeroed_seed_should_be_the_same_when_testing ... ok
test tracker::auth::tests::expiring_auth_key::should_be_displayed ... ok
test tracker::auth::tests::expiring_auth_key::should_be_generate_and_verified ... ok
test tracker::auth::tests::expiring_auth_key::should_be_parsed_from_an_string ... ok
test tracker::auth::tests::expiring_auth_key::should_be_generated_with_a_expiration_time ... ok
test tracker::auth::tests::key::should_be_parsed_from_an_string ... ok
test tracker::peer::test::torrent_peer::it_should_be_serializable ... ok
test tracker::peer::test::torrent_peer_id::should_be_converted_from_a_20_byte_array ... ok
test tracker::peer::test::torrent_peer_id::should_be_converted_from_a_byte_vector ... ok
test tracker::peer::test::torrent_peer_id::should_be_converted_into_string_type_using_the_hex_string_format ... ok
test tracker::peer::test::torrent_peer_id::should_be_converted_to_hex_string ... ok
test tracker::peer::test::torrent_peer_id::should_be_instantiated_from_a_byte_slice ... ok
test tracker::peer::test::torrent_peer_id::should_be_instantiated_from_a_string ... ok
test tracker::peer::test::torrent_peer_id::should_fail_trying_to_convert_from_a_byte_vector_with_less_than_20_bytes - should panic ... ok
test tracker::peer::test::torrent_peer_id::should_fail_trying_to_convert_from_a_byte_vector_with_more_than_20_bytes - should panic ... ok
test tracker::peer::test::torrent_peer_id::should_fail_trying_to_instantiate_from_a_byte_slice_with_more_than_20_bytes - should panic ... ok
test servers::http::v1::services::scrape::tests::with_zeroed_data::it_should_send_the_tcp_6_scrape_event_when_the_peer_uses_ipv6 ... ok
test tracker::peer::test::torrent_peer_id::should_return_the_inner_bytes ... ok
test tracker::peer::test::torrent_peer_id::should_fail_trying_to_instantiate_from_a_byte_slice_with_less_than_20_bytes - should panic ... ok
test tracker::services::statistics::setup::test::should_not_send_any_event_when_statistics_are_disabled ... ok
test tracker::services::statistics::setup::test::should_send_events_when_statistics_are_enabled ... ok
test servers::udp::handlers::tests::announce_request::using_ipv6::when_the_announce_request_comes_from_a_client_using_ipv6_the_response_should_not_include_peers_using_ipv4 ... ok
test servers::udp::handlers::tests::announce_request::using_ipv4::the_announced_peer_should_not_be_included_in_the_response ... ok
test servers::http::v1::handlers::scrape::tests::with_tracker_not_on_reverse_proxy::it_should_fail_when_the_client_ip_from_the_connection_info_is_not_available ... ok
test servers::http::v1::services::scrape::tests::with_real_data::it_should_return_the_scrape_data_for_a_torrent ... ok
test servers::http::v1::services::announce::tests::with_tracker_in_any_mode::it_should_send_the_tcp_6_announce_event_when_the_peer_uses_ipv6_even_if_the_tracker_changes_the_peer_ip_to_ipv4 ... ok
test tracker::statistics::tests::event_handler::should_increase_the_tcp4_connections_counter_when_it_receives_a_tcp4_announce_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_tcp4_announces_counter_when_it_receives_a_tcp4_announce_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_tcp4_connections_counter_when_it_receives_a_tcp4_scrape_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_tcp4_scrapes_counter_when_it_receives_a_tcp4_scrape_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_tcp6_connections_counter_when_it_receives_a_tcp6_announce_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_tcp6_announces_counter_when_it_receives_a_tcp6_announce_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_tcp6_connections_counter_when_it_receives_a_tcp6_scrape_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_tcp6_scrapes_counter_when_it_receives_a_tcp6_scrape_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_udp4_announces_counter_when_it_receives_a_udp4_announce_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_udp4_connections_counter_when_it_receives_a_udp4_connect_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_udp4_scrapes_counter_when_it_receives_a_udp4_scrape_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_udp6_announces_counter_when_it_receives_a_udp6_announce_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_udp6_connections_counter_when_it_receives_a_udp6_connect_event ... ok
test tracker::statistics::tests::event_handler::should_increase_the_udp6_scrapes_counter_when_it_receives_a_udp6_scrape_event ... ok
test tracker::statistics::tests::stats_tracker::should_contain_the_tracker_statistics ... ok
test tracker::statistics::tests::stats_tracker::should_create_an_event_sender_to_send_statistical_events ... ok
test servers::udp::handlers::tests::announce_request::using_ipv6::an_announced_peer_should_be_added_to_the_tracker ... ok
test servers::http::v1::services::announce::tests::with_tracker_in_any_mode::it_should_send_the_tcp_4_announce_event_when_the_peer_uses_ipv4_even_if_the_tracker_changes_the_peer_ip_to_ipv6 ... ok
test servers::udp::handlers::tests::announce_request::using_ipv4::when_the_announce_request_comes_from_a_client_using_ipv4_the_response_should_not_include_peers_using_ipv6 ... ok
test servers::udp::handlers::tests::announce_request::using_ipv6::from_a_loopback_ip::the_peer_ip_should_be_changed_to_the_external_ip_in_the_tracker_configuration ... ok
test servers::udp::handlers::tests::announce_request::using_ipv6::the_announced_peer_should_not_be_included_in_the_response ... ok
test tracker::tests::the_tracker::configured_as_whitelisted::handling_an_scrape_request::it_should_be_able_to_build_a_zeroed_scrape_data_for_a_list_of_info_hashes ... ok
test servers::udp::handlers::tests::announce_request::using_ipv4::the_tracker_should_always_use_the_remote_client_ip_but_not_the_port_in_the_udp_request_header_instead_of_the_peer_address_in_the_announce_request ... ok
test servers::http::v1::services::scrape::tests::with_zeroed_data::it_should_always_return_the_zeroed_scrape_data_for_a_torrent ... ok
test servers::udp::handlers::tests::announce_request::using_ipv6::should_send_the_upd6_announce_event ... ok
test servers::http::v1::services::scrape::tests::with_real_data::it_should_send_the_tcp_4_scrape_event_when_the_peer_uses_ipv4 ... ok
test servers::udp::handlers::tests::connect_request::a_connect_response_should_contain_the_same_transaction_id_as_the_connect_request ... ok
test servers::udp::handlers::tests::scrape_request::using_ipv6::should_send_the_upd6_scrape_event ... ok
test servers::udp::handlers::tests::connect_request::it_should_send_the_upd4_connect_event_when_a_client_tries_to_connect_using_a_ip4_socket_address ... ok
test servers::udp::handlers::tests::connect_request::a_connect_response_should_contain_a_new_connection_id ... ok
test servers::udp::handlers::tests::connect_request::it_should_send_the_upd6_connect_event_when_a_client_tries_to_connect_using_a_ip6_socket_address ... ok
test servers::udp::handlers::tests::scrape_request::with_a_private_tracker::should_return_zeroed_statistics_when_the_tracker_has_the_requested_torrent_because_authenticated_requests_are_not_supported_in_udp_tracker ... ok
test servers::udp::handlers::tests::scrape_request::using_ipv4::should_send_the_upd4_scrape_event ... ok
test servers::udp::handlers::tests::scrape_request::with_a_whitelisted_tracker::should_return_the_torrent_statistics_when_the_requested_torrent_is_whitelisted ... ok
test servers::udp::handlers::tests::scrape_request::with_a_public_tracker::should_return_torrent_statistics_when_the_tracker_has_the_requested_torrent ... ok
test servers::udp::handlers::tests::scrape_request::should_return_no_stats_when_the_tracker_does_not_have_any_torrent ... ok
test servers::udp::handlers::tests::scrape_request::with_a_private_tracker::should_return_zeroed_statistics_when_the_tracker_does_not_have_the_requested_torrent ... ok
test servers::udp::handlers::tests::scrape_request::with_a_whitelisted_tracker::should_return_zeroed_statistics_when_the_requested_torrent_is_not_whitelisted ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::should_assign_the_ip_to_the_peer::and_when_client_ip_is_a_ipv6_loopback_ip::it_should_use_the_external_ip_in_the_tracker_configuration_if_it_is_defined_even_if_the_external_ip_is_an_ipv4_ip ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::should_assign_the_ip_to_the_peer::and_when_client_ip_is_a_ipv6_loopback_ip::it_should_use_the_external_ip_in_tracker_configuration_if_it_is_defined ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::should_assign_the_ip_to_the_peer::and_when_the_client_ip_is_a_ipv4_loopback_ip::it_should_use_the_external_tracker_ip_in_tracker_configuration_if_it_is_defined ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::should_assign_the_ip_to_the_peer::and_when_the_client_ip_is_a_ipv4_loopback_ip::it_should_use_the_external_ip_in_the_tracker_configuration_if_it_is_defined_even_if_the_external_ip_is_an_ipv6_ip ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::should_assign_the_ip_to_the_peer::and_when_client_ip_is_a_ipv6_loopback_ip::it_should_use_the_loopback_ip_if_the_tracker_does_not_have_the_external_ip_configuration ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::should_assign_the_ip_to_the_peer::and_when_the_client_ip_is_a_ipv4_loopback_ip::it_should_use_the_loopback_ip_if_the_tracker_does_not_have_the_external_ip_configuration ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::should_assign_the_ip_to_the_peer::using_the_source_ip_instead_of_the_ip_in_the_announce_request ... ok
test tracker::tests::the_tracker::configured_as_private::handling_authentication::it_should_fail_authenticating_a_peer_when_it_uses_an_unregistered_key ... ok
test tracker::services::torrent::tests::searching_for_torrents::should_return_a_summarized_info_for_all_torrents ... ok
test tracker::services::statistics::tests::the_statistics_service_should_return_the_tracker_metrics ... ok
test tracker::services::torrent::tests::searching_for_torrents::should_allow_using_pagination_in_the_result ... ok
test tracker::torrent::tests::torrent_entry::a_new_peer_can_be_added_to_a_torrent_entry ... ok
test tracker::torrent::tests::torrent_entry::a_peer_can_be_updated_in_a_torrent_entry ... ok
test tracker::torrent::tests::torrent_entry::a_peer_should_be_removed_from_a_torrent_entry_when_the_peer_announces_it_has_stopped ... ok
test tracker::torrent::tests::torrent_entry::a_torrent_entry_should_contain_the_list_of_peers_that_were_added_to_the_torrent ... ok
test tracker::torrent::tests::torrent_entry::a_torrent_entry_should_remove_a_peer_not_updated_after_a_timeout_in_seconds ... ok
test tracker::torrent::tests::torrent_entry::a_torrent_entry_should_return_the_list_of_peers_for_a_given_peer_filtering_out_the_client_that_is_making_the_request ... ok
test tracker::torrent::tests::torrent_entry::the_default_torrent_entry_should_contain_an_empty_list_of_peers ... ok
test tracker::torrent::tests::torrent_entry::the_tracker_should_limit_the_list_of_peers_to_74_when_clients_scrape_torrents ... ok
test tracker::torrent::tests::torrent_entry::torrent_stats_change_when_a_previously_known_peer_announces_it_has_completed_the_torrent ... ok
test tracker::torrent::tests::torrent_entry::torrent_stats_should_have_the_number_of_leechers_for_a_torrent ... ok
test tracker::torrent::tests::torrent_entry::torrent_stats_should_have_the_number_of_peers_that_having_announced_at_least_two_events_the_latest_one_is_the_completed_event ... ok
test tracker::torrent::tests::torrent_entry::torrent_stats_should_have_the_number_of_seeders_for_a_torrent ... ok
test tracker::torrent::tests::torrent_entry::torrent_stats_should_not_change_when_a_peer_announces_it_has_completed_the_torrent_if_it_is_the_first_announce_from_the_peer ... ok
test tracker::torrent::tests::torrent_entry::torrent_stats_should_not_include_a_peer_in_the_completed_counter_if_the_peer_has_announced_only_one_event ... ok
test tracker::torrent::tests::torrent_entry::two_peers_with_the_same_ip_but_different_port_should_be_considered_different_peers ... ok
test tracker::services::torrent::tests::searching_for_torrents::should_return_torrents_ordered_by_info_hash ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_a_scrape_request::it_should_allow_scraping_for_multiple_torrents ... ok
test tracker::tests::the_tracker::configured_as_private::handling_authentication::it_should_fail_verifying_an_unregistered_authentication_key ... ok
test tracker::tests::the_tracker::configured_as_whitelisted::handling_authorization::it_should_not_authorize_the_announce_and_scrape_actions_on_not_whitelisted_torrents ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_a_scrape_request::it_should_return_a_zeroed_swarm_metadata_for_the_requested_file_if_the_tracker_does_not_have_that_torrent ... ok
test tracker::services::torrent::tests::searching_for_torrents::should_allow_limiting_the_number_of_torrents_in_the_result ... ok
test tracker::services::torrent::tests::searching_for_torrents::should_return_an_empty_result_if_the_tracker_does_not_have_any_torrent ... ok
test tracker::tests::the_tracker::configured_as_whitelisted::handling_authorization::it_should_authorize_the_announce_and_scrape_actions_on_whitelisted_torrents ... ok
test tracker::services::torrent::tests::getting_a_torrent_info::should_return_the_torrent_info_if_the_tracker_has_the_torrent ... ok
test tracker::tests::the_tracker::configured_as_whitelisted::handling_an_scrape_request::it_should_return_the_zeroed_swarm_metadata_for_the_requested_file_if_it_is_not_whitelisted ... ok
test tracker::services::torrent::tests::getting_a_torrent_info::should_return_none_if_the_tracker_does_not_have_the_torrent ... ok
test tracker::tests::the_tracker::configured_as_private::handling_authentication::it_should_authenticate_a_peer_by_using_a_key ... ok
test tracker::tests::the_tracker::configured_as_private::handling_authentication::it_should_verify_a_valid_authentication_key ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_a_scrape_request::it_should_return_the_swarm_metadata_for_the_requested_file_if_the_tracker_has_that_torrent ... ok
test tracker::tests::the_tracker::configured_as_whitelisted::handling_the_torrent_whitelist::persistence::it_should_load_the_whitelist_from_the_database ... ok
test tracker::tests::the_tracker::configured_as_private::handling_authentication::it_should_generate_the_expiring_authentication_keys ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::it_should_return_the_announce_data_with_an_empty_peer_list_when_it_is_the_first_announced_peer ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::it_should_return_the_announce_data_with_the_previously_announced_peers ... ok
test tracker::tests::the_tracker::configured_as_whitelisted::handling_the_torrent_whitelist::it_should_add_a_torrent_to_the_whitelist ... ok
test tracker::tests::the_tracker::configured_as_private::handling_authentication::it_should_load_authentication_keys_from_the_database ... ok
test tracker::tests::the_tracker::configured_as_whitelisted::handling_the_torrent_whitelist::it_should_remove_a_torrent_from_the_whitelist ... ok
test tracker::tests::the_tracker::configured_as_private::handling_authentication::it_should_remove_an_authentication_key ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::it_should_update_the_swarm_stats_for_the_torrent::when_a_previously_announced_started_peer_has_completed_downloading ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::it_should_update_the_swarm_stats_for_the_torrent::when_the_peer_is_a_leecher ... ok
test tracker::tests::the_tracker::it_should_return_all_the_peers_for_a_given_torrent ... ok
test tracker::tests::the_tracker::for_all_config_modes::handling_an_announce_request::it_should_update_the_swarm_stats_for_the_torrent::when_the_peer_is_a_seeder ... ok
test tracker::tests::the_tracker::should_collect_torrent_metrics ... ok
test tracker::tests::the_tracker::it_should_return_the_torrent_metrics ... ok
test tracker::tests::the_tracker::it_should_return_all_the_peers_for_a_given_torrent_excluding_a_given_peer ... ok
test tracker::tests::the_tracker::handling_torrent_persistence::it_should_persist_the_number_of_completed_peers_for_all_torrents_into_the_database ... ok

test result: ok. 265 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.19s

     Running unittests src/main.rs (target/debug/deps/torrust_tracker-38f57505b4e1d4a0)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/integration.rs (target/debug/deps/integration-e462217af0c9a895)

running 96 tests
test servers::api::v1::contract::configuration::should_fail_with_ssl_enabled_and_bad_ssl_config ... ignored
test servers::api::v1::contract::authentication::should_not_authenticate_requests_when_the_token_is_invalid ... ok
test servers::api::v1::contract::context::torrent::should_allow_the_torrents_result_pagination ... ok
test servers::api::v1::contract::authentication::should_not_authenticate_requests_when_the_token_is_empty ... ok
test servers::api::v1::contract::context::auth_key::should_allow_generating_a_new_auth_key ... ok
test servers::api::v1::contract::context::torrent::should_allow_getting_a_torrent_info ... ok
test servers::api::v1::contract::context::whitelist::should_allow_reload_the_whitelist_from_the_database ... ok
test servers::api::v1::contract::authentication::should_not_authenticate_requests_when_the_token_is_missing ... ok
test servers::api::v1::contract::authentication::should_authenticate_requests_by_using_a_token_query_param ... ok
test servers::api::v1::contract::context::stats::should_allow_getting_tracker_statistics ... ok
test servers::api::v1::contract::context::torrent::should_allow_limiting_the_torrents_in_the_result ... ok
test servers::api::v1::contract::context::whitelist::should_allow_removing_a_torrent_from_the_whitelist ... ok
test servers::api::v1::contract::context::auth_key::should_allow_deleting_an_auth_key ... ok
test servers::api::v1::contract::context::whitelist::should_allow_whitelisting_a_torrent ... ok
test servers::api::v1::contract::context::torrent::should_allow_getting_torrents ... ok
test servers::api::v1::contract::context::auth_key::should_allow_reloading_keys ... ok
test servers::api::v1::contract::context::auth_key::should_fail_when_the_auth_key_cannot_be_generated ... ok
test servers::api::v1::contract::context::torrent::should_fail_while_getting_a_torrent_info_when_the_torrent_does_not_exist ... ok
test servers::api::v1::contract::context::auth_key::should_fail_when_keys_cannot_be_reloaded ... ok
test servers::api::v1::contract::context::auth_key::should_fail_when_the_auth_key_cannot_be_deleted ... ok
test servers::api::v1::contract::authentication::should_allow_the_token_query_param_to_be_at_any_position_in_the_url_query ... ok
test servers::api::v1::contract::context::torrent::should_not_allow_getting_torrents_for_unauthenticated_users ... ok
test servers::api::v1::contract::context::whitelist::should_fail_when_the_torrent_cannot_be_removed_from_the_whitelist ... ok
test servers::api::v1::contract::context::stats::should_not_allow_getting_tracker_statistics_for_unauthenticated_users ... ok
test servers::api::v1::contract::context::auth_key::should_not_allow_reloading_keys_for_unauthenticated_users ... ok
test servers::api::v1::contract::context::whitelist::should_fail_when_the_torrent_cannot_be_whitelisted ... ok
test servers::api::v1::contract::context::auth_key::should_not_allow_generating_a_new_auth_key_for_unauthenticated_users ... ok
test servers::http::v1::contract::configured_as_private::receiving_an_scrape_request::should_fail_if_the_key_query_param_cannot_be_parsed ... ok
test servers::api::v1::contract::context::auth_key::should_fail_generating_a_new_auth_key_when_the_key_duration_is_invalid ... ok
test servers::api::v1::contract::context::whitelist::should_not_fail_trying_to_remove_a_non_whitelisted_torrent_from_the_whitelist ... ok
test servers::http::v1::contract::configured_as_private::and_receiving_an_announce_request::should_fail_if_the_peer_has_not_provided_the_authentication_key ... ok
test servers::api::v1::contract::context::auth_key::should_not_allow_deleting_an_auth_key_for_unauthenticated_users ... ok
test servers::api::v1::contract::context::whitelist::should_fail_when_the_whitelist_cannot_be_reloaded_from_the_database ... ok
test servers::http::v1::contract::configured_as_private::and_receiving_an_announce_request::should_fail_if_the_peer_cannot_be_authenticated_with_the_provided_key ... ok
test servers::http::v1::contract::configured_as_private::receiving_an_scrape_request::should_return_the_zeroed_file_when_the_authentication_key_provided_by_the_client_is_invalid ... ok
test servers::http::v1::contract::configured_as_private::receiving_an_scrape_request::should_return_the_real_file_stats_when_the_client_is_authenticated ... ok
test servers::http::v1::contract::configured_as_private::and_receiving_an_announce_request::should_fail_if_the_key_query_param_cannot_be_parsed ... ok
test servers::api::v1::contract::context::torrent::should_not_allow_getting_a_torrent_info_for_unauthenticated_users ... ok
test servers::http::v1::contract::configured_as_private::and_receiving_an_announce_request::should_respond_to_authenticated_peers ... ok
test servers::http::v1::contract::configured_as_private::receiving_an_scrape_request::should_return_the_zeroed_file_when_the_client_is_not_authenticated ... ok
test servers::http::v1::contract::configured_as_whitelisted::and_receiving_an_announce_request::should_allow_announcing_a_whitelisted_torrent ... ok
test servers::api::v1::contract::context::whitelist::should_allow_whitelisting_a_torrent_that_has_been_already_whitelisted ... ok
test servers::http::v1::contract::configured_as_whitelisted::and_receiving_an_announce_request::should_fail_if_the_torrent_is_not_in_the_whitelist ... ok
test servers::http::v1::contract::configured_as_whitelisted::receiving_an_scrape_request::should_return_the_file_stats_when_the_requested_file_is_whitelisted ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_consider_two_peers_to_be_the_same_when_they_have_the_same_peer_id_even_if_the_ip_is_different ... ok
test servers::api::v1::contract::context::whitelist::should_not_allow_whitelisting_a_torrent_for_unauthenticated_users ... ok
test servers::http::v1::contract::for_all_config_modes::and_running_on_reverse_proxy::should_fail_when_the_http_request_does_not_include_the_xff_http_request_header ... ok
test servers::http::v1::contract::for_all_config_modes::and_running_on_reverse_proxy::should_fail_when_the_xff_http_request_header_contains_an_invalid_ip ... ok
test servers::http::v1::contract::configured_as_whitelisted::receiving_an_scrape_request::should_return_the_zeroed_file_when_the_requested_file_is_not_whitelisted ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_assign_to_the_peer_ip_the_remote_client_ip_instead_of_the_peer_address_in_the_request_param ... ok
test servers::api::v1::contract::context::whitelist::should_not_allow_removing_a_torrent_from_the_whitelist_for_unauthenticated_users ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_fail_when_the_url_query_component_is_empty ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_fail_when_url_query_parameters_are_invalid ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_not_increase_the_number_of_tcp6_announce_requests_handled_if_the_client_is_not_using_an_ipv6_ip ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_increase_the_number_of_tcp4_announce_requests_handled_in_statistics ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_increase_the_number_of_tcp4_connections_handled_in_statistics ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_not_fail_when_the_peer_address_param_is_invalid ... ok
test servers::api::v1::contract::context::torrent::should_fail_getting_torrents_when_the_offset_query_parameter_cannot_be_parsed ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_increase_the_number_of_tcp6_announce_requests_handled_in_statistics ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_increase_the_number_of_tcp6_connections_handled_in_statistics ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_not_increase_the_number_of_tcp6_connections_handled_if_the_client_is_not_using_an_ipv6_ip ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_not_return_the_compact_response_by_default ... ok
test servers::api::v1::contract::context::torrent::should_fail_getting_torrents_when_the_limit_query_parameter_cannot_be_parsed ... ok
test servers::udp::contract::receiving_a_connection_request::should_return_a_connect_response ... ok
test servers::http::v1::contract::test_environment_should_be_started_and_stopped ... ok
test servers::udp::contract::receiving_an_announce_request::should_return_an_announce_response ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_return_no_peers_if_the_announced_peer_is_the_first_one ... ok
test servers::udp::contract::receiving_an_scrape_request::should_return_a_scrape_response ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_respond_if_only_the_mandatory_fields_are_provided ... ok
test servers::udp::contract::should_return_a_bad_request_response_when_the_client_sends_an_empty_request ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_return_the_compact_response ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_return_the_list_of_previously_announced_peers ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::when_the_client_ip_is_a_loopback_ipv4_it_should_assign_to_the_peer_ip_the_external_ip_in_the_tracker_configuration ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::when_the_client_ip_is_a_loopback_ipv6_it_should_assign_to_the_peer_ip_the_external_ip_in_the_tracker_configuration ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_return_the_list_of_previously_announced_peers_including_peers_using_ipv4_and_ipv6 ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_scrape_request::should_increase_the_number_ot_tcp4_scrape_requests_handled_in_statistics ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::when_the_tracker_is_behind_a_reverse_proxy_it_should_assign_to_the_peer_ip_the_ip_in_the_x_forwarded_for_http_header ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_scrape_request::should_return_the_file_with_the_complete_peer_when_there_is_one_peer_with_no_bytes_pending_to_download ... ok
test servers::api::v1::contract::context::auth_key::should_fail_deleting_an_auth_key_when_the_key_id_is_invalid ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_scrape_request::should_increase_the_number_ot_tcp6_scrape_requests_handled_in_statistics ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_fail_when_a_mandatory_field_is_missing ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_scrape_request::should_accept_multiple_infohashes ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_scrape_request::should_return_a_file_with_zeroed_values_when_there_are_no_peers ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_scrape_request::should_return_the_file_with_the_incomplete_peer_when_there_is_one_peer_with_bytes_pending_to_download ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_fail_when_the_uploaded_param_is_invalid ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_fail_when_the_compact_param_is_invalid ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_fail_when_the_left_param_is_invalid ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_fail_when_the_downloaded_param_is_invalid ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_fail_when_the_port_param_is_invalid ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_fail_when_the_info_hash_param_is_invalid ... ok
test servers::api::v1::contract::context::torrent::should_fail_getting_a_torrent_info_when_the_provided_infohash_is_invalid ... ok
test servers::api::v1::contract::context::whitelist::should_fail_removing_a_torrent_from_the_whitelist_when_the_provided_infohash_is_invalid ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_fail_when_the_peer_id_param_is_invalid ... ok
test servers::api::v1::contract::context::whitelist::should_fail_whitelisting_a_torrent_when_the_provided_infohash_is_invalid ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_scrape_request::should_fail_when_the_info_hash_param_is_invalid ... ok
test servers::http::v1::contract::for_all_config_modes::receiving_an_announce_request::should_fail_when_the_event_param_is_invalid ... ok

test result: ok. 95 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.63s

   Doc-tests torrust-tracker

running 31 tests
test src/tracker/mod.rs - tracker (line 228) - compile ... ok
test src/tracker/mod.rs - tracker (line 374) - compile ... ok
test src/tracker/services/statistics/mod.rs - tracker::services::statistics (line 32) - compile ... ok
test src/tracker/auth.rs - tracker::auth::ParseKeyError (line 140) - compile ... ok
test src/tracker/peer.rs - tracker::peer::Id (line 120) - compile ... ok
test src/tracker/mod.rs - tracker (line 253) - compile ... ok
test src/tracker/mod.rs - tracker (line 138) - compile ... ok
test src/tracker/auth.rs - tracker::auth (line 14) - compile ... ok
test src/tracker/databases/driver.rs - tracker::databases::driver::build (line 27) - compile ... ok
test src/tracker/auth.rs - tracker::auth (line 28) - compile ... ok
test src/tracker/mod.rs - tracker (line 99) - compile ... ok
test src/tracker/mod.rs - tracker (line 57) - compile ... ok
test src/tracker/peer.rs - tracker::peer::Peer (line 48) - compile ... ok
test src/tracker/peer.rs - tracker::peer (line 5) - compile ... ok
test src/tracker/databases/driver.rs - tracker::databases::driver::build (line 16) - compile ... ok
test src/tracker/mod.rs - tracker (line 167) - compile ... ok
test src/servers/http/v1/services/peer_ip_resolver.rs - servers::http::v1::services::peer_ip_resolver::invoke (line 62) ... ok
test src/servers/http/v1/responses/error.rs - servers::http::v1::responses::error::Error::write (line 29) ... ok
test src/servers/http/v1/query.rs - servers::http::v1::query::Query::get_param (line 46) ... ok
test src/servers/http/v1/query.rs - servers::http::v1::query::Query::get_param_vec (line 75) ... ok
test src/servers/http/v1/query.rs - servers::http::v1::query::Query::get_param_vec (line 62) ... ok
test src/servers/http/v1/responses/announce.rs - servers::http::v1::responses::announce::Peer (line 97) ... ok
test src/servers/http/v1/responses/announce.rs - servers::http::v1::responses::announce::Compact (line 189) ... ok
test src/servers/http/v1/requests/announce.rs - servers::http::v1::requests::announce::Announce (line 34) ... ok
test src/servers/http/v1/responses/scrape.rs - servers::http::v1::responses::scrape::Bencoded (line 14) ... ok
test src/servers/http/percent_encoding.rs - servers::http::percent_encoding::percent_decode_info_hash (line 27) ... ok
test src/servers/http/v1/services/peer_ip_resolver.rs - servers::http::v1::services::peer_ip_resolver::invoke (line 84) ... ok
test src/servers/http/v1/responses/announce.rs - servers::http::v1::responses::announce::CompactPeer (line 274) ... ok
test src/servers/http/percent_encoding.rs - servers::http::percent_encoding::percent_decode_peer_id (line 58) ... ok
test src/servers/http/v1/query.rs - servers::http::v1::query::Query::get_param (line 33) ... ok
test src/servers/http/v1/responses/announce.rs - servers::http::v1::responses::announce::NonCompact (line 21) ... ok

test result: ok. 31 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.14s
zjp-CN commented 11 months ago

I can reproduce it now. But it's late now. I'll check it out tomorrow.

josecelano commented 11 months ago

I can reproduce it now. But it's late now. I'll check it out tomorrow.

OK. No worries. I would do it, but I have to review the whole code first. You have done a lot!

zjp-CN commented 11 months ago

Found the crux: the regex for parsing doc test items is the literally doc, but should be a \S+ pattern instead.

test src/servers/http/v1/responses/announce.rs - servers::http::v1::responses::announce::NonCompact (line 21) ... ok

And it seems to be an additional part - compile for no_run doc tests.

test src/tracker/peer.rs - tracker::peer::Peer (line 48) - compile ... ok

https://github.com/josecelano/cargo-pretty-test/blob/fde2b4301ba8b78af5c1706aa4676165951f0ba3/src/regex.rs#L48

josecelano commented 11 months ago

Found the crux: the regex for parsing doc test items is the literally doc, but should be a \S+ pattern instead.

test src/servers/http/v1/responses/announce.rs - servers::http::v1::responses::announce::NonCompact (line 21) ... ok

And it seems to be an additional part - compile for no_run doc tests.

test src/tracker/peer.rs - tracker::peer::Peer (line 48) - compile ... ok

https://github.com/josecelano/cargo-pretty-test/blob/fde2b4301ba8b78af5c1706aa4676165951f0ba3/src/regex.rs#L48

Good catch! That regex deserves a crate for itself :-)

zjp-CN commented 11 months ago

https://github.com/josecelano/cargo-pretty-test/pull/20 already contains full rustdoc attributes tests

https://github.com/josecelano/cargo-pretty-test/pull/20/commits/88726b625e3419958d395f13a8427b36523cf357#diff-b2c08f496e9c45b70893a9e0fc514f87cd9483de279fa6d1114c26f693b172a6R43

so I think the regex for doc tests is tested.