The "right" thing to do is to put it in xt/ without any skips and make sure the release machinery is scripted to make sure xt tests pass before release.
David On Mon, Feb 29, 2016 at 3:14 PM, Olivier Mengué <olivier.men...@gmail.com> wrote: > > The common solution is to NOT add "author-only" tests to TEST_REQUIRES, > but instead to modify your "skip_all" as follows: > > > > unless( ( $ENV{'RELEASE_TESTING'} || $ENV{'AUTHOR_TESTING'} ) && eval > 'use Test::POD; 1;' ) { > > plan skip_all => 'These tests are for authors only.'; > > exit 0; > > } > > It is the right thing to skip POD tests if !$ENV{RELEASE_TESTING} && > !ENV{AUTHOR_TESTING}. > > But it is a bad practice to skip the test if the needed module is missing. > Instead the test should fail if the author lacks the module because if the > test is skipped, there is the risk of publishing a release that was not > properly tested and would have invalid POD. What is the point of writing > tests if they can be silently skipped? > > Olivier. > > 2015-05-22 16:54 GMT+02:00 David Oswald <daosw...@gmail.com>: > >> The common solution is to NOT add "author-only" tests to TEST_REQUIRES, >> but instead to modify your "skip_all" as follows: >> >> unless( ( $ENV{'RELEASE_TESTING'} || $ENV{'AUTHOR_TESTING'} ) && eval >> 'use Test::POD; 1;' ) { >> plan skip_all => 'These tests are for authors only.'; >> exit 0; >> } >> >> Or you could split the ENV testing and the "use" testing into different >> logic paths so that you can give diagnostic messages more appropriate to >> the failure point. In other words, if the ENV isn't set, you can skip with >> a message of "Skipping author tests, set ENV{.....} for author testing.", >> and if the eval fails you can state "Author tests require Test::POD". >> >> >> >> On Thu, May 21, 2015 at 8:07 PM, Alceu R. de Freitas Jr. < >> glasswal...@yahoo.com.br> wrote: >> >>> Since I'm the author of this module, I think I can have a say about >>> that. :-) >>> >>> Meanwhile I agree to remove Test::Pod from PREREQ_PM, I think that >>> loosing the opportunity to test the module if test Test::Pod is indeed >>> available is not interesting. >>> >>> I could use a conditional test to execute the test or not as simple as >>> described in Test::Pod Pod: >>> >>> use Test::More; >>> eval "use Test::Pod 1.00"; >>> plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; >>> all_pod_files_ok(); >>> >>> That should be enough for all cases. >>> >>> My questions are: >>> >>> 1 - Should I declare Test::Pod on TEST_REQUIRES? Documentation is not very >>> clear on how that works if the module is not available. If I think I should >>> require a user to download Test::Pod to run the tests? Yes, I think so. >>> It's a very small price to give a hand to the project (since Test::Pod is >>> not exactly the same thing on installing a large set of modules >>> dependencies as happens with Moose, for example), but I'm open to discuss >>> about it. >>> 2 - Does it matter? I wrote this module years ago when I was on a network >>> that wouldn't allow me to send those tests results, so I'm not sure if this >>> module still works with more recent versions of Microsoft Outlook. Maybe >>> Barbie could have say about that (since it depends mostly on Mail::Outlook)? >>> >>> PS: just checked >>> http://cpansearch.perl.org/src/ARFREITAS/Test-Reporter-Transport-Outlook-0.01/Makefile.PL >>> and this module really needs an update. >>> >>> Cheers, >>> >>> Alceu >>> >>> ------------------------------ >>> *De:* Karen Etheridge via RT < >>> bug-test-reporter-transport-outl...@rt.cpan.org> >>> *Para:* >>> *Enviadas:* Quinta-feira, 21 de Maio de 2015 15:28 >>> *Assunto:* [rt.cpan.org #104607] incorrect case >>> >>> Queue: Test-Reporter-Transport-Outlook >>> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104607 > >>> >>> On 2015-05-21 09:43:17, CHORNY wrote: >>> > depends on Test::POD. Correct is Test::Pod. >>> >>> However, the distribution should not have a dependency on this module at >>> all. Pod tests should not run for normal user installs - either move the >>> test to xt/, or guard it with: >>> >>> plan skip_all => 'These tests are for authors only!' unless >>> $ENV{AUTHOR_TESTING} or $ENV{RELEASE_TESTING}; >>> >>> >>> >> >> >> -- >> >> David Oswald >> daosw...@gmail.com >> > > -- David Golden <x...@xdg.me> Twitter/IRC/Github: @xdg