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 code coverage report and moved scripts outside of src #66

Merged
merged 3 commits into from
Nov 1, 2022

Conversation

karan6181
Copy link
Collaborator

@karan6181 karan6181 commented Nov 1, 2022

Description of changes:

  • Add a code coverage report as part of pytest github action. This will help to improve the test coverage.
  • The test coverage threshold kept as 50% for now. We need to improve the coverage in future and increase the threshold.
  • Moved the standalone compression and hashing script out from streaming src folder.

Coverage report

---------- coverage: platform linux, python 3.9.15-final-0 -----------
Name                                        Stmts   Miss Branch BrPart     Cover   Missing
------------------------------------------------------------------------------------------
streaming/__init__.py                           6      0      0      0   100.00%
streaming/_version.py                           2      0      0      0   100.00%
streaming/base/__init__.py                      5      0      0      0   100.00%
streaming/base/compression/__init__.py          3      0      0      0   100.00%
streaming/base/compression/compression.py     104      5     16      4    92.50%   195, 236, 238, 254, 256
streaming/base/dataset.py                     263     25    108     20    86.25%   110->112, 184->187, 230, 236->exit, 240, 271->275, 273-274, 287-288, 318->322, 324, 349, 406->416, 410, 422->exit, 425-426, 458-463, 475->473, 482, 487, 520-523, 568-569, 577->580
streaming/base/distributed.py                  23      8      6      0    51.72%   63-72
streaming/base/download.py                     87     51     34      7    38.84%   25-39, 52-94, 126, 129, 131, 144-150, 173->184, 176, 182-183, 185
streaming/base/format/__init__.py              12      0      0      0   100.00%
streaming/base/format/base/__init__.py          1      0      0      0   100.00%
streaming/base/format/base/reader.py           46      3      4      0    90.00%   64, 108-109
streaming/base/format/base/writer.py          128      2     20      3    96.62%   59, 74, 211->214
streaming/base/format/json/__init__.py          4      0      0      0   100.00%
streaming/base/format/json/encodings.py        26      1      0      0    96.15%   50
streaming/base/format/json/reader.py           42     13      2      0    70.45%   92-93, 104-114
streaming/base/format/json/writer.py           36      0      4      0   100.00%
streaming/base/format/mds/__init__.py           4      0      0      0   100.00%
streaming/base/format/mds/encodings.py         88     26      2      1    70.00%   54, 57, 89-93, 96-102, 114-115, 122-124, 127-128, 138, 145, 148, 170, 196
streaming/base/format/mds/reader.py            53      0      8      0   100.00%
streaming/base/format/mds/writer.py            53      0      6      0   100.00%
streaming/base/format/xsv/__init__.py           4      0      0      0   100.00%
streaming/base/format/xsv/encodings.py         44      7      0      0    84.09%   52, 65, 73-74, 78, 120-121
streaming/base/format/xsv/reader.py            83     18      8      0    78.02%   97-103, 114-124
streaming/base/format/xsv/writer.py            68      0      4      0   100.00%
streaming/base/hashing/__init__.py              3      0      0      0   100.00%
streaming/base/hashing/hashing.py              24      2      8      1    90.62%   40, 66
streaming/base/index.py                        98     12     26      6    82.26%   64, 154-155, 181-184, 212-214, 216, 233
streaming/base/local.py                        28     16      4      0    37.50%   27-42, 50, 61-63
streaming/base/util.py                          5      5      0      0     0.00%   4-20
streaming/text/__init__.py                      4      0      0      0   100.00%
streaming/text/c4.py                           29     20      6      0    25.71%   61-74, 82-90, 104-107
streaming/text/convert/__init__.py              1      1      0      0     0.00%   4
streaming/text/convert/c4.py                   60     60     18      0     0.00%   4-154
streaming/text/convert/enwiki.py               41     41     12      0     0.00%   4-120
streaming/text/convert/enwiki/__init__.py       0      0      0      0   100.00%
streaming/text/enwiki.py                       18     10      2      0    40.00%   50-52, 74-84
streaming/vision/__init__.py                    6      0      0      0   100.00%
streaming/vision/ade20k.py                     21     14      6      0    25.93%   55-59, 70-79
streaming/vision/base.py                       37     23      8      0    31.11%   27-28, 40-46, 93-106, 117-120, 164
streaming/vision/cifar10.py                     4      0      0      0   100.00%
streaming/vision/coco.py                       19     12      2      0    33.33%   55-58, 69-80
streaming/vision/convert/__init__.py            1      1      0      0     0.00%   4
streaming/vision/convert/ade20k.py             58     58     26      0     0.00%   4-166
streaming/vision/convert/base.py               19     19      4      0     0.00%   4-55
streaming/vision/convert/cifar10.py            24     24      4      0     0.00%   4-88
streaming/vision/convert/coco.py              110    110     32      0     0.00%   4-244
streaming/vision/convert/imagenet.py           66     66     18      0     0.00%   4-164
streaming/vision/imagenet.py                    4      0      0      0   100.00%
------------------------------------------------------------------------------------------
TOTAL                                        1865    653    398     42    61.42%

Issue #, if available:

Merge Checklist:

Put an x without space in the boxes that apply. If you are unsure about any checklist, please don't hesitate to ask. We are here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • I have read the contributor guidelines
  • This is a documentation change or typo fix. If so, skip the rest of this checklist.
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the MosaicML team.
  • I have updated any necessary documentation, including README and API docs (if appropriate).

Tests

  • I ran pre-commit on my change. (check out the pre-commit section of prerequisites)
  • I have added tests that prove my fix is effective or that my feature works (if appropriate).
  • I ran the tests locally to make sure it pass. (check out testing)
  • I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes.

@karan6181 karan6181 merged commit 6fe0c0c into mosaicml:main Nov 1, 2022
@karan6181 karan6181 deleted the test_coverage branch November 1, 2022 21:30
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.

2 participants