-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added the ability to request a removal of a specified submission to the CLI #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good start, and needs some work.
Be careful, I felt like this one was a bit more loose than the server one.
Don't let your guard down on Python.
We also need some tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code here looks good!
Only comment on the existing code is that you should rename:
"remove-submission" -> "remove".
Since it is already in the "submission" package, the prefix is redundant.
The only remaining thing here is tests.
API tests are done with JSON data:
https://github.com/eriq-augustine/autograder-py/tree/main/tests/api/data
The testing infrastructure knows how to look through the data, find the tests, call the right API method, and check the results.
The easiest way to get the expected output for the tests is to run the CLI call on the Python side (e.g. python3 -m autograder.cli.submission.remove --verbose ...
).
With the verbose
flag, the exact request and response will be printed out.
You can see examples with peek:
https://github.com/eriq-augustine/autograder-py/blob/main/tests/api/data/test_submission_peek_other_specific.json
Note that the data for API tests will actually be validated later (automatically) in the CI for the server.
With that logic, should "removesubmission" in api/submission also be renamed to remove? |
Yes.
The API tests (which is run in the CI) is sending itself HTTP requests and checking that they match up against it's own expected output (the same file is used to specify the input an output):
https://github.com/eriq-augustine/autograder-py/blob/main/tests/api/test_api.py#L32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test content is looking good.
Just need to get our gitignore back and adjust the spacing in the tests.
tests/api/data/test_submission_remove_submission_other_missing.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We are just waiting on the sibling PR in the server:
edulinq/autograder-server#39
Looks like I spoke too soon, CI is failing. |
tests/api/data/test_submission_remove_submission_other_missing.json
Outdated
Show resolved
Hide resolved
merged updated changes in the main branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the test cases is incorrect and should not be passing.
This is something that should be caught by the standard tests.
If this is not getting caught on your local test runs, it is a pretty big issue.
tests/api/data/test_submission_remove_submission_self_mission.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We are now just waiting on the server PR.
No description provided.