Debian Bug report logs - #692282
[new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control

version graph

Package: lintian; Maintainer for lintian is Debian Lintian Maintainers <lintian-maint@debian.org>; Source for lintian is src:lintian.

Reported by: Stefano Zacchiroli <zack@debian.org>

Date: Sun, 4 Nov 2012 17:03:02 UTC

Severity: wishlist

Tags: patch

Found in versions lintian/2.5.10.2, lintian/2.5.11

Fixed in version lintian/2.5.12

Done: Niels Thykier <niels@thykier.net>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, autopkgtest-devel@lists.alioth.debian.org, debian-qa@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Sun, 04 Nov 2012 17:03:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefano Zacchiroli <zack@debian.org>:
New Bug report received and forwarded. Copy sent to autopkgtest-devel@lists.alioth.debian.org, debian-qa@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>. (Sun, 04 Nov 2012 17:03:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Stefano Zacchiroli <zack@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Sun, 04 Nov 2012 18:00:13 +0100
[Message part 1 (text/plain, inline)]
Package: lintian
Version: 2.5.10.2
Severity: wishlist

[ context is https://lists.debian.org/debian-qa/2012/11/msg00009.html where we
  are discussing the integration of autopkgtest runs with the new
  jenkins.debian.net service ]

For discoverability, packages shipping tests for the autopkgtest testing
framework [1] should declare their presence using an "XS-Testsuite:
autopkgtest" header in debian/control (see last section of [2]).

At present, only 3 packages in sid/main have that header [3], whereas 68
packages have a debian/tests/control file [4].

Can you please add a lintian test that will warn if a debian/tests/control file
exists, but no "XS-Testsuite: autopkgtest" header is present in the source
stanza of debian/control ?

I'll propose a wishlist mass-bug-filing to fix the packages already in the
archive, but the test would be nice to both avoid the problem in the future,
and more easily quantify its presence in the archive.


Thanks for maintaining lintian!
Cheers.


[1]: http://packages.qa.debian.org/a/autopkgtest.html
[2]: http://anonscm.debian.org/gitweb/?p=autopkgtest/autopkgtest.git;a=blob_plain;f=doc/README.package-tests;hb=HEAD
[3]: see attached autopkgtest-list.header.txt , obtained starting from
     $ wget -q http://http.debian.net/debian/dists/unstable/main/source/Sources.bz2 -O- | bunzip2 -c | grep-dctrl -s Package -F Testsuite autopkgtest -
[4]: see attached autopkgtest-list.content.txt , obtained starting from
     $ wget -q http://http.debian.net/debian/dists/unstable/main/Contents-source.gz -O- | zgrep -m1 -E '^debian/tests/control\s'

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lintian depends on:
ii  binutils                       2.22-7.1
ii  bzip2                          1.0.6-4
ii  diffstat                       1.55-3
ii  file                           5.11-2
ii  gettext                        0.18.1.1-9
ii  hardening-includes             2.2
ii  intltool-debian                0.35.0+20060710.1
ii  libapt-pkg-perl                0.1.26+b1
ii  libarchive-zip-perl            1.30-6
ii  libc-bin                       2.13-36
ii  libclass-accessor-perl         0.34-1
ii  libclone-perl                  0.31-1+b2
ii  libdpkg-perl                   1.16.9
ii  libemail-valid-perl            0.190-1
ii  libipc-run-perl                0.92-1
ii  libparse-debianchangelog-perl  1.2.0-1
ii  libtimedate-perl               1.2000-1
ii  liburi-perl                    1.60-1
ii  locales                        2.13-36
ii  locales-all [locales]          2.13-36
ii  man-db                         2.6.3-1
ii  patchutils                     0.3.2-1.1
ii  perl [libdigest-sha-perl]      5.14.2-14

lintian recommends no packages.

Versions of packages lintian suggests:
pn  binutils-multiarch     <none>
ii  dpkg-dev               1.16.9
ii  libhtml-parser-perl    3.69-2
pn  libperlio-gzip-perl    <none>
ii  libtext-template-perl  1.45-2
ii  man-db                 2.6.3-1
ii  xz-utils [lzma]        5.1.1alpha+20120614-1

-- no debconf information
[autopkgtest-list.header.txt (text/plain, attachment)]
[autopkgtest-list.content.txt (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Fri, 23 Nov 2012 22:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Boulenguez <nicolas@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Lintian Maintainers <lintian-maint@debian.org>. (Fri, 23 Nov 2012 22:45:03 GMT) Full text and rfc822 format available.

Message #10 received at 692282@bugs.debian.org (full text, mbox):

From: Nicolas Boulenguez <nicolas@debian.org>
To: Debian Bug Tracking System <692282@bugs.debian.org>
Subject: Re: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Fri, 23 Nov 2012 23:42:35 +0100
[Message part 1 (text/plain, inline)]
Package: lintian
Version: 2.5.10.2
Tags: patch
Followup-For: Bug #692282

Please consider the attached patch.
[lintian.diff (text/x-diff, attachment)]

Added tag(s) patch. Request was from Stefano Zacchiroli <zack@debian.org> to control@bugs.debian.org. (Mon, 07 Jan 2013 10:30:04 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Mon, 07 Jan 2013 16:00:04 GMT) Full text and rfc822 format available.

Message #15 received at 692282@bugs.debian.org (full text, mbox):

From: Christoph Berg <myon@debian.org>
To: Stefano Zacchiroli <zack@debian.org>, 692282@bugs.debian.org
Subject: Re: Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Mon, 7 Jan 2013 16:57:57 +0100
Re: Stefano Zacchiroli 2012-11-04 <20121104170013.30086.35818.reportbug@usha.takhisis.invalid>
> Can you please add a lintian test that will warn if a debian/tests/control file
> exists, but no "XS-Testsuite: autopkgtest" header is present in the source
> stanza of debian/control ?

And of course, the generic warning about unknown fields should be
dropped:

W: pgbouncer source: unknown-field-in-dsc testsuite

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Mon, 07 Jan 2013 16:06:06 GMT) Full text and rfc822 format available.

Message #18 received at 692282@bugs.debian.org (full text, mbox):

From: Christoph Berg <myon@debian.org>
To: Stefano Zacchiroli <zack@debian.org>, 692282@bugs.debian.org
Subject: Re: Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Mon, 7 Jan 2013 17:05:10 +0100
Re: To Stefano Zacchiroli 2013-01-07 <20130107155757.GA28981@msgid.df7cb.de>
> Re: Stefano Zacchiroli 2012-11-04 <20121104170013.30086.35818.reportbug@usha.takhisis.invalid>
> > Can you please add a lintian test that will warn if a debian/tests/control file
> > exists, but no "XS-Testsuite: autopkgtest" header is present in the source
> > stanza of debian/control ?
> 
> And of course, the generic warning about unknown fields should be
> dropped:
> 
> W: pgbouncer source: unknown-field-in-dsc testsuite

Another thought: There should still be a warning if the value of the
field isn't "autopkgtest".

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Mon, 07 Jan 2013 16:30:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Niels Thykier <niels@thykier.net>:
Extra info received and forwarded to list. Copy sent to Debian Lintian Maintainers <lintian-maint@debian.org>. (Mon, 07 Jan 2013 16:30:03 GMT) Full text and rfc822 format available.

Message #23 received at 692282@bugs.debian.org (full text, mbox):

From: Niels Thykier <niels@thykier.net>
To: Nicolas Boulenguez <nicolas@debian.org>, 692282@bugs.debian.org, Stefano Zacchiroli <zack@debian.org>, Christoph Berg <myon@debian.org>
Subject: Re: Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Mon, 07 Jan 2013 17:27:26 +0100
On 2012-11-23 23:42, Nicolas Boulenguez wrote:
> Package: lintian
> Version: 2.5.10.2
> Tags: patch
> Followup-For: Bug #692282
> 
> Please consider the attached patch.
> 

Hi,

Thanks for looking at writing at a patch and sorry for the delay in
getting back to you.

I hope I can convince you to do a couple of minor changes to your
original patch.  As Christoph mentioned, the value of the header should
be "autopkgtest".
  Secondly, it would probably be a good idea to move this to
checks/fields and use "$info->field ('testsuite')" instead of
"$info->source_field ('xs-testsuite')"[1].  Note that checks/fields is
also applied to binary packages, so a "if ($type eq 'source')" is needed.

> 
> lintian.diff
> 
> 
> diff -rNu ../old/lintian-2.5.10.2/checks/control-file ./checks/control-file
> --- ../old/lintian-2.5.10.2/checks/control-file	2012-09-17 11:56:05.000000000 +0200
> +++ ./checks/control-file	2012-11-23 23:31:07.000000000 +0100
> @@ -265,6 +265,10 @@
>      }
>  }
>  
> +if (defined $info->source_field ('xs-testsuite')
> +    xor -e $info->debfiles('tests/control')) {
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This has a minor issue in that tests or tests/control could be a symlink
pointing to some "system" file, which could be used to disclose the
existance of a given file on the system running Lintian.

> +    tag 'inconsistent-xs-testsuite-field'; }
> +
>  }
>  
>  
> diff -rNu ../old/lintian-2.5.10.2/checks/control-file.desc ./checks/control-file.desc
> --- ../old/lintian-2.5.10.2/checks/control-file.desc	2012-09-17 11:56:05.000000000 +0200
> +++ ./checks/control-file.desc	2012-11-23 22:13:12.000000000 +0100
> @@ -200,3 +200,15 @@
>  Info: The control file contains commented-out VCS-* lines, most
>   probably a result of dh_make. These URLs should either be valid and
>   uncommented, or removed.
> +
> +Tag: inconsistent-xs-testsuite-field
> +Severity: wishlist
> +Certainty: certain
> +Ref: http://anonscm.debian.org/gitweb/?p=autopkgtest/autopkgtest.git;a=blob_plain;f=doc/README.package-tests;hb=HEAD
> +Info: A debian/tests/control file exists, but no "XS-Testsuite: autopkgtest"
> + header is present in the source stanza of debian/control, or the header
> + exists but not the file.
> + .
> + For discoverability, packages shipping tests for the autopkgtest
> + testing framework should declare their presence using an
> + "XS-Testsuite: autopkgtest" header in debian/control.

A good description, though assuming the migration to $info->field the
tag name should probably change and the description would need a few
minor adjustments (s/XS-// s,debian/control,.dsc file, etc.)

The alternative to moving this to checks/fields could be to make a
dedicated "testsuite"-check, that would also do checking of the tests
control file(s).

~Niels

[1] Rationale for:
 * using $info->field ('testsuite')
   - It tests the field in the .dsc file rather than the d/control.  If
     this field is added automatically by some tool (e.g. dpkg-source)
     in the future, the check will still produce the right result
 * moving it to checks/fields
   - It is where most of our checks for .dsc fields are.



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Sun, 20 Jan 2013 10:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Boulenguez <nicolas@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Lintian Maintainers <lintian-maint@debian.org>. (Sun, 20 Jan 2013 10:42:02 GMT) Full text and rfc822 format available.

Message #28 received at 692282@bugs.debian.org (full text, mbox):

From: Nicolas Boulenguez <nicolas@debian.org>
To: Debian Bug Tracking System <692282@bugs.debian.org>
Subject: Re: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Sun, 20 Jan 2013 11:39:20 +0100
[Message part 1 (text/plain, inline)]
Package: lintian
Version: 2.5.11
Followup-For: Bug #692282

Happy new year, and thanks for your advices. Here is a new attempt.

Adding the Testsuite field in data/common/source-fields causes the
generated "profiles/debian/main.profile" to change during build. It
should either be updated in the VCS/source package/whatever at the
same time, or excluded from lintian source package.

The debian-tests-control-is-not-a-regular-file tag lacks a reference,
as the current autopkgtest specification does not force the control
file to be a regular file. Any hint about this issue?

No check of debian/tests/control contents is done but a trivial one to
ensure that other ones may eventually be added.
[lintian_testsuite_2.diff (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Sun, 20 Jan 2013 11:54:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Niels Thykier <niels@thykier.net>:
Extra info received and forwarded to list. Copy sent to Debian Lintian Maintainers <lintian-maint@debian.org>. (Sun, 20 Jan 2013 11:54:06 GMT) Full text and rfc822 format available.

Message #33 received at 692282@bugs.debian.org (full text, mbox):

From: Niels Thykier <niels@thykier.net>
To: Nicolas Boulenguez <nicolas@debian.org>, 692282@bugs.debian.org
Subject: Re: Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Sun, 20 Jan 2013 12:51:13 +0100
On 2013-01-20 11:39, Nicolas Boulenguez wrote:
> Package: lintian
> Version: 2.5.11
> Followup-For: Bug #692282
> 
> Happy new year, and thanks for your advices. Here is a new attempt.
> 

Hi,

Thanks for looking into this.

> Adding the Testsuite field in data/common/source-fields causes the
> generated "profiles/debian/main.profile" to change during build. It
> should either be updated in the VCS/source package/whatever at the
> same time, or excluded from lintian source package.
> 

Actually, it is the addition of the new check that changes the profile.
 But it will only happen "once" (unless you try to undo the change).  It
is how we ensure that the profiles are up to date.

> The debian-tests-control-is-not-a-regular-file tag lacks a reference,
> as the current autopkgtest specification does not force the control
> file to be a regular file. Any hint about this issue?
> 

We also have tags like "control-file-is-not-a-file" without a reference.
 But I guess it is a question of whether that control file is allowed to
be a symlink.

> No check of debian/tests/control contents is done but a trivial one to
> ensure that other ones may eventually be added.
> 

Good :)

> 
> diff --git a/checks/testsuite b/checks/testsuite
> new file mode 100644
> index 0000000..25f3e3d
> --- /dev/null
> +++ b/checks/testsuite
> @@ -0,0 +1,40 @@
> +# testsuite -- lintian check script -*- perl -*-
> +

Can you please add a copyright/license comment here?

> +package Lintian::testsuite;
> +
> +use strict;
> +use warnings;
> +
> +use Lintian::Tags qw(tag);
> +use Lintian::Util qw(fail file_is_encoded_in_non_utf8);
> +
> +sub run {
> +    my ($pkg, $type, $info) = @_;
> +    if ($type ne 'source') {
> +        fail ('Testsuite check called for binary package.');
> +    }

I would probably leave that if-statement out.  A lot of things will fail
if checks will be called by the wrong type.

> +
> +    my $testsuite = $info->field ('testsuite');
> +    my $control = $info->index ('debian/tests/control');
> +
> +    if (defined $testsuite xor defined $control) {
> +        tag ('inconsistent-testsuite-field');

Style-wise, I prefer not using () with tag.  There might be a little bit
of inconsistency here, but I believe the most common use of "tag" is
without ().

> +    }
> +    if (defined $testsuite and $testsuite ne 'autopkgtest') {
> +        tag ('unknown-testsuite', $testsuite);
> +    }
> +    if (defined $control) {
> +        if (not ($info->index ('debian/tests')->is_dir and $control->is_regular_file)) {
                                               ^
directories must have a trailing "/" (i.e. 'debian/tests/').  Though, if
'debian/tests/control' is present, then 'debian/tests/' must be a directory.

> +            tag ('debian-tests-control-is-not-a-regular-file');
> +        } else {
> +            my $path = $info->unpacked ($control->name);
> +
> +            my $not_utf8_line = file_is_encoded_in_non_utf8 ($path, $type, $pkg);
> +            if ($not_utf8_line) {
> +                tag ('debian-tests-control-uses-obsolete-national-encoding', "at line $not_utf8_line");

I think "obsolete" suggests that national encoding was once allowed, so
I would probably go without the "obsolete" word in the tag name.

> +            }
> +        }
> +    }
> +}
> +
> +1;
> diff --git a/checks/testsuite.desc b/checks/testsuite.desc
> new file mode 100644
> index 0000000..243a4b8
> --- /dev/null
> +++ b/checks/testsuite.desc
> @@ -0,0 +1,42 @@
> +Check-Script: testsuite
  +Author: Nicolas Boulenguez <nicolas@debian.org>

:)

> +Type: source
> +Needs-Info: index, unpacked
> +Info: This script checks the Testsuite field in package dsc files,
> + and debian/tests/control if any.
> +
> +Tag: debian-tests-control-is-not-a-regular-file
> +Severity: wishlist
> +Certainty: certain
> +Info: In case the dsc file contains a Testsuite field, "debian/tests"
> + must be a directory and contain a "control" regular file.
> +# TODO: document this and add a reference here?
> +
> +Tag: debian-tests-control-uses-obsolete-national-encoding
> +Severity: normal
> +Certainty: certain
> +Info: The debian/tests/control file should be valid UTF-8, an encoding
> + of the Unicode character set.
> + .
> + There are many ways to convert a file from an obsoleted encoding like
> + ISO-8859-1; you may for example use "iconv" like:
> + .
> +  $ iconv -f ISO-8859-1 -t UTF-8 file &gt; file.new
> +  $ mv file.new file

Also here I would drop the obsolete(d)

> +
> +Tag: inconsistent-testsuite-field
> +Severity: wishlist
> +Certainty: certain
> +Info: The package provides a debian/tests/control file but no
> + Testsuite field in the dsc file, or the field exists but not the
> + file.
> + .
> + For discoverability, packages shipping tests for the autopkgtest
> + testing framework should declare their presence in the package
> + description file.
> +Ref: http://anonscm.debian.org/gitweb/?p=autopkgtest/autopkgtest.git;a=blob_plain;f=doc/README.package-tests;hb=HEAD
> +

s/package description file/dsc file/ ?  Also, it might be a good idea to
remind people that this can be done by adding
 "XS-Testsuite: autopkgtest"

To their d/control file.

> +Tag: unknown-testsuite
> +Severity: normal
> +Certainty: certain
> +Info: Testsuite field in dsc file has a value other than autopkgtest.
> +Ref: http://anonscm.debian.org/gitweb/?p=autopkgtest/autopkgtest.git;a=blob_plain;f=doc/README.package-tests;hb=HEAD

Maybe "The Testsuite field..." ?

> [...]


Once again, thanks for doing this!  It is most appreciated. :)

~Niels




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Sun, 20 Jan 2013 23:51:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Boulenguez <nicolas@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Lintian Maintainers <lintian-maint@debian.org>. (Sun, 20 Jan 2013 23:51:03 GMT) Full text and rfc822 format available.

Message #38 received at 692282@bugs.debian.org (full text, mbox):

From: Nicolas Boulenguez <nicolas@debian.org>
To: Debian Bug Tracking System <692282@bugs.debian.org>
Subject: Re: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Mon, 21 Jan 2013 00:46:24 +0100
[Message part 1 (text/plain, inline)]
Package: lintian
Followup-For: Bug #692282

> > if (not ($info->index ('debian/tests')->is_dir and $control->is_regular_file)) {

> directories must have a trailing "/" (i.e. 'debian/tests/').

Not sure to understand what you mean by "must".
On my machine, "$info->index ('debian/tests')->is_dir" returns true
when the directory exists, as I expected from the documentation.
[lintian_testsuite_2_to_3.diff (text/x-diff, attachment)]
[lintian_testsuite_3.diff (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Tue, 22 Jan 2013 11:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Niels Thykier <niels@thykier.net>:
Extra info received and forwarded to list. Copy sent to Debian Lintian Maintainers <lintian-maint@debian.org>. (Tue, 22 Jan 2013 11:15:03 GMT) Full text and rfc822 format available.

Message #43 received at 692282@bugs.debian.org (full text, mbox):

From: Niels Thykier <niels@thykier.net>
To: Nicolas Boulenguez <nicolas@debian.org>, 692282@bugs.debian.org
Subject: Re: Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Tue, 22 Jan 2013 12:11:05 +0100
Control: tags -1 pending

On 2013-01-21 00:46, Nicolas Boulenguez wrote:
> Package: lintian
> Followup-For: Bug #692282
> 
>>> > > if (not ($info->index ('debian/tests')->is_dir and $control->is_regular_file)) {
>> > directories must have a trailing "/" (i.e. 'debian/tests/').
> Not sure to understand what you mean by "must".
> On my machine, "$info->index ('debian/tests')->is_dir" returns true
> when the directory exists, as I expected from the documentation.
> 
> 
> [...]


Caused by a double mistake actually.  First, the documentation was not
clear in this point and secondly, the index code for souce packages did
not add the trailing slash as expected.  Both should be fixed now with
commits:

 * 0e9631839fe574d38826392c59850c0dc58300aa
 * 6dde19562b1283446da55469d0af34ae9658731f
 * 38df05466e28ab6d08ef2e8f822f9bc570844b2e

Anyway, merged your patch as 4fab7f84ba8d17f91f9e79a00a6b6e7272608e99
with some tests to go with it.

In case you are interested in extending the check, possible additional
checks could include checks for "syntax errors"/unparseable control file
(checks/source-copyright has a similar code piece for that).  Check that
all paragraphs have a "Tests" field.  Or even check that all the
restrictions are known.

Thanks for the check,
~Niels




Added tag(s) pending. Request was from Niels Thykier <niels@thykier.net> to 692282-submit@bugs.debian.org. (Tue, 22 Jan 2013 11:15:03 GMT) Full text and rfc822 format available.

Information stored :
Bug#692282; Package lintian. (Tue, 22 Jan 2013 11:54:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefano Zacchiroli <zack@debian.org>:
Extra info received and filed, but not forwarded. (Tue, 22 Jan 2013 11:54:05 GMT) Full text and rfc822 format available.

Message #50 received at 692282-quiet@bugs.debian.org (full text, mbox):

From: Stefano Zacchiroli <zack@debian.org>
To: Niels Thykier <niels@thykier.net>, 692282-quiet@bugs.debian.org
Cc: Nicolas Boulenguez <nicolas@debian.org>
Subject: Re: Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Tue, 22 Jan 2013 12:51:40 +0100
On Tue, Jan 22, 2013 at 12:11:05PM +0100, Niels Thykier wrote:
> Anyway, merged your patch as 4fab7f84ba8d17f91f9e79a00a6b6e7272608e99
> with some tests to go with it.

Thanks to both of you for this!

All the best,
-- 
Stefano Zacchiroli  . . . . . . .  zack@upsilon.cc . . . . o . . . o . o
Maître de conférences . . . . . http://upsilon.cc/zack . . . o . . . o o
Debian Project Leader . . . . . . @zack on identi.ca . . o o o . . . o .
« the first rule of tautology club is the first rule of tautology club »



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Fri, 25 Jan 2013 19:48:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Boulenguez <nicolas@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Lintian Maintainers <lintian-maint@debian.org>. (Fri, 25 Jan 2013 19:48:03 GMT) Full text and rfc822 format available.

Message #55 received at 692282@bugs.debian.org (full text, mbox):

From: Nicolas Boulenguez <nicolas@debian.org>
To: Debian Bug Tracking System <692282@bugs.debian.org>
Subject: Re: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Fri, 25 Jan 2013 20:46:16 +0100
[Message part 1 (text/plain, inline)]
Package: lintian
Followup-For: Bug #692282

> Checks for "syntax errors"/unparseable control file. Check that all
> paragraphs have a "Tests" field. Or even check that all the
> restrictions are known.

Here is a suggestion for review.
[testsuite-4.diff (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Fri, 08 Feb 2013 11:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Niels Thykier <niels@thykier.net>:
Extra info received and forwarded to list. Copy sent to Debian Lintian Maintainers <lintian-maint@debian.org>. (Fri, 08 Feb 2013 11:21:03 GMT) Full text and rfc822 format available.

Message #60 received at 692282@bugs.debian.org (full text, mbox):

From: Niels Thykier <niels@thykier.net>
To: Nicolas Boulenguez <nicolas@debian.org>, 692282@bugs.debian.org
Subject: Re: Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Fri, 08 Feb 2013 12:17:57 +0100
[Message part 1 (text/plain, inline)]
On 2013-01-25 20:46, Nicolas Boulenguez wrote:
> Package: lintian
> Followup-For: Bug #692282
> 
>> Checks for "syntax errors"/unparseable control file. Check that all
>> paragraphs have a "Tests" field. Or even check that all the
>> restrictions are known.
> 
> Here is a suggestion for review.

Hi,

Thanks for the code.  I have attached a small diff for some stylistic
things (note the test .desc changes also prevents a "synopsis not
phrased properly tag").

Secondly, one of the "testsuite"-tests fails with your changes.  Please
see test.log.

~Niels

[my-changes.diff (text/html, attachment)]
[test.log (text/x-log, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Fri, 08 Feb 2013 17:18:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Boulenguez <nicolas@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Lintian Maintainers <lintian-maint@debian.org>. (Fri, 08 Feb 2013 17:18:03 GMT) Full text and rfc822 format available.

Message #65 received at 692282@bugs.debian.org (full text, mbox):

From: Nicolas Boulenguez <nicolas@debian.org>
To: 692282@bugs.debian.org, Niels Thykier <niels@thykier.net>
Subject: Re: Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Fri, 8 Feb 2013 18:13:50 +0100
[Message part 1 (text/plain, inline)]
> Please see test.log.

Sorry, I did not detect these problems because I test with 2.5.11 and
--root option.

Three pedantic messages were not reported, I copied similar options
from another test to "t/tests/testsuite-general/desc" to unmask them.

Path "debian/tests/fifo" is reported missing instead of non regular. I
guess that it will be created once
"t/tests/testsuite-general/pre_build" is marked executable.

But I fail to understand the third problem.
File "t/tests/testsuite-general/debian/debian/tests/control"
contains the line "Tests: fifo missing-test under_score"
and script "checks/testsuite"
reads it with "for (split ' ', $paragraph->{'tests'})"
so "under_score" should be checked after "fifo" and "missing-test".
The execution order is correct on my machine, but no in your test.log.
Any clue?
[fifoexe_pedantic.diff (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Lintian Maintainers <lintian-maint@debian.org>:
Bug#692282; Package lintian. (Tue, 12 Feb 2013 21:18:24 GMT) Full text and rfc822 format available.

Acknowledgement sent to Niels Thykier <niels@thykier.net>:
Extra info received and forwarded to list. Copy sent to Debian Lintian Maintainers <lintian-maint@debian.org>. (Tue, 12 Feb 2013 21:18:24 GMT) Full text and rfc822 format available.

Message #70 received at 692282@bugs.debian.org (full text, mbox):

From: Niels Thykier <niels@thykier.net>
To: Nicolas Boulenguez <nicolas@debian.org>, 692282@bugs.debian.org
Subject: Re: Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Tue, 12 Feb 2013 22:16:39 +0100
[Message part 1 (text/plain, inline)]
On 2013-02-08 18:13, Nicolas Boulenguez wrote:
>I wrote at some point:
>> Thanks for the code.  I have attached a small diff for some
>> stylistic things (note the test .desc changes also prevents a
>> "synopsis not phrased properly tag").

For the record, the "my-changes.diff" was intended to be an interdiff
between your changes and the 4-5 lines changes I did (instead of yours
plus mine).  I have attached "my-real-changes.diff" in case you are
interested.

>> Please see test.log.
> 
> Sorry, I did not detect these problems because I test with 2.5.11 and
> --root option.
> 

It might be help to use Lintian test runner itself to run the test.
Example:

  debian/rules runtests onlyrun=testsuite-control-syntax

Only runs tests named "testsuite-control-syntax" (I believe we only have
one atm.)  You can also use

  debian/rules runtests onlyrun=testsuite

to run all tests "related" to the check "testsuite"[1].

> Three pedantic messages were not reported, I copied similar options
> from another test to "t/tests/testsuite-general/desc" to unmask them.
> 
> Path "debian/tests/fifo" is reported missing instead of non regular. I
> guess that it will be created once
> "t/tests/testsuite-general/pre_build" is marked executable.
> 

Thanks.

> But I fail to understand the third problem.
> File "t/tests/testsuite-general/debian/debian/tests/control"
> contains the line "Tests: fifo missing-test under_score"
> and script "checks/testsuite"
> reads it with "for (split ' ', $paragraph->{'tests'})"
> so "under_score" should be checked after "fifo" and "missing-test".
> The execution order is correct on my machine, but no in your test.log.
> Any clue?

The test runner sorts the output by default as it makes the tests more
robust (otherwise even simple reordering or refactoring would make a
mess of the testsuite).  So, the last issue is that the tags file must
be sorted as well.  I took the liberty of fixing that.  :)

Committed and pushed your addition as 386b337.

Thank you for your contribution, :)
~Niels

[1] "Related" being starting with "testsuite-".

[my-real-changes.diff (text/html, attachment)]

Reply sent to Niels Thykier <niels@thykier.net>:
You have taken responsibility. (Sun, 28 Jul 2013 07:15:09 GMT) Full text and rfc822 format available.

Notification sent to Stefano Zacchiroli <zack@debian.org>:
Bug acknowledged by developer. (Sun, 28 Jul 2013 07:15:10 GMT) Full text and rfc822 format available.

Message #75 received at 692282-done@bugs.debian.org (full text, mbox):

From: Niels Thykier <niels@thykier.net>
To: 692282-done@bugs.debian.org
Cc: Nicolas Boulenguez <nicolas@debian.org>
Subject: Re: Bug#692282: [new check] debian/tests/control but not (XS-)Testsuite: autopkgtest header in debian/control
Date: Sun, 28 Jul 2013 09:10:40 +0200
Source: lintian
Source-Version: 2.5.12

On 2013-02-12 22:16, Niels Thykier wrote:
> [...]
> 
> Committed and pushed your addition as 386b337.
> 
> Thank you for your contribution, :)
> ~Niels
> 
> [1] "Related" being starting with "testsuite-".
> 

I believe all the patches here are committed and I just forgot to close
this bug in the 2.5.12 upload.  Should I be wrong, please let me know so
the oversight can be rectified.

~Niels





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 25 Aug 2013 07:30:51 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 17 00:30:56 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.