Skip to content

make pytest fails due to missing "task" module in test/common/lcov.py #22267

@adrianocarvalhopt

Description

@adrianocarvalhopt

Explain what happens

Description:

I'm trying to run the Cockpit test suite as described in HACKING.md, but make pytest fails due to missing task module in test/common/lcov.py.

Steps to reproduce:

  1. Clone the Cockpit repository (main branch, commit: d943016).
  2. Create and enter the toolbox.

From the root directory run:

  1. ./autogen.sh --prefix=/usr --enable-debug
  2. make
  3. make check
  4. make pytest

Observed result:

[...]
ImportError while importing test module '/home/ubuntu/src/cockpit/test/pytest/test_browser.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.13/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test/pytest/test_browser.py:8: in <module>
    import lcov
test/common/lcov.py:39: in <module>
    from task import github
E   ModuleNotFoundError: No module named 'task'
[...]

Analysis:

  • The file test/common/lcov.py imports from task import github, but the task module does not exist anywhere in the repository.
  • Commenting out the import allows make pytest to proceed and run tests.

Expected result:

make pytest should (?) run cleanly without modification, or the import should be guarded or removed if it's obsolete.

Environment:

  • OS: Ubuntu 25.04 (using toolbox)
  • Python: 3.13.5
  • pytest: 8.3.4
  • Cockpit branch: main (commit: d943016)

Thanks for maintaining Cockpit! Let me know if you'd like help submitting a patch.

Version of Cockpit

n/a

Where is the problem in Cockpit?

None

Server operating system

Ubuntu

Server operating system version

25.04

What browsers are you using?

Chrome, Firefox

System log

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions