Bugzilla – Attachment 90816 Details for
Bug 21073
Improve plugin performance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21073: (QA follow-up) Fix plugin-related tests
Bug-21073-QA-follow-up-Fix-plugin-related-tests.patch (text/plain), 3.07 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-06-19 18:38:39 UTC
(
hide
)
Description:
Bug 21073: (QA follow-up) Fix plugin-related tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-06-19 18:38:39 UTC
Size:
3.07 KB
patch
obsolete
>From 3f84cc0dea61437cc4b799443295359971ebb7e2 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 19 Jun 2019 15:38:20 -0300 >Subject: [PATCH] Bug 21073: (QA follow-up) Fix plugin-related tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/ImportBatch.t | 5 ++++- > t/db_dependent/Koha/REST/Plugin/PluginRoutes.t | 10 ++++++++-- > t/db_dependent/Koha/Template/Plugin/KohaPlugins.t | 4 +++- > 3 files changed, 15 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/ImportBatch.t b/t/db_dependent/ImportBatch.t >index bcc25ef9d1..676d2fda89 100644 >--- a/t/db_dependent/ImportBatch.t >+++ b/t/db_dependent/ImportBatch.t >@@ -188,7 +188,10 @@ subtest "RecordsFromMarcPlugin" => sub { > > t::lib::Mocks::mock_config( 'enable_plugins', 1 ); > t::lib::Mocks::mock_preference( 'UseKohaPlugins', 1 ); >- my ($plugin) = Koha::Plugins->new->GetPlugins({ all => 1, metadata => { name => 'MarcFieldValues' } }); >+ >+ my $plugins = Koha::Plugins->new; >+ $plugins->InstallPlugins; >+ my ($plugin) = $plugins->GetPlugins({ all => 1, metadata => { name => 'MarcFieldValues' } }); > isnt( $plugin, undef, "Plugin found" ); > my $records = C4::ImportBatch::RecordsFromMarcPlugin( $name, ref $plugin, 'UTF-8' ); > is( @$records, 2, 'Two results returned' ); >diff --git a/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t b/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t >index cc50b56b90..197a28d016 100644 >--- a/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t >+++ b/t/db_dependent/Koha/REST/Plugin/PluginRoutes.t >@@ -50,7 +50,10 @@ subtest 'Bad plugins tests' => sub { > t::lib::Mocks::mock_config( 'enable_plugins', 1 ); > t::lib::Mocks::mock_preference( 'UseKohaPlugins', 1 ); > >- my @plugins = Koha::Plugins->new->GetPlugins( { all => 1 } ); >+ my $plugins = Koha::Plugins->new; >+ $plugins->InstallPlugins; >+ >+ my @plugins = $plugins->GetPlugins( { all => 1 } ); > foreach my $plugin (@plugins) { > $plugin->enable; > } >@@ -81,7 +84,10 @@ subtest 'Disabled plugins tests' => sub { > > my $good_plugin; > >- my @plugins = Koha::Plugins->new->GetPlugins( { all => 1 } ); >+ my $plugins = Koha::Plugins->new; >+ $plugins->InstallPlugins; >+ >+ my @plugins = $plugins->GetPlugins( { all => 1 } ); > foreach my $plugin (@plugins) { > $plugin->disable; > $good_plugin = $plugin >diff --git a/t/db_dependent/Koha/Template/Plugin/KohaPlugins.t b/t/db_dependent/Koha/Template/Plugin/KohaPlugins.t >index 5ecc1cdb37..f0ff5b39b5 100755 >--- a/t/db_dependent/Koha/Template/Plugin/KohaPlugins.t >+++ b/t/db_dependent/Koha/Template/Plugin/KohaPlugins.t >@@ -31,7 +31,9 @@ my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; > > # Enable all plugins >-my @plugins = Koha::Plugins->new->GetPlugins({ all => 1, class => 'Koha::Plugin::Test' }); >+my $plugins = Koha::Plugins->new; >+$plugins->InstallPlugins; >+my @plugins = $plugins->GetPlugins({ all => 1, class => 'Koha::Plugin::Test' }); > map { $_->enable; } @plugins; > > my $mock_plugin = Test::MockModule->new( 'Koha::Plugin::Test' ); >-- >2.22.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21073
:
76955
|
76956
|
76957
|
76958
|
76973
|
88379
|
88380
|
88381
|
89247
|
89251
|
89252
|
89255
|
89256
|
89272
|
89273
|
89274
|
89275
|
89276
|
89277
|
89278
|
89279
|
89786
|
89800
|
89801
|
89802
|
89803
|
89804
|
89805
|
89806
|
89807
|
89808
|
90630
|
90631
|
90650
|
90651
|
90652
|
90653
|
90654
|
90655
|
90656
|
90657
|
90658
|
90659
|
90660
|
90661
|
90662
|
90663
|
90664
|
90724
|
90725
|
90726
|
90727
|
90728
|
90729
|
90730
|
90731
|
90732
|
90733
|
90734
|
90735
|
90736
|
90737
|
90738
|
90739
|
90759
| 90816