How to locally debug Gradescope Autograder
🤔
If you are trying to create a Gradescope Autograder then you have probably faced an issue how to properly test your docker image. Here is a solution which would create almost exact copy of the gradescope environment on your machine.
Docker file for testing
All you need is to create a second docker file which would emulate the gradescope image. Here it is:
|
|
This docker file is creating an image which is based on your grading image (YOUR_BASE_IMAGE_NAME), includes dump submission metadata file (submission_metadata.json
), unzip test submission from test_submission.zip
and then run the entrypoint.
Here is a submission_metadata.json
that I am using for testing. You may want to make it more realistic for your example, but it is good enough for me:
|
|
🧪
Testing
To run the testing suite do the following:
- Zip your test submission into
test_submission.zip
- Run
docker build -t YOUR_BASE_IMAGE_NAME .
to create your autograder image as you usually do - Run
docker build -t my-test-suite -f DockerfileTest .
to create a testing image - Run
docker run my-test-suite
to run the testing suite. If you want to run your grader manully usedocker run -it --entrypoint bash my-test-suite