From 1f64c78c4b875338aef1b84d2e31ef199001e143 Mon Sep 17 00:00:00 2001 From: Tom Barbette Date: Tue, 27 Aug 2024 15:34:53 +0200 Subject: [PATCH] Add debugging information to play scripts in SSH While this is a bit redundant, I think it is good debugging advice to explain how to load the ipython scripts from the SSH shell. Probably, like me nobody really remembers that a modified IPython is launching a ".py" script, after writing simple run.py for years. --- doc/teacher_doc/testing.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/teacher_doc/testing.rst b/doc/teacher_doc/testing.rst index e5139fbd3..7d1fae955 100644 --- a/doc/teacher_doc/testing.rst +++ b/doc/teacher_doc/testing.rst @@ -26,4 +26,16 @@ Every administrator is able from the frontend to launch a debugging job. This is on the *>_* (left-chevron, underscore) button next to the *Submit* button. According to your configuration, either a SSH command-line with auto-generated password will be given you (you will, in this case, need an SSH client installed), or an embedded SSH console will pop up as the -feedback position. \ No newline at end of file +feedback position. + +Debugging IPython scripts (run.py) +`````````````````````````````````` +As mentioned in :ref:`run_file`, INGInious uses IPython and is configured to expose a few +functions such as ``get_input`` or ``set_feedback``. Therefore, you can't directly use the ``python`` +interpreter but must use `inginious-ipython`, for instance ``inginious-ipython run.py``. + +Debugging bash scripts (run.sh) +```````````````````````````````` +As opposed to python scripts, INGInious functions are exposed through the +environment so there is no need to use a particular loader. ``source run.sh`` might be a better +choice than running the script in a subshell to observe the state of variables after execution. \ No newline at end of file