dlsyscourse / hw0

23 stars 35 forks source link

KeyError: 'submission_key' #7

Closed JL-Roger closed 2 years ago

JL-Roger commented 2 years ago

I follow the tutorial, when I run command !python3 -m mugrade submit YOUR_GRADER_KEY_HERE -k "add" I changed YOUR_GRADER_KEY_HERE to my Grader Key, but I got wrong information as folllows

submit
============================= test session starts ==============================
platform linux -- Python 3.7.14, pytest-3.6.4, py-1.11.0, pluggy-0.7.1
rootdir: /content/drive/MyDrive/10714/hw0, inifile:
plugins: typeguard-2.7.1
collected 6 items / 5 deselected                                               

tests/test_simple_ml.py F

=================================== FAILURES ===================================
__________________________________ submit_add __________________________________

pyfuncitem = <Function 'submit_add'>

    @pytest.hookimpl(hookwrapper=True)
    def pytest_pyfunc_call(pyfuncitem):
        ## prior to test, initialize submission
        global _values, _submission_key, _errors
        _values = []
        _errors = 0
        func_name = pyfuncitem.name[7:]
        if os.environ["MUGRADE_OP"] == "submit":
>           _submission_key = start_submission(func_name)

/usr/local/lib/python3.7/dist-packages/mugrade/mugrade.py:164: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

func_name = 'add'

    def start_submission(func_name):
        """ Begin a submisssion to the mugrade server """

        server_url, protocol = get_server_url_protocol(os.environ["MUGRADE_KEY"])
        response = requests.post(server_url + "submission",
                                 params = {"user_key": os.environ["MUGRADE_KEY"],
                                           "func_name": func_name},
                                 verify=False)

        if response.status_code != 200:
            raise Exception(f"Error : {response.text}")
>       return response.json()["submission_key"]
E       KeyError: 'submission_key'

/usr/local/lib/python3.7/dist-packages/mugrade/mugrade.py:103: KeyError
==================== 1 failed, 5 deselected in 1.12 seconds ====================

I don't know which steps I do wrong.