Is this the End for Dist::Zilla??

The last round of test case review here at the Dist-Pen today.

Down to the final few today;

TidyAll

This is the mother of all 'Author' test cases. This little chap wraps the 'Test::Code::TidyAll' case for you which will both tidy test and a validation test on you r code. Like TidyAll you can configure it to a very high degree. For my Database::Accessor project it is a nice to have so I will give it a good try. First you have to spend a half hour or so installing all the little parts of TidyAll, there are about twenty seven plug-ins plus other little bits. The plug-in requires that a config file is present, I just copied this one from CPAN. After getting that file all you need to do is add this to you '.ini' file


[Test::PodSpelling]
++[Test::TidyAll]
[Git::Check] 

and gave it a go with 'dzil xtest author/tidy', note I took out the seven or eight other runs here I needed to get all the little parts of TidyAll on my perl, and this is what I got

xt/author/tidyall.t .. # [checked] t/39_sorts.t
# *** needs tidying
xt/author/tidyall.t .. 1/32
# Failed test 't/39_sorts.t is tidy'
# at xt/author/tidyall.t line 6.
# *** needs tidying

xt/author/tidyall.t .. 30/32 # [checked] lib/Database/Accessor.pm
# perlcritic --profile /home/scolesj/database-accessor/.build/PcFA6wiyJ1/perlcriticrc /tmp/Code-TidyAll-a9Ni/lib/Database/Accessor.pm failed
# exited with 2 - output was:
# Could not parse profile "/home/scolesj/database-accessor/.build/PcFA6wiyJ1/perlcriticrc": Failed to open file '/home/scolesj/database-accessor/.build/PcFA6wiyJ1/perlcriticrc' for reading: No such file or directory

# Failed test 'lib/Database/Accessor.pm is tidy'


Now what you see above is the first test checking to see if the code is nice and tidy on that t/39_sorts.t and later on it tries to do a perlcritic test on lib/Database/Accessor.pm. Now the nice part is that nothing is changed in you files these are just waring tests.

I really see how this would be a very useful item to have in you '.ini' if you have a larger project whith a team of devlopers and you want to enfore a good code standard acroos that team. This case will ensure that everything coming in is in good shape before you release.

As my project is quite small scale right now and I don't normally use TidyAll in my regular so this is not one for me right now.

TrailingSpace

A 'Release' level test that impliments the Test::TrailingSpace test case. Now I already have Dist::Zilla::Plugin::Test::EOL which does the same thing I will just leave this one out.

UnusedVars

Another 'Release' level test that provides the 'Test::Vars' test case. Seems like a good thing to add so in it goes;


[Test::PodSpelling]
++[Test::UnusedVars]
[Git::Check] 

and I gave it a go, after doing the install, with 'dzil xtest release/unu' and I got

xt/release/unused-vars.t .. # Test::Vars ignores Database/Accessor/Types.pm because: Can't locate Database/Accessor/View.pm in @INC (you may need to install the Database::Accessor::View module) (@INC contains: lib /home/scolesj/database-accessor/.build/baP_aZ_H4g/blib/lib /home/scolesj/database-accessor/.build/baP_aZ_H4g/blib/arch /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at lib/Database/Accessor/Types.pm line 14.
xt/release/unused-vars.t .. ok
All tests successful.
Files=1, Tests=1, 2 wallclock secs ( 0.05 usr 0.02 sys + 1.62 cusr 0.12 csys = 1.81 CPU)
Result: PASS

So nothing much in there but will have to see why the Database/Accessor/Types.pm file couldn't load that file, might just be because I embed a number of those Database::Accessor classes in the Accessor.pm file.


UseAllModules

Hmm a 'Module' or 'Automated' level test that add in a simple use test case to you distribution. Now I already have one of those but lets just see what happens.

So I added in


[Test::UnusedVars]
++[Test::UseAllModules]
[Git::Check] 

to the '.ini' and then gave dzil build just to see what was created. A quick look in output 't' dir I see there is

00-load.t

Ok that is nice but I like my first test better so not going to use this one.


Version

Now last but not lease there is this 'Author' level test that implements 'Test::Version' to ensure that all the versions in your distribution use the same version. As I plan to use automated version I think I will give this a miss.

So there you have it all the testing plug-ins looked at.

Is this the end of the Dist-Pen?

G54_-_Skeleton_prop_used_at_the_end_of_the_film.jpg


Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations