agherzan / meta-raspberrypi

Yocto/OE BSP layer for the Raspberry Pi boards
https://www.yoctoproject.org/
MIT License
505 stars 395 forks source link

"parselogs_rpi.py" breaks qemu testimage on poky master #1307

Open BigPapa314 opened 2 months ago

BigPapa314 commented 2 months ago

Description

When you try to do image testing on poky master the parselogs_rpi test cannot be compiled. That prevents test execution even if the test is removed by TEST_SUITES:remove:rpi = "parselogs_rpi" in local.conf.

Steps to reproduce the issue:

Maybe you have to setup qemu requisites according to: Enabling Runtime Tests on QEMU.

  1. mkdir -p test/sources
  2. cd test/sources
  3. git clone -b master https://git.yoctoproject.org/poky
  4. git clone -b master https://git.yoctoproject.org/meta-raspberrypi
  5. cd ..
  6. source ./sources/poky/oe-init-build-env build
  7. bitbake-layers add-layer ../sources/meta-raspberrypi
  8. echo 'MACHINE = "qemuarm64"' >> conf/local.conf
  9. echo 'IMAGE_CLASSES += "testimage"' >> conf/local.conf
  10. bitbake core-image-minimal
  11. bitbake -c testimage core-image-minimal

Describe the results you received:

Exception: ImportError: Failed to import test module: parselogs_rpi
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "test/sources/meta-raspberrypi/lib/oeqa/runtime/cases/parselogs_rpi.py", line 6, in <module>
    ignore_errors['raspberrypi4'] = rpi_errors + common_errors
NameError: name 'common_errors' is not defined

Describe the results you expected:

core-image-minimal - OK - All required tests passed (successes=2, skipped=71, failures=0, errors=0)

Additional information you deem important (e.g. issue happens only occasionally):

It seams to happen while bitbake is parsing all test cases and it is not possible to deactivate this parsing for certain test cases.

Additional details (revisions used, host distro, etc.):

none

Comments:

Maybe the file can be deleted (as it does nothing) and the parselogs replacement in layer.conf can be removed. Or if you whant to keep the stub for adding errors to ignore the file can be changed to:

from oeqa.runtime.cases.parselogs import ParseLogsTest

class ParseLogsTestRpi(ParseLogsTest):
    # A list of error messages that should be ignored
    ignore_errors = []
agherzan commented 2 months ago

@BigPapa314 Thanks for this. I suspect we missed a core change here. Could you track what happened to common_errors?