Skip to content

Test failures due to launch_pytest import error #657

Description

@nnarain
      ==================================== ERRORS ====================================
      ________________________ ERROR collecting test session _________________________
      /usr/lib/python3/dist-packages/pluggy/_hooks.py:501: in __call__
          return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
      /usr/lib/python3/dist-packages/pluggy/_manager.py:119: in _hookexec
          return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
      /usr/lib/python3/dist-packages/_pytest/python.py:215: in pytest_collect_file
          module: Module = ihook.pytest_pycollect_makemodule(
      /usr/lib/python3/dist-packages/_pytest/config/compat.py:66: in fixed_hook
          return hook(**kw)
      /usr/lib/python3/dist-packages/pluggy/_hooks.py:501: in __call__
          return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
      /usr/lib/python3/dist-packages/pluggy/_manager.py:119: in _hookexec
          return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
      /opt/ros/rolling/lib/python3.12/site-packages/launch_testing/pytest/hooks.py:193: in pytest_pycollect_makemodule
          entrypoint = find_launch_test_entrypoint(path)
      /opt/ros/rolling/lib/python3.12/site-packages/launch_testing/pytest/hooks.py:183: in find_launch_test_entrypoint
          module = import_path(path, root=None)
      /usr/lib/python3/dist-packages/_pytest/pathlib.py:567: in import_path
          importlib.import_module(module_name)
      /usr/lib/python3.12/importlib/__init__.py:90: in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
      <frozen importlib._bootstrap>:1387: in _gcd_import
          ???
      <frozen importlib._bootstrap>:1360: in _find_and_load
          ???
      <frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
          ???
      <frozen importlib._bootstrap>:935: in _load_unlocked
          ???
      /usr/lib/python3/dist-packages/_pytest/assertion/rewrite.py:186: in exec_module
          exec(co, module.__dict__)
      ../../src/ywcnof8hmr/diagnostics/diagnostic_aggregator/test/test_discard_behavior.py:71: in <module>
          import launch_pytest
      E   ModuleNotFoundError: No module named 'launch_pytest'
      - generated xml file: /__w/diagnostics/diagnostics/ros_ws/build/diagnostic_aggregator/test_results/diagnostic_aggregator/test_discard_behavior.xunit.xml -
      =========================== short test summary info ============================
      ERROR ../.. - ModuleNotFoundError: No module named 'launch_pytest'
      !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
      =============================== 1 error in 0.17s ===============================
      -- run_test.py: return code 2
      -- run_test.py: verify result file '/__w/diagnostics/diagnostics/ros_ws/build/diagnostic_aggregator/test_results/diagnostic_aggregator/test_discard_behavior.xunit.xml'

Looks ok locally. So I assume this has something to do with how the dependencies are installed in CI.
Looks like this has been happening for a bit. The launch_pytest has been in for a while so that looks ok.

Haven't dug to deep into the actions-ros-ci step. But it just does a rosdep install.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions