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 more test cases to improve test coverage #284

Open
PIG208 opened this issue Oct 30, 2021 · 1 comment
Open

ADD more test cases to improve test coverage #284

PIG208 opened this issue Oct 30, 2021 · 1 comment

Comments

@PIG208
Copy link
Contributor

PIG208 commented Oct 30, 2021

Improving the test coverage will help us move more smoothly when doing code migrations and save some time from debugging. Specifically, we may want to test features that require external services like GitHub by mocking responses.

Setting up a workable GitHub organization with a bot user in the local development environment is troublesome and we can't use the token for automated tests. So coming up with a reasonable white-box testing infrastructure for these features can be crucial for maintaining the functionality API server. It will prevent us from bringing broken function calls or backward-incompatible changes to the codebase. I think this will also be helpful for #281.

----------- coverage: platform linux, python 3.9.5-final-0 -----------
Name                                                                Stmts   Miss  Cover
---------------------------------------------------------------------------------------
/home/pig208/Anubis/api/anubis/__init__.py                              0      0   100%
/home/pig208/Anubis/api/anubis/app.py                                  33     10    70%
/home/pig208/Anubis/api/anubis/config.py                               32      4    88%
/home/pig208/Anubis/api/anubis/k8s/__init__.py                          0      0   100%
/home/pig208/Anubis/api/anubis/k8s/pipeline.py                         29     20    31%
/home/pig208/Anubis/api/anubis/k8s/theia.py                           189    167    12%
/home/pig208/Anubis/api/anubis/lms/__init__.py                          0      0   100%
/home/pig208/Anubis/api/anubis/lms/assignments.py                     112     85    24%
/home/pig208/Anubis/api/anubis/lms/autograde.py                        48     34    29%
/home/pig208/Anubis/api/anubis/lms/courses.py                         161    122    24%
/home/pig208/Anubis/api/anubis/lms/lectures.py                         13      6    54%
/home/pig208/Anubis/api/anubis/lms/questions.py                       137    115    16%
/home/pig208/Anubis/api/anubis/lms/repos.py                             8      2    75%
/home/pig208/Anubis/api/anubis/lms/students.py                         17      9    47%
/home/pig208/Anubis/api/anubis/lms/submissions.py                     128    110    14%
/home/pig208/Anubis/api/anubis/lms/theia.py                            38     18    53%
/home/pig208/Anubis/api/anubis/lms/webhook.py                          35     29    17%
/home/pig208/Anubis/api/anubis/models/__init__.py                     355     59    83%
/home/pig208/Anubis/api/anubis/rpc/__init__.py                          0      0   100%
/home/pig208/Anubis/api/anubis/rpc/batch.py                             7      3    57%
/home/pig208/Anubis/api/anubis/rpc/lms.py                              17     12    29%
/home/pig208/Anubis/api/anubis/rpc/pipeline.py                         31     23    26%
/home/pig208/Anubis/api/anubis/rpc/seed.py                             53     47    11%
/home/pig208/Anubis/api/anubis/rpc/theia.py                            62     48    23%
/home/pig208/Anubis/api/anubis/rpc/visualizations.py                   18      8    56%
/home/pig208/Anubis/api/anubis/utils/__init__.py                        0      0   100%
/home/pig208/Anubis/api/anubis/utils/auth/__init__.py                   0      0   100%
/home/pig208/Anubis/api/anubis/utils/auth/http.py                      49     26    47%
/home/pig208/Anubis/api/anubis/utils/auth/oauth.py                      5      0   100%
/home/pig208/Anubis/api/anubis/utils/auth/token.py                     17      9    47%
/home/pig208/Anubis/api/anubis/utils/auth/user.py                      34     22    35%
/home/pig208/Anubis/api/anubis/utils/cache.py                           5      1    80%
/home/pig208/Anubis/api/anubis/utils/config.py                         19     12    37%
/home/pig208/Anubis/api/anubis/utils/data.py                          118     83    30%
/home/pig208/Anubis/api/anubis/utils/exceptions.py                     27     11    59%
/home/pig208/Anubis/api/anubis/utils/github/__init__.py                 0      0   100%
/home/pig208/Anubis/api/anubis/utils/github/api.py                     49     41    16%
/home/pig208/Anubis/api/anubis/utils/github/fix.py                     75     75     0%
/home/pig208/Anubis/api/anubis/utils/github/parse.py                   12      8    33%
/home/pig208/Anubis/api/anubis/utils/github/repos.py                   92     79    14%
/home/pig208/Anubis/api/anubis/utils/http/__init__.py                  44     29    34%
/home/pig208/Anubis/api/anubis/utils/http/decorators.py                71     47    34%
/home/pig208/Anubis/api/anubis/utils/http/files.py                     32     24    25%
/home/pig208/Anubis/api/anubis/utils/logging.py                         7      0   100%
/home/pig208/Anubis/api/anubis/utils/migrate.py                         6      2    67%
/home/pig208/Anubis/api/anubis/utils/pipeline/__init__.py               0      0   100%
/home/pig208/Anubis/api/anubis/utils/pipeline/decorators.py            22     22     0%
/home/pig208/Anubis/api/anubis/utils/rpc.py                            39     22    44%
/home/pig208/Anubis/api/anubis/utils/testing/__init__.py                0      0   100%
/home/pig208/Anubis/api/anubis/utils/testing/autograde_timings.py      54     54     0%
/home/pig208/Anubis/api/anubis/utils/testing/seed.py                   90     68    24%
/home/pig208/Anubis/api/anubis/utils/visuals/__init__.py                0      0   100%
/home/pig208/Anubis/api/anubis/utils/visuals/assignments.py            84     68    19%
/home/pig208/Anubis/api/anubis/utils/visuals/queries.py                 4      0   100%
/home/pig208/Anubis/api/anubis/utils/visuals/usage.py                  61     47    23%
/home/pig208/Anubis/api/anubis/views/__init__.py                        0      0   100%
/home/pig208/Anubis/api/anubis/views/admin/__init__.py                 19      0   100%
/home/pig208/Anubis/api/anubis/views/admin/assignments.py             110     54    51%
/home/pig208/Anubis/api/anubis/views/admin/auth.py                     19      8    58%
/home/pig208/Anubis/api/anubis/views/admin/autograde.py                70     38    46%
/home/pig208/Anubis/api/anubis/views/admin/config.py                   29     15    48%
/home/pig208/Anubis/api/anubis/views/admin/courses.py                 138     78    43%
/home/pig208/Anubis/api/anubis/views/admin/dangling.py                 28      9    68%
/home/pig208/Anubis/api/anubis/views/admin/ide.py                      80     40    50%
/home/pig208/Anubis/api/anubis/views/admin/late_exceptions.py          58     35    40%
/home/pig208/Anubis/api/anubis/views/admin/lectures.py                 74     46    38%
/home/pig208/Anubis/api/anubis/views/admin/questions.py               108     61    44%
/home/pig208/Anubis/api/anubis/views/admin/regrade.py                  82     48    41%
/home/pig208/Anubis/api/anubis/views/admin/seed.py                     15      3    80%
/home/pig208/Anubis/api/anubis/views/admin/static.py                   33     11    67%
/home/pig208/Anubis/api/anubis/views/admin/students.py                 77     40    48%
/home/pig208/Anubis/api/anubis/views/admin/visuals.py                  35     14    60%
/home/pig208/Anubis/api/anubis/views/pipeline/__init__.py               5      5     0%
/home/pig208/Anubis/api/anubis/views/pipeline/pipeline.py              76     76     0%
/home/pig208/Anubis/api/anubis/views/public/__init__.py                19      0   100%
/home/pig208/Anubis/api/anubis/views/public/assignments.py             20      4    80%
/home/pig208/Anubis/api/anubis/views/public/auth.py                   110     70    36%
/home/pig208/Anubis/api/anubis/views/public/courses.py                 44     19    57%
/home/pig208/Anubis/api/anubis/views/public/ide.py                     91     53    42%
/home/pig208/Anubis/api/anubis/views/public/lectures.py                14      3    79%
/home/pig208/Anubis/api/anubis/views/public/memes.py                    7      2    71%
/home/pig208/Anubis/api/anubis/views/public/profile.py                 26     13    50%
/home/pig208/Anubis/api/anubis/views/public/questions.py               40     18    55%
/home/pig208/Anubis/api/anubis/views/public/repos.py                   60     29    52%
/home/pig208/Anubis/api/anubis/views/public/static.py                  18      7    61%
/home/pig208/Anubis/api/anubis/views/public/submissions.py             51     29    43%
/home/pig208/Anubis/api/anubis/views/public/visuals.py                 18      7    61%
/home/pig208/Anubis/api/anubis/views/public/webhook.py                 71     51    28%
---------------------------------------------------------------------------------------
TOTAL                                                                4184   2567    39%

(test coverage for api/anubis)

@wabscale
Copy link
Collaborator

Yeah I agree with you 100% on this one. @nysteo and I were talking about this exactly today. I believe we may have our graduate devops team take the lead on expanding the tests.

@wabscale wabscale mentioned this issue Dec 16, 2021
36 tasks
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

No branches or pull requests

2 participants