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

add exception test #136

Merged
merged 3 commits into from
Mar 18, 2024
Merged

add exception test #136

merged 3 commits into from
Mar 18, 2024

Conversation

try-agaaain
Copy link
Contributor

#119

Through the lcov tool, I observed that functions such as router::get_name_by_key and rest_rpc::get_error_msg were not covered by tests. These functions will be triggered when exceptions occur, so I added some exception tests.

Copy link

Code Coverage Report
for detail, goto summary download Artifacts

Filename                    Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
client_util.hpp                     4                 1    75.00%          25                10    60.00%           4                 2    50.00%
codec.h                             4                 0   100.00%          24                 2    91.67%           0                 0         -
connection.h                       40                 4    90.00%         380                93    75.53%          72                37    48.61%
io_service_pool.h                   5                 0   100.00%          32                 1    96.88%          12                 1    91.67%
md5.hpp                            19                 2    89.47%         127                 8    93.70%          24                 0   100.00%
router.h                           19                 2    89.47%         144                35    75.69%           4                 3    25.00%
rpc_client.hpp                     74                 6    91.89%         669               120    82.06%         132                56    57.58%
rpc_server.h                       28                 3    89.29%         205                20    90.24%          44                10    77.27%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             193                18    90.67%        1606               289    82.00%         292               109    62.67%

@try-agaaain
Copy link
Contributor Author

It seems that the code coverage in the report given by github action has not improved, but there is a slight improvement in the lcov report:

image

@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2024

Codecov Report

Attention: Patch coverage is 90.73482% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 55.57%. Comparing base (44392e4) to head (1883731).

Files Patch % Lines
tests/test_rest_rpc.cpp 90.73% 29 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #136      +/-   ##
==========================================
+ Coverage   54.76%   55.57%   +0.80%     
==========================================
  Files         164      163       -1     
  Lines        7945     7939       -6     
==========================================
+ Hits         4351     4412      +61     
+ Misses       3594     3527      -67     

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

Copy link

Code Coverage Report
for detail, goto summary download Artifacts

Filename                    Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
client_util.hpp                     4                 1    75.00%          25                10    60.00%           4                 2    50.00%
codec.h                             4                 0   100.00%          24                 2    91.67%           0                 0         -
connection.h                       40                 4    90.00%         380                93    75.53%          72                37    48.61%
io_service_pool.h                   5                 0   100.00%          32                 1    96.88%          12                 1    91.67%
md5.hpp                            19                 2    89.47%         127                 8    93.70%          24                 0   100.00%
router.h                           19                 2    89.47%         144                35    75.69%           4                 3    25.00%
rpc_client.hpp                     74                 6    91.89%         669               120    82.06%         132                56    57.58%
rpc_server.h                       28                 3    89.29%         205                20    90.24%          44                10    77.27%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             193                18    90.67%        1606               289    82.00%         292               109    62.67%

Copy link

Code Coverage Report
for detail, goto summary download Artifacts

Filename                    Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
client_util.hpp                     4                 1    75.00%          25                10    60.00%           4                 2    50.00%
codec.h                             4                 0   100.00%          24                 2    91.67%           0                 0         -
connection.h                       40                 4    90.00%         380                93    75.53%          72                37    48.61%
io_service_pool.h                   5                 0   100.00%          32                 1    96.88%          12                 1    91.67%
md5.hpp                            19                 2    89.47%         127                 8    93.70%          24                 0   100.00%
router.h                           19                 2    89.47%         144                35    75.69%           4                 3    25.00%
rpc_client.hpp                     74                 6    91.89%         669               120    82.06%         132                56    57.58%
rpc_server.h                       28                 3    89.29%         205                20    90.24%          44                10    77.27%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             193                18    90.67%        1606               289    82.00%         292               109    62.67%

@qicosmos qicosmos self-requested a review March 18, 2024 02:50
Copy link
Owner

@qicosmos qicosmos left a comment

Choose a reason for hiding this comment

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

LGTM

@qicosmos qicosmos merged commit aa02a75 into qicosmos:master Mar 18, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants