Bugzilla – Attachment 171346 Details for
Bug 37898
All db dependent tests should run within a transaction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37898: Wrap Indexer.t inside a transaction
Bug-37898-Wrap-Indexert-inside-a-transaction.patch (text/plain), 1.81 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-09-11 16:07:59 UTC
(
hide
)
Description:
Bug 37898: Wrap Indexer.t inside a transaction
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-09-11 16:07:59 UTC
Size:
1.81 KB
patch
obsolete
>From 3618b96c787211336b741f96c9d612a452b9aca2 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 11 Sep 2024 12:35:17 -0300 >Subject: [PATCH] Bug 37898: Wrap Indexer.t inside a transaction > >This tests leave new data on the DB. This patch fixes it. > >To test: >1. Run: > $ ktd --shell > k$ echo "SELECT COUNT(*) FROM biblio \G" | koha-mysql kohadev >2. Run: > k$ prove t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t >=> SUCCESS: Tests pass >3. Repeat 1 >=> FAIL: Biblio count raised >4. Apply this patch >5. Repeat 2 and 3 >=> SUCCESS: Tests pass >=> SUCCESS: Biblio count remains >6. Sign off :-D >--- > t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t | 8 ++++++++ > 1 file changed, 8 insertions(+) > >diff --git a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t b/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t >index 7dfd0b272bc..ee467654d2e 100755 >--- a/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t >+++ b/t/db_dependent/Koha/SearchEngine/Elasticsearch/Indexer.t >@@ -41,6 +41,8 @@ SKIP: { > skip 'Elasticsearch configuration not available', 3 > if $@; > >+ $schema->storage->txn_begin; >+ > my $builder = t::lib::TestBuilder->new; > my $biblio = > $builder->build_sample_biblio; # create biblio before we start mocking to avoid trouble indexing on creation >@@ -157,9 +159,14 @@ SKIP: { > > }; > >+ $schema->storage->txn_rollback; >+ > subtest 'update_index' => sub { >+ > plan tests => 1; > >+ $schema->storage->txn_begin; >+ > my $biblio = $builder->build_sample_biblio; > my $biblionumber = $biblio->biblionumber; > $biblio->delete; >@@ -171,6 +178,7 @@ SKIP: { > } > "", "update_index called with deleted biblionumber should not crash"; > >+ $schema->storage->txn_rollback; > }; > > } >-- >2.46.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 37898
:
171346
|
171347
|
171348
|
171349
|
171353
|
171611
|
171612
|
171613
|
171614
|
171615