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

Torben Hohn torben.hohn at linutronix.de
Wed Sep 2 12:48:10 CEST 2020


On Thu, Aug 20, 2020 at 12:21:16PM -0400, Olivier Dion wrote:
> 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 ?
> >
> > 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.
> 
> I'm not sure however how do we want to restart the initvm with coverage
> enable.  Since there's a context manager that wrap all of Elbe, we could
> add 'ELBE_COVERAGE' to /etc/default/elbe-daemon then issue a 'systemd
> restart elbe-daemon' using SSH.  This could be changed when using docker
> by making the base image having ELBE_COVERAGE already in the daemon
> environment.
> 
> What do you think?

I would like to have an elbe control command to enable coverage.
And also disable it again.

The enable command shall restart the daemon. Its not a problem,
if that results in errors like the initvm_shutdown command.

Disabling shall also restart the daemon, but we need to download the
coverage somehow. 


> 
> -- 
> Olivier Dion
> Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner


More information about the elbe-devel mailing list