Bug 21670: Add debug to Plugins.t
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 18 Aug 2021 14:50:03 +0000 (16:50 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 19 Aug 2021 08:01:01 +0000 (10:01 +0200)
It's failing randomly (at least on Jenkins, cannot recreate locally).
Maybe the plugin is not actually installed?

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/Koha/Plugins/Plugins.t

index f49bd25..7ae6664 100755 (executable)
@@ -25,7 +25,7 @@ use File::Temp qw( tempdir tempfile );
 use FindBin qw($Bin);
 use Module::Load::Conditional qw(can_load);
 use Test::MockModule;
-use Test::More tests => 53;
+use Test::More tests => 55;
 
 use C4::Context;
 use Koha::Database;
@@ -263,11 +263,12 @@ for my $pass ( 1 .. 2 ) {
     ok( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm", "KitchenSink plugin installed successfully" );
     $INC{$pm_path} = $full_pm_path; # FIXME I do not really know why, but if this is moved before the $plugin constructor, it will fail with Can't locate object method "new" via package "Koha::Plugin::Com::ByWaterSolutions::KitchenSink"
     Koha::Plugins->new( { enable_plugins => 1 } )->InstallPlugins();
+    ok( -f $full_pm_path, "Koha::Plugins::Handler::delete works correctly (pass $pass)" );
     Koha::Plugins::Handler->delete({ class => "Koha::Plugin::Com::ByWaterSolutions::KitchenSink", enable_plugins => 1 });
     my $sth = C4::Context->dbh->table_info( undef, undef, $table, 'TABLE' );
     my $info = $sth->fetchall_arrayref;
     is( @$info, 0, "Table $table does no longer exist" );
-    ok( !( -f $full_pm_path ), "Koha::Plugins::Handler::delete works correctly." );
+    ok( !( -f $full_pm_path ), "Koha::Plugins::Handler::delete works correctly (pass $pass)" );
 }
 
 subtest 'output and output_html tests' => sub {