Bugzilla – Attachment 51693 Details for
Bug 16561
Regression caused by 15877 - t/db_dependent/Barcodes.t deletes all items from a DB
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16561 - Bug 15877 followup to fix tests
Bug-16561---Bug-15877-followup-to-fix-tests.patch (text/plain), 1.86 KB, created by
Jonathan Druart
on 2016-05-22 07:17:08 UTC
(
hide
)
Description:
Bug 16561 - Bug 15877 followup to fix tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-05-22 07:17:08 UTC
Size:
1.86 KB
patch
obsolete
>From 0276b8b6bf6266d3e711c1fd4771a3a142efa63a Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Sat, 21 May 2016 19:59:07 -0400 >Subject: [PATCH] Bug 16561 - Bug 15877 followup to fix tests > >When I altered the tests to avoid accidental deletion of all items, I >didn't rollback the transaction, hence the tests now delete all items >from a db when run. > >This patch rollsback the transaction so items are not deleted from your db > >To test: >1 - Backup your db >2 - prove -v t/db_dependent/Barcodes.t >3 - Note that all items and issues are deleted from the DB >4 - Restore your DB >5 - Apply this patch >6 - prove -v t/db_dependent/Barcodes.t >7 - Your DB should eb unchanged > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/Barcodes.t | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/Barcodes.t b/t/db_dependent/Barcodes.t >index e7a74a0..199de9f 100755 >--- a/t/db_dependent/Barcodes.t >+++ b/t/db_dependent/Barcodes.t >@@ -32,17 +32,15 @@ BEGIN { > use_ok('C4::Barcodes'); > } > >-my $schema = Koha::Database->new->schema; >-$schema->storage->txn_begin; >- > my $builder = t::lib::TestBuilder->new; > >-my $dbh = C4::Context->dbh; >+my $schema = Koha::Database->new->schema; > > subtest 'Test generation of annual barcodes from DB values' => sub { > > plan tests => 4; > >+ $schema->storage->txn_begin; > $builder->schema->resultset( 'Issue' )->delete_all; > $builder->schema->resultset( 'Item' )->delete_all; > >@@ -83,6 +81,7 @@ subtest 'Test generation of annual barcodes from DB values' => sub { > $schema->storage->txn_rollback; > }; > >+$schema->storage->txn_begin; > > $builder->schema->resultset( 'Issue' )->delete_all; > $builder->schema->resultset( 'Item' )->delete_all; >@@ -171,3 +170,5 @@ foreach $format (@formats) { > } > } > } >+ >+$schema->storage->txn_rollback; >-- >2.8.1
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 16561
:
51689
| 51693