We have t/00-load.t to make sure that C4 and Koha modules can be loaded, but right now there is no test to prevent the inclusion of a Perl script that does not compile in Koha. There should be one.
Created attachment 10704 [details] [review] Bug 8383: Add test to check that Perl scripts compile This patch adds t/00-strict.pl which tests that all Perl scripts compile. I chose to use Test::Strict so that in the future we can also have the test check that "use strict" and "use warnings" are enabled. To test: 1. Run t/00-strict.pl. 2. Run around waving your arms in the air that we have a couple of scripts that don't compile. 3. Actually, that's about it. You could test my patch for bug 8384 next.
I like it, except this does more than check they will compile. eg not ok 28 - Syntax check acqui/modordernotes.pl # Failed test 'Syntax check acqui/modordernotes.pl' # at /usr/share/perl5/Test/Strict.pm line 305. # DBI connect('dbname=koha;host=localhost;port=3306','kohaadmin',...) failed: Access denied for user 'kohaadmin'@'localhost' (using password: YES) at C4/Context.pm line 758 Because they use C4::Context, to do a test like this we need a database, hence we need this script in t/db_dependent/
Created attachment 10711 [details] [review] Bug 8383: Add test to check that Perl scripts compile This patch adds t/db_dependent/00-strict.pl which tests that all Perl scripts compile. I chose to use Test::Strict so that in the future we can also have the test check that "use strict" and "use warnings" are enabled. To test: 1. Run t/db_dependent/00-strict.pl. 2. Run around waving your arms in the air that we have a couple of scripts that don't compile. 3. Actually, that's about it. You could test my patch for bug 8384 next. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Moved test to t/db_dependent
Created attachment 10723 [details] [review] Signed-off patch
(In reply to comment #4) > Created attachment 10723 [details] [review] > Signed-off patch QA comment... passing QA, patch applies and works perfect
Very useful test, pushing to 3.8.x
(In reply to comment #6) > Very useful test, pushing to 3.8.x woops!, this patch missed out on getting pushed to master Jared, i'll attach a rebased patch for master
Created attachment 16900 [details] [review] Bug 8383: Add test to check that Perl scripts This patch adds t/db_dependent/00-strict.pl which tests that all Perl scripts compile. I chose to use Test::Strict so that in the future we can also have the test check that "use strict" and "use warnings" are enabled. To test: 1. Run t/db_dependent/00-strict.pl. 2. Run around waving your arms in the air that we have a couple of scripts that don't compile. 3. Actually, that's about it. You could test my patch for bug 8384 next. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Moved test to t/db_dependent Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
passing QA on this patch...
This patch was pushed to master during the 3.10 release cycle.