[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#779559: dpkg-source: Add test dependencies to .dsc

Hello Guillem, Adam, all,

wow, this took a full year to actually implement, sorry for that. Long
plain rides are sometimes useful :-)

Guillem Jover [2015-03-10  5:39 +0100]:
> So given all the above, I'd say:
>   Testsuite-Triggers: foo, bar, baz
> from the union of all testsuites test depends, minus @ and @builddeps@,
> without versions, and with alternatives split (i.e. a simple comma
> separated package list). If the field is present then it overrides the
> automatically extracted value.

The attached patch against current git does that now, plus the
additional "drop binary packages produced by your own source". I'm not
really familiar with the dpkg code nor Perl, so I'm sure you have a
ton of simplifications, style nitpicks, and others.

In set_testsuite_triggers_field() I currently do:

+    return if $fields->{'Testsuite-Triggers'} || $fields->{'XS-Testsuite-Triggers'} ;

But I'm not sure at which point the Xs- prefix disappears, nor when the new
field would become official -- is it necessary to check for it here? Or just
for 'Testsuite-Triggers'?

Conversely, how do I say that the field should only aperar in the
.dsc, not in the .changes? This actually behaves correctly, and I
assume dpkg-genchanges has a whitelist of which fields to include, but
it'd be nice if you could confirm that.

I tested this against the following synthetic d/t/control which I
think covers all cases:

    -------- 8< ------------
    Tests: a
    Depends: @, pmount

    Tests: b
    Depends: gzip,

    Tests: c

    Tests: d
    Depends: foo (>= 4) | bar (<< 5)
    -------- 8< ------------

This gives

    Testsuite-Triggers: bar, blergh-dev, coreutils, foo, pmount

in the .dsc: "gzip" got filtered out, all dependencies flattened and
finally sorted for a predictable/reproducible result.

I also tested it against the autopkgtest source package, a source
package with an explicit "XS-Testsuite-Triggers:" in d/control, and a
package without a test suite.

dpkg with this patch applied still builds and succeeds its tests
(although that doesn't say much as AFAICS dpkg-source.pl itself is not
covered by tests). I installed the built dpkg binaries and re-checked
dpkg-buildpackage -S on the above source packages.

Thanks for considering!

Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dpkg-source-Generate-Testsuite-Triggers-field-from-t.patch
Type: text/x-diff
Size: 4486 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20160501/e613b4f8/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/autopkgtest-devel/attachments/20160501/e613b4f8/attachment.sig>

Reply to: