Bugzilla – Attachment 110121 Details for
Bug 26462
t/db_dependent/Holds.t tests delete data unnecessarily
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26462: Don't delete existing data for tests
Bug-26462-Dont-delete-existing-data-for-tests.patch (text/plain), 3.50 KB, created by
Katrin Fischer
on 2020-09-15 19:46:17 UTC
(
hide
)
Description:
Bug 26462: Don't delete existing data for tests
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-09-15 19:46:17 UTC
Size:
3.50 KB
patch
obsolete
>From 57b34838ef1512808e26912f050026e9d1d6e55e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 15 Sep 2020 10:11:33 +0000 >Subject: [PATCH] Bug 26462: Don't delete existing data for tests > >These tests generate their own items, patrons, and circ rules. Existing >system data will not affect the results of the tests. We do not need >to delete information. > >You may be able to notice the difference in speed of tests depending on your system. It should >be faster after applying > >To test: >1 - Before applying patch: > prove -v t/db_dependent/Holds.t >2 - It passes >3 - Apply patch >4 - prove -v t/db_dependent/Holds.t >5 - It passes > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > t/db_dependent/Holds.t | 22 ---------------------- > 1 file changed, 22 deletions(-) > >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 0cffe1501a..7ad86b9783 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -633,11 +633,6 @@ subtest 'CanItemBeReserved / holds_per_day tests' => sub { > > $schema->storage->txn_begin; > >- Koha::Holds->search->delete; >- $dbh->do('DELETE FROM issues'); >- Koha::Items->search->delete; >- Koha::Biblios->search->delete; >- > my $itemtype = $builder->build_object( { class => 'Koha::ItemTypes' } ); > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); > my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >@@ -650,7 +645,6 @@ subtest 'CanItemBeReserved / holds_per_day tests' => sub { > my $biblio_3 = $builder->build_sample_biblio({ itemtype => $itemtype->itemtype }); > my $itemnumber_3 = $builder->build_sample_item({ library => $library->branchcode, biblionumber => $biblio_3->biblionumber})->itemnumber; > >- Koha::CirculationRules->search->delete; > Koha::CirculationRules->set_rules( > { > categorycode => '*', >@@ -818,9 +812,6 @@ subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { > > $schema->storage->txn_begin; > >- # Cleanup database >- Koha::Holds->search->delete; >- $dbh->do('DELETE FROM issues'); > Koha::CirculationRules->set_rule( > { > branchcode => undef, >@@ -831,9 +822,6 @@ subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { > } > ); > >- Koha::Items->search->delete; >- Koha::Biblios->search->delete; >- > # Create item types > my $itemtype1 = $builder->build_object( { class => 'Koha::ItemTypes' } ); > my $itemtype2 = $builder->build_object( { class => 'Koha::ItemTypes' } ); >@@ -1038,10 +1026,6 @@ subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { > plan tests => 9; > > $schema->storage->txn_begin; >- >- # Cleanup database >- Koha::Holds->search->delete; >- $dbh->do('DELETE FROM issues'); > Koha::CirculationRules->set_rule( > { > branchcode => undef, >@@ -1052,9 +1036,6 @@ subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { > } > ); > >- Koha::Items->search->delete; >- Koha::Biblios->search->delete; >- > # Create item types > my $itemtype1 = $builder->build_object( { class => 'Koha::ItemTypes' } ); > my $itemtype2 = $builder->build_object( { class => 'Koha::ItemTypes' } ); >@@ -1260,9 +1241,6 @@ subtest 'non priority holds' => sub { > > $schema->storage->txn_begin; > >- # Cleanup database >- Koha::Holds->search->delete; >- $dbh->do('DELETE FROM issues'); > Koha::CirculationRules->set_rules( > { > branchcode => undef, >-- >2.11.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 26462
:
110097
|
110104
| 110121