[elbe-devel] [PATCH 01/11] cov: Introduce elbe-ci coverage

Olivier Dion dion at linutronix.de
Wed Aug 19 15:52:30 CEST 2020


On Wed, 19 Aug 2020, Torben Hohn <torben.hohn at linutronix.de> wrote:
> On Mon, Aug 17, 2020 at 12:20:10PM -0400, Olivier Dion wrote:
>> Coverage of source code is done by using python-coverage [1].  The
>> version 4.x is very important to use because this is the only version
>> available on Buster for the initvm (see Notes).
>> 
>> Coverage is initiated by a top process.  This process set an
>> environment variable to tell others processes (mainly recursive
>> execution of Elbe) that coverage should be activated.  The descendants
>> of the top process can only do coverage, but they will never combine
>> nor do report of the measurement they have made.  This is done by the
>> top process only.
>> 
>> The coverage is a per-thread attribute.  python-coverage [1] should be
>> thread aware, but I haven't tested it yet.  The current problem with
>> this implementation however is that it's using os.environ.  Which
>> means that if thread A starts coverage, then children forked from
>> thread B will also start coverage of them self.  This could be fix by
>> using a per-thread environment and merging this environment in
>> functions in 'elbepack/shellhelper.py' and ensuring that all recursive
>> call to Elbe use these functions.
>
> its ok if coverage is per process.
> Even if we are testing parallel builds, we want to know, how much our
> test covered.
>
> would that make things simpler ?

Yeah it would indeed!  If the daemon is the top process, then all build
can automatically have coverage activate (I think) and we could have
> something like /var/cache/elbe/.coverage

> i mean it would suffice, if there was a global initvm coverage flag.
> if an initvm is intended to be used in testing. We could just activate
> it / and restart the daemon.

Indeed.

> Because this does not seem to create a coverage report for the
> init/startup code of the deamon, although its also tested. 

No it doesn't unfortunately.

-- 
Olivier Dion
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen


More information about the elbe-devel mailing list