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

Error: the amount of test runners from stderr should equal to that from stdout #16

Closed josecelano closed 11 months ago

josecelano commented 11 months ago

I'm trying t use the command in a GitHub workflow but I get this error:

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

thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `0`,
 right: `2`: the amount of test runners from stderr should equal to that from stdout', /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-pretty-test-0.2.0/src/parsing.rs:41:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: Process completed with exit code 101.

The workflow: https://github.com/torrust/torrust-tracker/actions/runs/6299630094/job/17100743480

The cargo test output:

cargo_test_output.txt

zjp-CN commented 11 months ago

Weird. It works fine locally:

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

I figured it out: the problem is made by ANSI escape chars again.

It's really confusing to know if a terminal string contains them or not, or rather whether the output comes from a terminal environment.

So we have to strip them before parsing. With this experimental commit in pretty-test, your workflow started working. Note in that CI, cargo install cargo-pretty-test --git https://github.com/zjp-CN/pretty-test.git --branch experimental is used as a patch.

josecelano commented 11 months ago

Thank you, @zjp-CN . Now I have a nice job summary in markdown:

https://github.com/torrust/torrust-tracker/actions/runs/6299630094

image

zjp-CN commented 11 months ago

Seems the tree view looks bad in the summary. And I noticed two things in the workflow:

josecelano commented 11 months ago

Seems the tree view looks bad in the summary. And I noticed two things in the workflow:

  • no color or style in the output (OK should be green and bold etc)
  • the status line at the bottom is not printed out (maybe it's because CI hijacks stderr): the tree is printed via stdout, and the status line is via stderr

It seems colors are allowed.

zjp-CN commented 11 months ago

Yes, the color is allowed in github action output.

I guess we need to force pretty-test to print in color via --color always. https://github.com/josecelano/cargo-pretty-test/issues/23 and https://github.com/josecelano/cargo-pretty-test/pull/19#issuecomment-1735197693 It's not hard to do by calling https://docs.rs/colored/2.0.4/colored/control/fn.set_override.html

Update: https://github.com/josecelano/cargo-pretty-test/issues/25#issuecomment-1735837794