Re: Having problems generating a code coverage report

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Having problems generating a code coverage report
Date: 2025-01-15 18:48:03
Message-ID: CAH2-WzmemwQFQBbzuZs5UUb-JDBo2A7R-aBt_Hc=A6ZnKXyycQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 30, 2024 at 5:26 PM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> I use Debian unstable for most of my day to day work. Apparently
> Debian unstable has exactly the same version of lcov as Ubuntu 24.04.
>
> I've also been unable to generate coverage reports for some time (at
> least on Debian, with LCOV version 2.0-1).

I found a temporary workaround. I'm now once again able to produce
html coverage reports on my Debian unstable workstation. Here's what I
did:

I found that a local installation of lcov 1.16 worked. I cloned the
lcov git repo, and checked out the tag 'v1.16'. I then installed this
older lcov version to a directory under my home directory.

It was also necessary to convince the build system to use my
known-good version of lcov. I had to use autoconf here, since (if I'm
not mistaken) only autoconf will accept specific instructions as to
which gcov, lcov, and genhtml to use (via environment variables). I
also used a relatively old version of GCC, taken from the "gcc-11"
package (not sure if that part was really necessary).

I adding something along these lines to the zsh function that runs
"configure" for me, to automate the process going forward:

export CC="gcc-11" # Provided by gcc-11 package
export GCOV="gcov-11" # Provided by gcc-11 package
export LCOV="/home/pg/.../lcov" # Provided by local lcov 1.16 installation
export GENHTML="/home/pg/.../genhtml" # Provided by local lcov 1.16
installation

From here I ran the standard, documented procedure: I ran configure
(through the zsh function), built Postgres in the usual way, ran the
tests in the usual way, and finally ran "make coverage-html". The
final html report looks very similar to the one from
coverage.postgresql.org.

(There were some geninfo warnings about certain files not having any
coverage whatsoever, but I'm pretty sure that that's normal.)

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2025-01-15 18:50:00 Re: use a non-locking initial test in TAS_SPIN on AArch64
Previous Message Bernd Helmle 2025-01-15 18:24:21 Re: [PATCH] Add sortsupport for range types and btree_gist