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

Improve testing coverage #2076

Open
1 of 5 tasks
rhysyngsun opened this issue Jan 21, 2021 · 2 comments
Open
1 of 5 tasks

Improve testing coverage #2076

rhysyngsun opened this issue Jan 21, 2021 · 2 comments

Comments

@rhysyngsun
Copy link
Collaborator

rhysyngsun commented Jan 21, 2021

Our testing coverage is sitting at ~82% as of this writing, we should try to improve that, so we should have some goals:

Historically, most of our other projects hover around 95%, but 100% coverage is achievable by annotate lines that are difficult or impossible to cover with # pragma: no cover. This annotation should be used very sparingly.

@briangrossman
Copy link
Contributor

For reference: While not perfect, there's data here: https://codecov.io/gh/mitodl/mitxpro

@HamzaIbnFarooq
Copy link
Contributor

Here is a list of all the files which have code coverage less than 85:

affiliate/apps.py                                           3      3      0      0     0.00%   2-8
authentication/apps.py                                      3      3      0      0     0.00%   2-8
compliance/apps.py                                          3      3      0      0     0.00%   2-8
repl.py                                                    14     14      6      0     0.00%   2-28
users/apps.py                                               3      3      0      0     0.00%   2-8
voucher/apps.py                                             3      3      0      0     0.00%   4-10
sheets/coupon_assign_api.py                               273    215    118      0    14.83%   67-72, 89-109, 119-120, 130-145, 163-190, 208, 226-227, 249, 272-273, 285, 295, 306-309, 333-352, 362-365, 393-406, 420-449, 466-497, 514, 544-547, 558, 568, 580-588, 608-609, 627-661, 671-683, 699-738, 753-754, 779-802, 819-829, 849-894, 911-948, 965-1027
sheets/refund_request_api.py                               91     65     20      0    23.42%   56-71, 85-113, 120, 139-149, 161-173, 187-189, 219-288
sheets/deferral_request_api.py                             69     49     16      0    23.53%   45-56, 70-94, 101, 124-211
sheets/mail_api.py                                         34     22     14      0    25.00%   39-85
sheets/tasks.py                                            80     52     20      0    28.00%   51-53, 63-65, 78-88, 107-122, 138-151, 160-164, 185-216, 228-237, 250-263
sheets/api.py                                             169    112     60      3    29.69%   62-72, 119->120, 120-122, 131->132, 132-134, 145-149, 162-163, 176-186, 202, 224, 246-249, 263, 283-284, 303-304, 324-351, 380-386, 418-426, 439-465, 486-550, 566->568, 568-572
cms/forms.py                                                6      3      2      0    37.50%   14-16
sheets/sheet_handler_api.py                               105     43     34      7    53.96%   47, 69, 95->97, 98->100, 101->102, 102-106, 108->109, 109, 124, 139, 156, 170, 186, 197->200, 200, 210-211, 219->206, 221->222, 222, 248-255, 259, 264, 275-276, 296-311, 314-334, 337
cms/embeds.py                                              25     12      4      0    58.62%   34-49
sheets/views.py                                            92     26     22      8    64.91%   41-45, 58->59, 59, 75->76, 76, 78->79, 79, 107->108, 108, 110->111, 111-115, 120-124, 126->127, 127-131, 141-148, 149->150, 150-157, 159->161, 161-165
compliance/admin.py                                        24      6      2      0    69.23%   27-32, 38, 42
sheets/exceptions.py                                       10      3      0      0    70.00%   28-30
cms/api.py                                                 86     15     44     14    71.54%   103->107, 107->108, 108, 111->115, 118->exit, 130->131, 131-132, 133->exit, 151->155, 155->156, 156-158, 160->164, 164->165, 165-167, 169->173, 173->174, 174-176, 178->189, 189->193, 193-195
sheets/utils.py                                           179     37     18      1    74.62%   56->57, 57, 95-99, 318-319, 346-360, 374-382, 395-396, 409, 424, 437, 495, 509-510, 523, 538, 556, 625-630
authentication/views.py                                    97     20     14      1    77.48%   63->66, 66, 147, 157-174, 178-180, 194-197, 221-224
users/management/commands/retire_users.py                  43      8      8      3    78.43%   49-51, 57, 73->74, 74-79, 85->86, 86-93, 112->117
sheets/admin.py                                            39      5      4      0    79.07%   55-64
users/utils.py                                             45      6     14      4    79.66%   109->116, 116->exit, 119->120, 120, 121->122, 122-131
cms/blocks.py                                              42      6      8      2    80.00%   70-74, 102->103, 103, 110->111, 111
cms/templatetags/image_version_url.py                      15      2      6      2    80.95%   27->28, 28, 30->31, 31
authentication/exceptions.py                               36      6      0      0    83.33%   13-14, 37, 44, 58, 65
cms/urls.py                                                10      1      2      1    83.33%   25->30, 30
authentication/strategy.py                                 15      1      4      2    84.21%   18->21, 25->26, 26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants