All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fredrik Hugosson <fredrik.hugosson@axis.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: "yocto@yoctoproject.org" <yocto@yoctoproject.org>
Subject: Re: Discussion: Package testing
Date: Mon, 18 Jun 2012 15:04:38 +0200	[thread overview]
Message-ID: <4FDF2766.7000309@axis.com> (raw)
In-Reply-To: <1340019794.8481.10.camel@ted>

On 06/18/2012 01:43 PM, Richard Purdie wrote:
> On Thu, 2012-06-14 at 15:26 +0200, Björn Stenberg wrote:
>> Many source packages include their own package test suites. We are
>> looking at running these tests on target in a structured way, and I
>> would like a discussion about how to best fit this into the Yocto
>> framework.
>>
>> The actions that need to be performed for a package test are roughly:
>>
>> 1) Build the test suite
>> 2) Make the test suite appear on target
>> 3) Run the test suite
>> 4) Parse the results
>>
>> Each action can be done in several ways, and there are different
>> considerations for each solution.
>>
>> 1) Build the test suite
>> -----------------------
>> Many package tests are simply bash scripts that run the packaged
>> binaries in various ways, but often the test suites also include
>> binary tools that are not part of the normal package build. These
>> tools have to be built for package testing to work.
>>
>> Additionally, many packages build and run the test in a single
>> command, such as "make check", which is obviously unsuitable for
>> cross-compiled packages.
>>
>> We can solve this in different ways:
>>
>> a) Run the test build+run jobs on target. This avoids the need to
>> modify packages, but building code on target can get quite expensive
>> in terms of disk space. This in turn means many tests would require a
>> harddisk or network disk to run.
>>
>> b) Patch the makefiles to split test building and test running.
>> Patching makefiles mean we get an additional maintenance and/or
>> upstreaming burden, but we should be able to do this in ways that are
>> acceptable to upstream. This is our suggestion.
>
> There are some good questions here :)

Yes there are!

> I think in general, we should be aiming for b) since that falls well
> into some of the ideas below. Upstreams should be amenable to splitting
> these into two targets (assuming "make check" just runs one after the
> other) so we shouldn't have to carry patches in most cases long term.
>

I think you both might be missing some cases here. The problem is that 
'make check' does not have a standardized meaning.

 From the top of my head, I can think of these different variants:
1) Function test level with testing run on target, package cross-compiled
2) Function test level with testing run on host, package cross-compiled
3) Function test level with testing run on host, package compiled for host
4) Unit test level with testing run on target, package cross-compiled
5) Unit test level with testing run on host, package compiled for host

I think that we need to be able to separate the different uses of 'make 
check' to be able to support testing nicely.

>> 2) Make the test suite appear on target
>> ---------------------------------------
>> The test suite and utilities obviously have to be executable by the
>> target system in order to run. There are a few options for this:
>>
>> a) Copy all test files to the target at test run time, from the build
>> dir, using whatever means available (scp, ftp etc). This limits
>> testing to targets/images with easy automatic file transfer abilities
>> installed.
>>
>> b) NFS mount the build dir to access the full work dir and hence the
>> test code. this limits testing to targets (and images) with network
>> +nfs support. Plus it blends the build env and runtime env in an
>> unpleasant way.
>>
>> c) Create ${PN}-ptest packages (in the model of -dev and -dbg) that
>> contain all test files and add those to the image and hence the
>> rootfs. This is our suggestion.
>
> I like the idea of test packages.

Would be very nice for functional tests, but it will not be so simple 
for unit testing. For unit tests I belive you need some build target 
too, which leads back to the comment above.

It might be a lot of autoconf hacking to get this working, don't know if 
there are any widely accepted standard targets for it.

/Regards
Fredrik Hugosson


  reply	other threads:[~2012-06-18 13:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 13:26 Discussion: Package testing Björn Stenberg
2012-06-14 19:54 ` Frans Meulenbroeks
2012-06-15  8:23   ` Björn Stenberg
2012-06-18 11:43 ` Richard Purdie
2012-06-18 13:04   ` Fredrik Hugosson [this message]
2012-06-18 14:50     ` Björn Stenberg
2012-06-18 15:04   ` Björn Stenberg
2012-06-19 11:24     ` Burton, Ross
2012-06-21  8:50       ` Björn Stenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FDF2766.7000309@axis.com \
    --to=fredrik.hugosson@axis.com \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.