Skip to content

Conversation

@josecelano
Copy link
Member

@josecelano josecelano commented Mar 10, 2023

Cargo aliases:

  • cargo cov: generate text coverage report.
  • cargo cov-lcov: generate lcov coverage report on ./.coverage/lcov.info. VSCode coverage plugins use it.
  • cargo cov-html: generate html coverage report.
  • cargo time: generate build timing HTML report.

@josecelano
Copy link
Member Author

cargo cov sample output:

Filename                                         Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
packages/configuration/src/lib.rs                    110               103     6.36%          28                24    14.29%         116                63    45.69%           0                 0         -
packages/located-error/src/lib.rs                      8                 4    50.00%           6                 3    50.00%          27                10    62.96%           0                 0         -
packages/primitives/src/lib.rs                        21                19     9.52%          11                10     9.09%          11                 9    18.18%           0                 0         -
packages/test-helpers/src/configuration.rs             9                 1    88.89%           9                 1    88.89%          92                 7    92.39%           0                 0         -
packages/test-helpers/src/random.rs                    1                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
src/apis/handlers.rs                                  75                11    85.33%          22                 0   100.00%          85                 1    98.82%           0                 0         -
src/apis/middlewares/auth.rs                          20                 2    90.00%           8                 1    87.50%          32                 1    96.88%           0                 0         -
src/apis/resources/auth_key.rs                        29                 6    79.31%          12                 1    91.67%          64                 2    96.88%           0                 0         -
src/apis/resources/peer.rs                            32                 7    78.12%          10                 2    80.00%          26                 2    92.31%           0                 0         -
src/apis/resources/stats.rs                           29                 2    93.10%           7                 1    85.71%          69                 1    98.55%           0                 0         -
src/apis/resources/torrent.rs                         47                 7    85.11%          21                 4    80.95%          92                 9    90.22%           0                 0         -
src/apis/responses.rs                                 20                 0   100.00%          18                 0   100.00%          72                 0   100.00%           0                 0         -
src/apis/routes.rs                                     1                 0   100.00%           1                 0   100.00%          40                 0   100.00%           0                 0         -
src/apis/server.rs                                    77                26    66.23%          23                 7    69.57%         177                50    71.75%           0                 0         -
src/databases/driver.rs                                8                 2    75.00%           1                 0   100.00%           9                 2    77.78%           0                 0         -
src/databases/error.rs                                13                 9    30.77%           7                 6    14.29%          34                26    23.53%           0                 0         -
src/databases/mod.rs                                  11                 2    81.82%           3                 0   100.00%          10                 0   100.00%           0                 0         -
src/databases/mysql.rs                               166               166     0.00%          41                41     0.00%         184               184     0.00%           0                 0         -
src/databases/sqlite.rs                              226                67    70.35%          44                16    63.64%         204                52    74.51%           0                 0         -
src/http/mod.rs                                        8                 8     0.00%           5                 5     0.00%           5                 5     0.00%           0                 0         -
src/http/percent_encoding.rs                          14                 0   100.00%          10                 0   100.00%          43                 0   100.00%           0                 0         -
src/http/server.rs                                    31                 7    77.42%          10                 4    60.00%          52                 4    92.31%           0                 0         -
src/http/v1/extractors/announce_request.rs            31                 1    96.77%          12                 0   100.00%          72                 1    98.61%           0                 0         -
src/http/v1/extractors/authentication_key.rs          33                 8    75.76%          10                 1    90.00%          52                14    73.08%           0                 0         -
src/http/v1/extractors/client_ip_sources.rs           15                 3    80.00%           2                 0   100.00%          13                 1    92.31%           0                 0         -
src/http/v1/extractors/scrape_request.rs              35                 2    94.29%          15                 0   100.00%          88                 2    97.73%           0                 0         -
src/http/v1/handlers/announce.rs                      99                16    83.84%          33                 2    93.94%         194                10    94.85%           0                 0         -
src/http/v1/handlers/common/auth.rs                    6                 3    50.00%           4                 2    50.00%          12                 1    91.67%           0                 0         -
src/http/v1/handlers/common/peer_ip.rs                 6                 1    83.33%           4                 0   100.00%          18                 1    94.44%           0                 0         -
src/http/v1/handlers/mod.rs                            1                 0   100.00%           1                 0   100.00%           5                 0   100.00%           0                 0         -
src/http/v1/handlers/scrape.rs                        83                16    80.72%          31                 2    93.55%         155                10    93.55%           0                 0         -
src/http/v1/launcher.rs                               40                30    25.00%          12                 8    33.33%         122                79    35.25%           0                 0         -
src/http/v1/query.rs                                  98                 7    92.86%          48                 5    89.58%         194                 5    97.42%           0                 0         -
src/http/v1/requests/announce.rs                     137                19    86.13%          51                 7    86.27%         311                22    92.93%           0                 0         -
src/http/v1/requests/scrape.rs                        32                 4    87.50%          14                 3    78.57%          60                 2    96.67%           0                 0         -
src/http/v1/responses/announce.rs                    123                62    49.59%          37                19    48.65%         205                28    86.34%           0                 0         -
src/http/v1/responses/error.rs                        11                 3    72.73%           7                 2    71.43%          17                 2    88.24%           0                 0         -
src/http/v1/responses/scrape.rs                       17                 2    88.24%          11                 2    81.82%          68                 2    97.06%           0                 0         -
src/http/v1/routes.rs                                  1                 0   100.00%           1                 0   100.00%          11                 0   100.00%           0                 0         -
src/http/v1/services/announce.rs                      49                 7    85.71%          24                 0   100.00%         139                 1    99.28%           0                 0         -
src/http/v1/services/peer_ip_resolver.rs              50                16    68.00%          18                 6    66.67%          82                 6    92.68%           0                 0         -
src/http/v1/services/scrape.rs                        62                13    79.03%          32                 0   100.00%         171                 0   100.00%           0                 0         -
src/jobs/http_tracker.rs                              40                40     0.00%           6                 6     0.00%          53                53     0.00%           0                 0         -
src/jobs/torrent_cleanup.rs                            8                 8     0.00%           3                 3     0.00%          32                32     0.00%           0                 0         -
src/jobs/tracker_apis.rs                              36                36     0.00%           4                 4     0.00%          46                46     0.00%           0                 0         -
src/jobs/udp_tracker.rs                               13                13     0.00%           2                 2     0.00%          15                15     0.00%           0                 0         -
src/lib.rs                                             1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
src/logging.rs                                        19                13    31.58%           5                 3    40.00%          39                29    25.64%           0                 0         -
src/main.rs                                           18                17     5.56%           4                 3    25.00%          33                32     3.03%           0                 0         -
src/protocol/clock/mod.rs                             71                16    77.46%          36                 7    80.56%         131                23    82.44%           0                 0         -
src/protocol/clock/time_extent.rs                    151                 1    99.34%          82                 1    98.78%         355                 1    99.72%           0                 0         -
src/protocol/common.rs                                16                13    18.75%           9                 7    22.22%           9                 7    22.22%           0                 0         -
src/protocol/crypto.rs                                19                 0   100.00%          13                 0   100.00%          30                 0   100.00%           0                 0         -
src/protocol/info_hash.rs                             82                10    87.80%          46                 6    86.96%         181                18    90.06%           0                 0         -
src/protocol/utils.rs                                  1                 0   100.00%           1                 0   100.00%           4                 0   100.00%           0                 0         -
src/setup.rs                                          32                32     0.00%           2                 2     0.00%          40                40     0.00%           0                 0         -
src/signals.rs                                        25                 8    68.00%          11                 2    81.82%          34                 8    76.47%           0                 0         -
src/stats.rs                                          10                 0   100.00%           7                 0   100.00%          26                 0   100.00%           0                 0         -
src/tracker/auth.rs                                   54                23    57.41%          28                12    57.14%          98                29    70.41%           0                 0         -
src/tracker/error.rs                                   6                 4    33.33%           3                 2    33.33%           3                 2    33.33%           0                 0         -
src/tracker/mod.rs                                   581               128    77.97%         185                 8    95.68%         801                39    95.13%           0                 0         -
src/tracker/peer.rs                                  155                80    48.39%          52                 9    82.69%         270                79    70.74%           0                 0         -
src/tracker/services/common.rs                         4                 1    75.00%           1                 0   100.00%          12                 2    83.33%           0                 0         -
src/tracker/services/statistics.rs                    19                 4    78.95%           8                 1    87.50%          38                 1    97.37%           0                 0         -
src/tracker/services/torrent.rs                      110                23    79.09%          41                 3    92.68%         226                12    94.69%           0                 0         -
src/tracker/statistics.rs                            271                70    74.17%          94                 4    95.74%         266                10    96.24%           0                 0         -
src/tracker/torrent.rs                                99                13    86.87%          62                 8    87.10%         313                10    96.81%           0                 0         -
src/udp/connection_cookie.rs                          42                 0   100.00%          28                 0   100.00%         187                 0   100.00%           0                 0         -
src/udp/error.rs                                       4                 0   100.00%           2                 0   100.00%           2                 0   100.00%           0                 0         -
src/udp/handlers.rs                                  353                75    78.75%         137                 4    97.08%         895                33    96.31%           0                 0         -
src/udp/peer_builder.rs                                1                 0   100.00%           1                 0   100.00%          11                 0   100.00%           0                 0         -
src/udp/request.rs                                     1                 0   100.00%           1                 0   100.00%           6                 0   100.00%           0                 0         -
src/udp/server.rs                                     66                33    50.00%          22                 9    59.09%          96                34    64.58%           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                               4193              1323    68.45%        1562               291    81.37%        7689              1170    84.78%           0                 0         -

cov = "llvm-cov"
cov-lcov = "llvm-cov --lcov --output-path=./.coverage/lcov.info"
cov-html = "llvm-cov --html"
time = "build --timings --all-targets"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the lack of a new-line at the end of the file intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. It's only because I do not have a linter for toml files.

@josecelano josecelano force-pushed the update-cargo-aliases branch from e1c10a6 to 8e387cd Compare March 10, 2023 14:44
@josecelano josecelano merged commit 8df6587 into torrust:develop Mar 10, 2023
@josecelano josecelano deleted the update-cargo-aliases branch March 10, 2023 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants