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

Fix issue generating coverage report #1354

Merged

Conversation

josecelano
Copy link
Member

There wass a missing feature for tokio crate in the udp-tracker-core package.

error[E0432]: unresolved import `tokio::time`
   --> packages/udp-tracker-core/src/services/banning.rs:22:12
    |
22  | use tokio::time::Instant;
    |            ^^^^ could not find `time` in `tokio`
    |
note: found an item that was configured out
   --> /home/josecelano/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.43.0/src/lib.rs:556:13
    |
556 |     pub mod time;
    |             ^^^^
note: the item is gated behind the `time` feature
   --> /home/josecelano/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.43.0/src/lib.rs:555:1
    |
555 | / cfg_time! {
556 | |     pub mod time;
557 | | }
    | |_^
    = note: this error originates in the macro `cfg_time` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `time` in `tokio`
   --> packages/udp-tracker-core/src/services/banning.rs:40:53
    |
40  |             last_connection_id_errors_reset: tokio::time::Instant::now(),
    |                                                     ^^^^ could not find `time` in `tokio`
    |
note: found an item that was configured out
   --> /home/josecelano/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.43.0/src/lib.rs:556:13
    |
556 |     pub mod time;
    |             ^^^^
note: the item is gated behind the `time` feature
   --> /home/josecelano/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.43.0/src/lib.rs:555:1
    |
555 | / cfg_time! {
556 | |     pub mod time;
557 | | }
    | |_^
    = note: this error originates in the macro `cfg_time` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this struct
    |
18  + use std::time::Instant;
    |
help: if you import `Instant`, refer to it directly
    |
40  -             last_connection_id_errors_reset: tokio::time::Instant::now(),
40  +             last_connection_id_errors_reset: Instant::now(),
    |

Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `bittorrent-udp-tracker-core` (lib test) due to 2 previous errors
error: process didn't exit successfully: `/home/josecelano/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo test --tests --manifest-path /home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/Cargo.toml --target-dir /home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/llvm-cov-target --package bittorrent-udp-tracker-core` (exit status: 101)

Verified

This commit was signed with the committer’s verified signature.
josecelano Jose Celano
There wass a missing feature for tokio crate in the `udp-tracker-core`
package.

```output
error[E0432]: unresolved import `tokio::time`
   --> packages/udp-tracker-core/src/services/banning.rs:22:12
    |
22  | use tokio::time::Instant;
    |            ^^^^ could not find `time` in `tokio`
    |
note: found an item that was configured out
   --> /home/josecelano/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.43.0/src/lib.rs:556:13
    |
556 |     pub mod time;
    |             ^^^^
note: the item is gated behind the `time` feature
   --> /home/josecelano/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.43.0/src/lib.rs:555:1
    |
555 | / cfg_time! {
556 | |     pub mod time;
557 | | }
    | |_^
    = note: this error originates in the macro `cfg_time` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: could not find `time` in `tokio`
   --> packages/udp-tracker-core/src/services/banning.rs:40:53
    |
40  |             last_connection_id_errors_reset: tokio::time::Instant::now(),
    |                                                     ^^^^ could not find `time` in `tokio`
    |
note: found an item that was configured out
   --> /home/josecelano/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.43.0/src/lib.rs:556:13
    |
556 |     pub mod time;
    |             ^^^^
note: the item is gated behind the `time` feature
   --> /home/josecelano/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.43.0/src/lib.rs:555:1
    |
555 | / cfg_time! {
556 | |     pub mod time;
557 | | }
    | |_^
    = note: this error originates in the macro `cfg_time` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing this struct
    |
18  + use std::time::Instant;
    |
help: if you import `Instant`, refer to it directly
    |
40  -             last_connection_id_errors_reset: tokio::time::Instant::now(),
40  +             last_connection_id_errors_reset: Instant::now(),
    |

Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `bittorrent-udp-tracker-core` (lib test) due to 2 previous errors
error: process didn't exit successfully: `/home/josecelano/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo test --tests --manifest-path /home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/Cargo.toml --target-dir /home/josecelano/Documents/git/committer/me/github/torrust/torrust-tracker/target/llvm-cov-target --package bittorrent-udp-tracker-core` (exit status: 101)
```
@josecelano josecelano added the Bug Incorrect Behavior label Mar 4, 2025
@josecelano
Copy link
Member Author

ACK 09396b5

Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.48%. Comparing base (4947a07) to head (09396b5).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1354      +/-   ##
===========================================
- Coverage    81.49%   81.48%   -0.01%     
===========================================
  Files          230      230              
  Lines        16366    16366              
  Branches     16366    16366              
===========================================
- Hits         13337    13336       -1     
  Misses        2794     2794              
- Partials       235      236       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano josecelano merged commit bf883da into torrust:develop Mar 4, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Incorrect Behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant