Description
Julian FIOL
2015-03-24 13:04:06 UTC
Created attachment 37176 [details] [review] Bug 13899 : Adding misc/devel/coverage.pl, a script making a cover on all modules to see which ones are not tested yet. It uses Devel::Cover Created attachment 37178 [details] [review] Bug 13899 : Adding misc/devel/coverage.pl It's a script making a cover on all modules to see which ones are not tested yet. It uses Devel::Cover Julian, 1/ I would suggest you to replace $sth = $dbh->prepare($query); $sth->execute($biblionumber1, $status); $count = $sth->fetchrow_array; with a call to $dbh->selectrow_array 2/ use perltidy on new file. 3/ use the qa script to catch the trailing spaces Sorry, wrong bug report :-/ Comment on attachment 37178 [details] [review] Bug 13899 : Adding misc/devel/coverage.pl Review of attachment 37178 [details] [review]: ----------------------------------------------------------------- And please run perltidy on new files. ::: misc/devel/coverage.pl @@ +34,5 @@ > +use C4::Context; > + > +my $KOHA_PATH = C4::Context->config("intranetdir"); > + > +chdir $KOHA_PATH; I would not do that, I'd prefer compare getcwd and intranetdir. If they differ, raise an error. @@ +37,5 @@ > + > +chdir $KOHA_PATH; > + > +eval{ > + require Devel::Cover; Add it to the list of deps (see C4/Installer/PerlDependencies.pm). @@ +41,5 @@ > + require Devel::Cover; > +}; > + > +if ($@) { > + say "Devel::Cover needs to be installed"; And don't catch the deps error. @@ +49,5 @@ > +#Delete old coverage > +system("cover -delete"); > + > +#Start the cover > +system("PERL5OPT=-MDevel::Cover /usr/bin/prove -r t/"); What about existing PERL5OPT? Have a look at prove -M Created attachment 37905 [details] [review] Bug 13899 : Add changes as asked in Comment 5 Created attachment 38181 [details] [review] Bug 13889 - Add information about cron jobs to system log This patch adds information about cron jobs performed and make it viewable under Home > Tools > Logs ("Browse system logs") To test: Apply patch - Got to system preferences and set 'CronjobLog' to: [Log] information from cron jobs. - Run some cron jobs - Go to Home > Tools > Logs - Verify that you have a selection 'Cron jobs' in drop-down 'Module'. Select it with Action "All" and Submit. - Output should show Date/time and info about Cron jobs Rebased to work on top of Bug 6911 (conflict in viewlog.tt) /MV Rebased after applying patch for Bug 6911 /MV Conflicts resolved: misc/cronjobs/overdue_notices.pl misc/cronjobs/cleanup_database.pl Signed-off-by: Frederic Demians <f.demians@tamil.fr> - Merge both patches, and fix updatedatabase.pl - Works as described. Provide intersting feedback from cronjob scripts. -- Modified version taking in account syspref CronJobLog. Handling simplified by introducing a convenience sub cronlogaction in C4/Log.pm /MV Amended to take in account comments #11, #12, #13 /MV Comment on attachment 38181 [details] [review] Bug 13889 - Add information about cron jobs to system log Sorryfor the noize, I mistaked with the bug number. As Jonathan said, run koha-qa FAIL misc/devel/coverage.pl OK critic FAIL forbidden patterns forbidden pattern: Koha is now under the GPLv3 license (line 8) OK pod OK valid Created attachment 38529 [details] [review] Bug 13899 : Changing license to GPLv3 koha-qa should be good : OK misc/devel/coverage.pl OK critic OK forbidden patterns OK pod OK valid OK C4/Installer/PerlDependencies.pm OK critic OK forbidden patterns OK pod OK valid Created attachment 38530 [details] [review] Bug 13899 : Changing license to GPLv3 koha-qa should be good : OK misc/devel/coverage.pl OK critic OK forbidden patterns OK pod OK valid OK C4/Installer/PerlDependencies.pm OK critic OK forbidden patterns OK pod OK valid Created attachment 38888 [details] [review] [SIGNED-OFF] Bug 13899: Adding misc/devel/coverage.pl It's a script making a cover on all modules to see which ones are not tested yet. It uses Devel::Cover Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Created attachment 38889 [details] [review] [SIGNED-OFF] Bug 13899: Add changes as asked in Comment 5 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Fixed a small conflict on PerlDependencies.pm Created attachment 38890 [details] [review] [SIGNED-OFF] Bug 13899: Changing license to GPLv3 koha-qa should be good : OK misc/devel/coverage.pl OK critic OK forbidden patterns OK pod OK valid OK C4/Installer/PerlDependencies.pm OK critic OK forbidden patterns OK pod OK valid Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No koha-qa errors. Test plan not explicitly stated, script run and generates a lot of data :) Test Plan --------- 1. Go to your koha/src directory 2. Launch misc/devel/coverage.pl script 3. After a pretty long time it will generate an html file (path given at the end of execution). It something like [...]/koha/src/cover_db/coverage.html 4. This html file give you a lot of information about coverage of koha modules I use it to see which module are not coverage by unit tests and improve it Created attachment 38977 [details] [review] [PASSED QA] Bug 13899: Adding misc/devel/coverage.pl It's a script making a cover on all modules to see which ones are not tested yet. It uses Devel::Cover Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 38978 [details] [review] [PASSED QA] Bug 13899: Add changes as asked in Comment 5 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Fixed a small conflict on PerlDependencies.pm Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 38979 [details] [review] [PASSED QA] Bug 13899: Changing license to GPLv3 koha-qa should be good : OK misc/devel/coverage.pl OK critic OK forbidden patterns OK pod OK valid OK C4/Installer/PerlDependencies.pm OK critic OK forbidden patterns OK pod OK valid Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> No koha-qa errors. Test plan not explicitly stated, script run and generates a lot of data :) Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 39531 [details] [review] Bug 13899: (QA followup) POD and usage message fixes Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> asd Tool pushed to master. Thanks Julian! |