Bug 1385280

Summary: perl-App-Cmd contains a lot of test files which should not be installed.
Product: [Fedora] Fedora Reporter: Van de Bugger <van.de.bugger>
Component: perl-App-CmdAssignee: Emmanuel Seyman <emmanuel>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: emmanuel, perl-devel, ppisar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: perl-App-Cmd-0.330-3.fc24 perl-App-Cmd-0.331-2.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-24 20:23:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Van de Bugger 2016-10-15 20:58:22 UTC
Description of problem:

perl-App-Cmd rpm package contains a lot of test files which should NOT be installed.

Version-Release number of selected component (if applicable):

perl-App-Cmd-0.330-2.fc24.noarch

How reproducible:

Always.

Steps to Reproduce:
1. dnf download perl-App-Cmd
2. rpm -ql -p ./perl-App-Cmd-0.330-2.fc24.noarch.rpm | grep /t/

Actual results:

/usr/share/doc/perl-App-Cmd/t/00-load.t
/usr/share/doc/perl-App-Cmd/t/00-report-prereqs.dd
/usr/share/doc/perl-App-Cmd/t/00-report-prereqs.t
...(lot more test files)...

Expected results:

(empty output)

Additional info:

Many Perl distributions (they call it "distribution" because term "package" is used for a Perl language construct) contain tests. Perl distribution installer unpacks distribution, run tests, and installs Perl modules to the user system. Tests are NOT installed.

perl-App-Cmd rpm package contains a lot of tests, which are installed to the /usr/share/doc/perl-App-Cmd/ directory. This is a bug. Tests are NOT documentation, and so, should NOT be installed into /usr/share/doc/. Moreover, tests should NOT be included into rpm at all, since rpm does not run them before installing the modules.

Comment 1 Van de Bugger 2016-10-15 21:02:57 UTC
BTW, on my system there are 386 directories /usr/share/doc/perl-*, and only 26 /usr/share/doc/perl-*/t/ directories:

$ ls -1 -d perl-*/t 
perl-App-Cmd/t
perl-B-Hooks-EndOfScope/t
perl-B-Hooks-OP-Check/t
perl-Business-ISBN-Data/t
perl-Class-Method-Modifiers/t
perl-common-sense/t
perl-CPAN-Meta/t
perl-Data-OptList/t
perl-Devel-GlobalDestruction/t
perl-Devel-LexAlias/t
perl-Devel-Size/t
perl-HTML-Tidy/t
perl-Moose/t
perl-MooseX-ConfigFromFile/t
perl-MooseX-Getopt/t
perl-MooseX-Role-Parameterized/t
perl-MooseX-StrictConstructor/t
perl-MooseX-Types-Path-Class/t
perl-MooseX-Types/t
perl-MRO-Compat/t
perl-namespace-clean/t
perl-Scope-Guard/t
perl-Sub-Exporter/t
perl-Sub-Identify/t
perl-Test-Simple/t
perl-Try-Tiny/t

Comment 2 Fedora Update System 2016-10-16 23:52:52 UTC
perl-App-Cmd-0.330-3.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-49887ecd61

Comment 3 Fedora Update System 2016-10-17 00:52:18 UTC
perl-App-Cmd-0.331-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-c5a776d731

Comment 4 Van de Bugger 2016-10-17 19:21:16 UTC
perl-App-Cmd-0.330-3.fc24 works for me. What about other 25 packages?

Comment 5 Emmanuel Seyman 2016-10-17 21:48:29 UTC
(In reply to Van de Bugger from comment #4)
>
> What about other 25 packages?

You'll have to file bugs.

Comment 6 Van de Bugger 2016-10-19 07:25:05 UTC
> You'll have to file bugs.

25 bugs? It's ridiculous.

Comment 7 Petr Pisar 2016-10-19 07:43:56 UTC
It's ridiculous generalizing all the tests are not worth of documentation. Have studied each of the packages? Sometimes the tests are the only available useful documentation. Each package must be considered specially, therefore a bug report for each of them.

Moreover from logistic point of view, not all of them are maintained by Emanuel. Their maintainers are not aware of your concerns. The right way in Fedora is to file a bug report for each of them.

Comment 8 Emmanuel Seyman 2016-10-19 12:19:35 UTC
(In reply to Van de Bugger from comment #6)
> 
> 25 bugs? It's ridiculous.

Note that that's what on your system. I'm sure there are more packages affected.

I plan to evaluate the need to remove tests on a case by case basis. While perl-App-Cmd's documentation is good enough that it is not necessary to include  the tests as examples of use of the module, I can't guarantee that all modules 
are like this.

It would help if you explained why you feel this is a bug. Is there an inconvenience to having the t/ directory ship in the documentation? Do they take up too much disk space? Do they drag in otherwise-unneeded deps?

Comment 9 Van de Bugger 2016-10-22 20:54:27 UTC
> It's ridiculous generalizing all the tests are not worth of documentation. 

They are tests, not examples.

> It would help if you explained why you feel this is a bug.

It is my feeling.

I already said that tests are part of Perl distribution. Perl distribution installer (either cpan, cpanp, or cpanm), unpacks distribution archive, builds the module (if there are parts written in C), run tests (optionally send reports), and installs the module to the system. Tests are *not* installed. They remain in the temporary directory, which is usually removed soon. (I have large local Perl library installed directly from CPAN, it contains ~1500 *.pm files and *no* *single* *.t file.)

RPM package contains prebuilt and "pretested" software. Packed software was built and tested when RPM itself was building. When RPM package is installing to the user system, it just copies files (no source compiling, no testing at all (akmods are exception)). If original Perl distribution does not install tests, why RPM does it?

> Sometimes the tests are the only available useful documentation. 

Anyway, it is not a reason for installing tests. End-users are not interested in tests at all. Developers may be interested, but… Did RPM packager take care about *test dependencies*? Tests may have specific requirements. For a Perl developer having local Perl library (of modules installed directly from CPAN) have many advantages over using RPMs.

> Each package must be considered specially…

Indeed, it would be much better to have a policy. 

Again: If original Perl distribution does not install tests, why RPM does it?

Comment 10 Emmanuel Seyman 2016-10-22 22:03:48 UTC
(In reply to Van de Bugger from comment #9)
> 
> They are tests, not examples.

In practice, they are sometimes the only examples of use of the module.

> If original Perl distribution does not install tests, why RPM does it?

For the same reason we convert files to UTF-8 or apply patches to better integrate the modules in the system: the benefits for our users outweigh
the costs.

> Anyway, it is not a reason for installing tests. End-users are not
> interested in tests at all. Developers may be interested, but… Did RPM
> packager take care about *test dependencies*?

We usually use the macro %{?perl_default_filter} in our spec files which
tells RPM not to use provides and requires from the documentation.

> Indeed, it would be much better to have a policy.

That sounds like a job for FESCo.

Comment 11 Fedora Update System 2016-10-24 20:23:29 UTC
perl-App-Cmd-0.330-3.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2016-10-25 04:28:33 UTC
perl-App-Cmd-0.331-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.