mmpose icon indicating copy to clipboard operation
mmpose copied to clipboard

[Refactor] Add Webcam API unittests

Open Ben-Louis opened this issue 2 years ago • 3 comments

Motivation

Modification

BC-breaking (Optional)

Use cases (Optional)

Checklist

Before PR:

  • [ ] I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • [ ] Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • [ ] Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • [ ] New functionalities are covered by complete unit tests. If not, please add more unit tests to ensure correctness.
  • [ ] The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • [ ] CLA has been signed and all committers have signed the CLA in this PR.

Ben-Louis avatar Sep 15 '22 10:09 Ben-Louis

Codecov Report

Base: 70.34% // Head: 78.65% // Increases project coverage by +8.31% :tada:

Coverage data is based on head (eb38215) compared to base (60c62fc). Patch coverage: 53.33% of modified lines in pull request are covered.

:exclamation: Current head eb38215 differs from pull request most recent head ff644a2. Consider uploading reports for the commit ff644a2 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           dev-1.x    #1662      +/-   ##
===========================================
+ Coverage    70.34%   78.65%   +8.31%     
===========================================
  Files          203      203              
  Lines        11558    11565       +7     
  Branches      2019     2019              
===========================================
+ Hits          8130     9096     +966     
+ Misses        3083     2083    -1000     
- Partials       345      386      +41     
Flag Coverage Δ
unittests 78.65% <53.33%> (+8.31%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmpose/apis/webcam/utils/message.py 97.95% <ø> (+97.95%) :arrow_up:
mmpose/apis/webcam/webcam_executor.py 38.51% <22.22%> (+38.51%) :arrow_up:
mmpose/apis/webcam/utils/buffer.py 91.66% <100.00%> (+91.66%) :arrow_up:
mmpose/apis/webcam/utils/misc.py 75.64% <100.00%> (+75.64%) :arrow_up:
mmpose/apis/webcam/utils/pose.py 100.00% <100.00%> (+100.00%) :arrow_up:
mmpose/datasets/transforms/common_transforms.py 83.19% <0.00%> (ø)
mmpose/codecs/utils/refinement.py 98.52% <0.00%> (+1.47%) :arrow_up:
mmpose/models/heads/heatmap_heads/heatmap_head.py 88.63% <0.00%> (+1.51%) :arrow_up:
mmpose/datasets/datasets/utils.py 84.48% <0.00%> (+1.72%) :arrow_up:
mmpose/apis/inference.py 76.47% <0.00%> (+4.70%) :arrow_up:
... and 28 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Sep 16 '22 04:09 codecov[bot]

#1638 has been merged. Please rebase the pr branch onto the latest dev-1.x

ly015 avatar Sep 18 '22 18:09 ly015

The unittest for the missed lines, indeed the unittest for webcam_executor.run, involves multi-threading. It will cause segmentation fault in pr_stage_test / build_cpu (3.7) and fail while pass in other environments. Is there any method to fix this CI problem? @ly015

Ben-Louis avatar Sep 19 '22 06:09 Ben-Louis