From 10a9cdc6037880f1d832483d91ed3279d26b7905 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Mon, 24 Jul 2017 16:43:18 +0300 Subject: [PATCH] Bug 18976: Fix t/db_dependent/Auth.t cleanup Test t/db_dependent/Auth.t seems to have an ineffective test data cleanup. Data generated by TestBuilder is left in borrowers, branches, categories, sms_providers and sessions tables after the test. To replicate: 1. Check the row count of borrowers, branches and categories tables 2. prove t/db_dependent/Auth.t 3. Repeat step 1 4. Observe borrowers the following tables have increased in row count: - borrowers - branches - categories - sessions - sms_providers To test: 1. Before applying the patch, go through steps at "To replicate" plan 2. Apply patch 3. Go through steps at "To replicate" plan 4. Observe step 4 no longer applies and those tables have the same number of rows as before executing the test. This issue has been happening in REST tests as well, and this solution is directly copy-pasted from t/db_dependent/api/v1/cities.t --- t/db_dependent/Auth.t | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t index b8f2b2e..b451f15 100644 --- a/t/db_dependent/Auth.t +++ b/t/db_dependent/Auth.t @@ -29,6 +29,10 @@ my $schema = Koha::Database->schema; my $builder = t::lib::TestBuilder->new; my $dbh = C4::Context->dbh; +# FIXME: SessionStorage defaults to mysql, but it seems to break transaction +# handling +t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' ); + $schema->storage->txn_begin; subtest 'checkauth() tests' => sub { -- 2.7.4