From 221ba4076c53ab4910a1f4c90af81e39468d16e6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 18 Aug 2021 16:50:03 +0200 Subject: [PATCH] Bug 21670: Add debug to Plugins.t It's failing randomly (at least on Jenkins, cannot recreate locally). Maybe the plugin is not actually installed? --- t/db_dependent/Koha/Plugins/Plugins.t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Koha/Plugins/Plugins.t b/t/db_dependent/Koha/Plugins/Plugins.t index f49bd252fcc..7ae6664664a 100755 --- a/t/db_dependent/Koha/Plugins/Plugins.t +++ b/t/db_dependent/Koha/Plugins/Plugins.t @@ -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 { -- 2.25.1