openbmc / openbmc-build-scripts

Apache License 2.0
19 stars 50 forks source link

build-unit-test-docker: lcov v1.6 does not exclude files listed in .lcovrc #37

Closed ewalkusx closed 2 months ago

ewalkusx commented 2 months ago

1st solution: Bump lcov version

https://gerrit.openbmc.org/c/openbmc/openbmc-build-scripts/+/71592 but lcov 2.0 (and newer) introduce another new issue

lcov 2.0 (and newer) has improved error checking

Now coverage fails due to:

❌ 1st solution: Suppress errors via .lcovrc file in each repository. ❓2nd solution: Suppress errors in mesonbuil/meson repo mesonbuild/meson#13344 Unfortunately, this fix does not fit 2 Linux distributions


2nd solution: Replace lcov with gcovr


Any suggestions? 🙂

amboar commented 2 months ago

So I had a look at https://www.gcovr.com/en/stable/faq.html, and then replaced lcov in my development setup with gcovr, and the results are much better. We should switch to gcovr for the reasons outlined in the FAQ if nothing else.

lxwinspur commented 1 month ago

@amboar It looks like this affects libmctp: https://jenkins.openbmc.org/job/ci-repository/89079/console

lxwinspur commented 1 month ago
checking for genhtml... no
configure: error: To enable code coverage reporting you must have lcov installed
Traceback (most recent call last):
  File "/data0/jenkins/workspace/ci-repository/openbmc/openbmc-build-scripts/scripts/unit-test.py", line 1423, in <module>
    build_and_install(UNIT_TEST_PKG, True)
  File "/data0/jenkins/workspace/ci-repository/openbmc/openbmc-build-scripts/scripts/unit-test.py", line 313, in build_and_install
    pkg.test()
  File "/data0/jenkins/workspace/ci-repository/openbmc/openbmc-build-scripts/scripts/unit-test.py", line 1199, in test
    self._test_one(system)
  File "/data0/jenkins/workspace/ci-repository/openbmc/openbmc-build-scripts/scripts/unit-test.py", line 1190, in _test_one
    system.configure(True)
  File "/data0/jenkins/workspace/ci-repository/openbmc/openbmc-build-scripts/scripts/unit-test.py", line 719, in configure
    check_call_cmd("./configure", *conf_flags)
  File "/data0/jenkins/workspace/ci-repository/openbmc/openbmc-build-scripts/scripts/unit-test.py", line 238, in check_call_cmd
    check_call(cmd, **kwargs)
  File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('./configure', '--disable-silent-rules', '--enable-examples', '--enable-tests', '--enable-itests', '--enable-code-coverage', '--enable-valgrind')' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/data0/jenkins/workspace/ci-repository/openbmc/openbmc-build-scripts/scripts/dbus-unit-test.py", line 109, in <module>
    check_call(UNIT_TEST.split(","), env=os.environ)
  File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/data0/jenkins/workspace/ci-repository/openbmc/openbmc-build-scripts/scripts/unit-test.py', '-w', '/data0/jenkins/workspace/ci-repository/openbmc', '-p', 'libmctp', '-b', 'master', '-v']' returned non-zero exit status 1.
Build step 'Execute shell' marked build as failure
amboar commented 1 month ago

I think at this point, given how few autotools-based projects we should have left, that we just disable code coverage support for them in the CI script. @lxwinspur can you push a patch doing so?

lxwinspur commented 1 month ago

I think at this point, given how few autotools-based projects we should have left, that we just disable code coverage support for them in the CI script. @lxwinspur can you push a patch doing so?

Sure, I will update this week.

lxwinspur commented 1 month ago

@amboar Could you please take a look at this patch? https://gerrit.openbmc.org/c/openbmc/openbmc-build-scripts/+/73458