----- "Kamil Paral" <kparal(a)redhat.com> wrote:
>
> The --arch tag specifies not which packages to test but on which
> machines to run. My fault.
Right, this is pretty confusing, but the --arch argument to autoqa tells autoqa which machines to *schedule tests on*.
> > I have looked at rpmlint test and it simply tests
> > all architectures of a NVR. But is that correct?
> > Because if one architecture is built sooner then the other,
>
> I was told that 'updates-candidate' tag is applies only
> after all architectures were built.
Correct. So the post-koji-build hook operates on a *complete build*, which may include packages of many arches. It launches autoqa and tells it to schedule jobs for each arch included in that build.
This makes sense because a normal functional test (for example: making sure 'ls' works in a new 'coreutils' build) needs to be scheduled and run on an x86_64 machine to check the x86_64 package, and again on i686, and ppc, and so on.
But *some* tests, like rpmlint, can operate on any arch, and check the whole contents of the build. So it would be a waste of time to run the test on more than one arch.
>
> When studying this issue, I don't quite understand current
> wwoods' code:
>
> def process_testlist(opts, args, testlist):
> # XXX TODO we may pull new tests from CVS at this point
> # XXX HACK: only run rpmlint on one single arch, since one test
> will cover
> # the packages for all arches
> if 'x86_64' not in opts.arch and 'rpmlint' in testlist:
> testlist.remove('rpmlint')
> return testlist
>
> Why would that mean that rpmlint is not run multiple times?
> I think when "--arch x86_64 --arch i686" is specified it will
> run on both architectures.
Hm. That seems like a reasonable deduction - if you have both, we won't throw rpmlint out of testlist, and so rpmlint will get scheduled for both arches. Probably we should get rid of that hack altogether and have the control file for rpmlint abort/skip the test if arch is not 'x86_64' - or, in the future, 'noarch' - see below.
> When only "--arch i686" is specified
> rpmlint will not run at all (which is bad).
Hm. You might be right about that.
For noarch packages, watch-koji-build.py substitutes 'x86_64' for 'noarch', so we ensure the test gets run. (Yes, this is another hack, but we didn't have a way to implement 'autoqa --arch noarch' yet. We've got a plan for that now.)
But I think you're right - for a package that *only* had i686, it might not run at all. We could extend the hack in watch-koji-build.py to also substitute 'noarch' for 'src'; this would ensure we always schedule the test for at least one arch.
So as mentioned above, in the future individual tests that are arch-independent (like rpmlint/rpmguard) could do something like exiting the control file early if arch is not 'noarch'. That would ensure that the test only runs once, and then we can remove the hack from process_testlist in post-koji-build/hook.py.
-w