Azure / WALinuxAgent

Microsoft Azure Linux Guest Agent
http://azure.microsoft.com/
Apache License 2.0
541 stars 372 forks source link

[BUG] Still uses long dead `nose` for tests #3212

Closed waldiTM closed 2 months ago

waldiTM commented 2 months ago

Describe the bug: A clear and concise description of what the bug is.

This project depends on nose for it's tests. This software is long dead (almost 10 years) and is finally going to be dropped from Debian for example. This means no further tests can be run in this environment.

Distro and WALinuxAgent details (please complete the following information):

narrieta commented 2 months ago

nose is needed to test older python versions. 3.10 and above are tested with pytest

nmeyerhans commented 2 months ago

nose is needed to test older python versions. 3.10 and above are tested with pytest

@narrieta It's not quite accurate that nose is only used with older python versions. Consider the following output with python 3.12:

ERROR: tests.ga.test_cgroupconfigurator (unittest.loader._FailedTest.tests.ga.test_cgroupconfigurator)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.ga.test_cgroupconfigurator
Traceback (most recent call last):
  File "/usr/lib/python3.12/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
  File "/tmp/waagent-2.11.1.4/.pybuild/cpython3_3.12/build/tests/ga/test_cgroupconfigurator.py", line 29, in <module>
    from nose.plugins.attrib import attr
ModuleNotFoundError: No module named 'nose'