From 466ac64e25917fffbd738e4116ddc059ca5a7a17 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 4 May 2023 09:32:21 +0200 Subject: [PATCH] Bug 17427: Remove SessionStorage mock from tests --- t/db_dependent/Auth.t | 3 --- t/db_dependent/Koha/REST/Plugin/Auth/IdP.t | 4 ---- t/db_dependent/Koha_ExternalContent_OverDrive.t | 2 -- t/db_dependent/Search/History.t | 4 ---- t/db_dependent/api/v1/auth.t | 4 ---- t/db_dependent/api/v1/auth_authenticate_api_request.t | 5 ----- t/db_dependent/api/v1/idp.t | 4 ---- t/db_dependent/api/v1/two_factor_auth.t | 4 ---- 8 files changed, 30 deletions(-) diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t index 9c14a0f63dd..e230efe85ce 100755 --- a/t/db_dependent/Auth.t +++ b/t/db_dependent/Auth.t @@ -29,9 +29,6 @@ BEGIN { my $schema = Koha::Database->schema; my $builder = t::lib::TestBuilder->new; -# FIXME: SessionStorage defaults to mysql, but it seems to break transaction -# handling -t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); t::lib::Mocks::mock_preference( 'GDPR_Policy', '' ); # Disabled # To silence useless warnings diff --git a/t/db_dependent/Koha/REST/Plugin/Auth/IdP.t b/t/db_dependent/Koha/REST/Plugin/Auth/IdP.t index d3579cf9c1c..5909c1a0990 100755 --- a/t/db_dependent/Koha/REST/Plugin/Auth/IdP.t +++ b/t/db_dependent/Koha/REST/Plugin/Auth/IdP.t @@ -77,10 +77,6 @@ use Koha::Database; my $schema = Koha::Database->new()->schema(); my $builder = t::lib::TestBuilder->new; -# FIXME: sessionStorage defaults to mysql, but it seems to break transaction handling -# this affects the other REST api tests -t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); - subtest 'auth.register helper' => sub { plan tests => 6; diff --git a/t/db_dependent/Koha_ExternalContent_OverDrive.t b/t/db_dependent/Koha_ExternalContent_OverDrive.t index d8c5c97289d..6f0e94f03e2 100755 --- a/t/db_dependent/Koha_ExternalContent_OverDrive.t +++ b/t/db_dependent/Koha_ExternalContent_OverDrive.t @@ -18,8 +18,6 @@ BEGIN { use_ok('Koha::ExternalContent::OverDrive'); -t::lib::Mocks::mock_preference('SessionStorage','tmp'); - t::lib::Mocks::mock_preference('OverDriveClientKey', 'DUMMY'); t::lib::Mocks::mock_preference('OverDriveClientSecret', 'DUMMY'); t::lib::Mocks::mock_preference('OverDriveLibraryID', 'DUMMY'); diff --git a/t/db_dependent/Search/History.t b/t/db_dependent/Search/History.t index 4c084e121a4..27fc0d38eb6 100755 --- a/t/db_dependent/Search/History.t +++ b/t/db_dependent/Search/History.t @@ -23,10 +23,6 @@ my $schema = Koha::Database->new->schema; $schema->storage->txn_begin; my $dbh = C4::Context->dbh; -# FIXME: SessionStorage defaults to mysql, but it seems to break transaction -# handling -t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); - use_ok('Koha::DateUtils'); use_ok('C4::Search::History', qw( add get delete get_from_session )); diff --git a/t/db_dependent/api/v1/auth.t b/t/db_dependent/api/v1/auth.t index cdb171925c6..9e550c61b05 100755 --- a/t/db_dependent/api/v1/auth.t +++ b/t/db_dependent/api/v1/auth.t @@ -30,10 +30,6 @@ use Koha::Database; my $schema = Koha::Database->new->schema; my $builder = t::lib::TestBuilder->new; -# FIXME: sessionStorage defaults to mysql, but it seems to break transaction handling -# this affects the other REST api tests -t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); - my $remote_address = '127.0.0.1'; my $t = Test::Mojo->new('Koha::REST::V1'); my $tx; diff --git a/t/db_dependent/api/v1/auth_authenticate_api_request.t b/t/db_dependent/api/v1/auth_authenticate_api_request.t index 10a61893e8b..9c47926e7bd 100755 --- a/t/db_dependent/api/v1/auth_authenticate_api_request.t +++ b/t/db_dependent/api/v1/auth_authenticate_api_request.t @@ -36,11 +36,6 @@ my $builder = t::lib::TestBuilder->new(); my $remote_address = '127.0.0.1'; my $tx; -# FIXME: CGI::Session::Driver::DBI explicitly sets AutoCommit=1 [1] which breaks the rollback in out tests. -# Until we change into some other library, set SessionStorage to 'tmp' -# [1] https://metacpan.org/source/CGI::Session::Driver::DBI#L28 -t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); - subtest 'token-based tests' => sub { if ( can_load( modules => { 'Net::OAuth2::AuthorizationServer' => undef } ) ) { diff --git a/t/db_dependent/api/v1/idp.t b/t/db_dependent/api/v1/idp.t index c67b5124e00..880484151e1 100755 --- a/t/db_dependent/api/v1/idp.t +++ b/t/db_dependent/api/v1/idp.t @@ -36,10 +36,6 @@ use Koha::Auth::Identity::Provider::Domains; my $schema = Koha::Database->new->schema; my $builder = t::lib::TestBuilder->new; -# FIXME: sessionStorage defaults to mysql, but it seems to break transaction handling -# this affects the other REST api tests -t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); - my $remote_address = '127.0.0.1'; # use t::lib::IdP::ExternalIdP; diff --git a/t/db_dependent/api/v1/two_factor_auth.t b/t/db_dependent/api/v1/two_factor_auth.t index 3a890c3d652..9eefa3300ad 100755 --- a/t/db_dependent/api/v1/two_factor_auth.t +++ b/t/db_dependent/api/v1/two_factor_auth.t @@ -29,10 +29,6 @@ use Koha::Database; my $schema = Koha::Database->new->schema; my $builder = t::lib::TestBuilder->new; -# FIXME: sessionStorage defaults to mysql, but it seems to break transaction handling -# this affects the other REST api tests -t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); - my $remote_address = '127.0.0.1'; my $t = Test::Mojo->new('Koha::REST::V1'); -- 2.25.1