jupyterlab / jupyterlab

JupyterLab computational environment.
https://jupyterlab.readthedocs.io/
Other
13.81k stars 3.12k forks source link

Python tests failing on CI #16222

Closed jtpio closed 2 weeks ago

jtpio commented 3 weeks ago

Looks like the Python tests started to fail on CI.

This was originally noticed after rebasing https://github.com/jupyterlab/jupyterlab/pull/16005.

But reproducible on the latest commit on the main branch: 8819549495cd11470b4db7464d1d59c53cfce787

Example run: https://github.com/jupyterlab/jupyterlab/actions/runs/8773764108/job/24110994049

image

=================================== FAILURES ===================================
_____________________ TestExtension.test_disable_extension _____________________
self = <jupyterlab.tests.test_jupyterlab.TestExtension testMethod=test_disable_extension>
    def test_disable_extension(self):
        options = AppOptions(app_dir=self.tempdir())
        assert install_extension(self.mock_extension, app_options=options) is True
        assert disable_extension(self.pkg_names["extension"], app_options=options) is True
        info = get_app_info(app_options=options)
        name = self.pkg_names["extension"]
>       assert info["disabled"].get(name) is True
E       AssertionError: assert None is True
E        +  where None = <built-in method get of dict object at 0x7fd4d91824c0>('@jupyterlab/mock-extension')
E        +    where <built-in method get of dict object at 0x7fd4d91824c0> = {}.get
jupyterlab/tests/test_jupyterlab.py:559: AssertionError
----------------------------- Captured stdout call -----------------------------
-\|/
_____________________ TestExtension.test_enable_extension ______________________
self = <jupyterlab.tests.test_jupyterlab.TestExtension testMethod=test_enable_extension>
    def test_enable_extension(self):
        options = AppOptions(app_dir=self.tempdir())
        assert install_extension(self.mock_extension, app_options=options) is True
>       assert disable_extension(self.pkg_names["extension"], app_options=options) is True
E       AssertionError: assert False is True
E        +  where False = disable_extension('@jupyterlab/mock-extension', app_options=<jupyterlab.commands.AppOptions object at 0x7fd4d8ba2360>)
jupyterlab/tests/test_jupyterlab.py:576: AssertionError
----------------------------- Captured stdout call -----------------------------
-\|/
=============================== warnings summary ===============================
../../../../../opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/pytest_jupyter/jupyter_server.py:17
  /opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/pytest_jupyter/jupyter_server.py:17: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
  given by the platformdirs library.  To remove this warning and
  see the appropriate new directories, set the environment variable
  `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
  The use of platformdirs will be the default in `jupyter_core` v6
    import jupyter_core.paths
../../../../../opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/_pytest/config/__init__.py:1439
  /opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/_pytest/config/__init__.py:1439: PytestConfigWarning: Unknown config option: ignore

    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")
jupyterlab/tests/test_jupyterlab.py::TestExtension::test_install_and_uninstall_pinned_folder
jupyterlab/tests/test_jupyterlab.py::TestExtension::test_install_and_uninstall_pinned_folder
  /opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/tarfile.py:2221: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
    warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---- generated xml file: /home/runner/work/jupyterlab/jupyterlab/junit.xml -----
=========================== short test summary info ============================
FAILED jupyterlab/tests/test_jupyterlab.py::TestExtension::test_disable_extension - AssertionError: assert None is True
 +  where None = <built-in method get of dict object at 0x7fd4d91824c0>('@jupyterlab/mock-extension')
 +    where <built-in method get of dict object at 0x7fd4d91824c0> = {}.get
FAILED jupyterlab/tests/test_jupyterlab.py::TestExtension::test_enable_extension - AssertionError: assert False is True
 +  where False = disable_extension('@jupyterlab/mock-extension', app_options=<jupyterlab.commands.AppOptions object at 0x7fd4d8ba2360>)
============= 2 failed, 78 passed, 4 warnings in 538.88s (0:08:58) =============
jtpio commented 3 weeks ago

This is likely related to a new release of an upstream dependency, although not sure which one yet.

krassowski commented 3 weeks ago

That would likely be https://github.com/jupyterlab/jupyterlab_server/releases/tag/v2.27.0

krassowski commented 3 weeks ago

Can you confirm this by pinning?

jtpio commented 3 weeks ago

Gonna try that in a draft PR.

Edit: https://github.com/jupyterlab/jupyterlab/pull/16223

jtpio commented 3 weeks ago

That would likely be https://github.com/jupyterlab/jupyterlab_server/releases/tag/v2.27.0

Yes, pinning jupyterlab_server makes the CI checks pass on https://github.com/jupyterlab/jupyterlab/pull/16223 :

image

krassowski commented 3 weeks ago

@divyansshhh what do you think?

jtpio commented 3 weeks ago

According to the changelog this is the only PR released in 2.27.0: https://github.com/jupyterlab/jupyterlab_server/pull/448

cc @divyansshhh as the author of the PR, who may also have an idea of what may be causing the issue.

divyansshhh commented 2 weeks ago

Taking a look

divyansshhh commented 2 weeks ago

The issue was due to moving the ENV_CONFIG_PATH import to the top of the file.

I'm raising another PR in jupyterlab_server to fix this.

divyansshhh commented 2 weeks ago

Raised jupyterlab/jupyterlab_server#450

jtpio commented 2 weeks ago

Closing as fixed by https://github.com/jupyterlab/jupyterlab_server/pull/450, released in https://github.com/jupyterlab/jupyterlab_server/releases/tag/v2.27.1.

Thanks @divyansshhh and @krassowski!