jupyter / nbgrader

A system for assigning and grading notebooks
https://nbgrader.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.3k stars 317 forks source link

Fix the confusing server errors during UI tests #1871

Closed brichet closed 5 months ago

brichet commented 8 months ago

This PR addresses https://github.com/jupyter/nbgrader/issues/1816.

It suppresses server error messages during user interface tests, which suggest that the test is not passing, and make the stdout output difficult to analyze.

github-actions[bot] commented 8 months ago

Binder :point_left: Launch a Binder on branch _brichet/nbgrader/cleanui-tests

trevorcampbell commented 7 months ago

Amazing -- thanks @brichet ! This is already a major improvement.

Just looking quickly at the uitest ubuntu 22.04 python 3.10 nbextensions under Run Playwright Tests, I still see quite a few 404s that clutter the logs, as well as still one or two remaining tracebacks (e.g. below). Not sure if it's worth hunting those down too?

[WebServer] [C 2024-03-27 11:26:04.988 ServerApp] Assignment ps.01 not submitted. There are missing notebooks for the submission:
    Expected:
        problem 1.ipynb: MISSING
    Submitted:
        my problem 1.ipynb: EXTRA
[WebServer] [E 2024-03-27 11:26:04.989 ServerApp] Traceback (most recent call last):
      File "/home/runner/work/nbgrader/nbgrader/nbgrader/server_extensions/assignment_list/handlers.py", line 269, in submit_assignment
        submit.start()
      File "/home/runner/work/nbgrader/nbgrader/nbgrader/exchange/default/exchange.py", line 135, in start
        return super(Exchange, self).start()
      File "/home/runner/work/nbgrader/nbgrader/nbgrader/exchange/abc/exchange.py", line 84, in start
        self.copy_files()
      File "/home/runner/work/nbgrader/nbgrader/nbgrader/exchange/default/submit.py", line 135, in copy_files
        self.check_filename_diff()
      File "/home/runner/work/nbgrader/nbgrader/nbgrader/exchange/default/submit.py", line 110, in check_filename_diff
        self.fail(
      File "/home/runner/work/nbgrader/nbgrader/nbgrader/exchange/abc/exchange.py", line 58, in fail
        raise ExchangeError(msg)
    nbgrader.exchange.abc.exchange.ExchangeError: Assignment ps.01 not submitted. There are missing notebooks for the submission:
    Expected:
        problem 1.ipynb: MISSING
    Submitted:
        my problem 1.ipynb: EXTRA

[WebServer] [W 2024-03-27 11:26:05.150 ServerApp] delete /nbgrader-assignment-list-test/ps.01/my problem 1.ipynb
brichet commented 7 months ago

Yes, some traceback are expected (test with missing file or directory).