Bugzilla – Attachment 189569 Details for
Bug 41248
Add ability for real time holds queue background jobs to skip duplicate jobs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41248: Add unit tests
Bug-41248-Add-unit-tests.patch (text/plain), 1.78 KB, created by
Kyle M Hall (khall)
on 2025-11-13 15:36:24 UTC
(
hide
)
Description:
Bug 41248: Add unit tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2025-11-13 15:36:24 UTC
Size:
1.78 KB
patch
obsolete
>From bb36641339361c2c6746593b296f048837d8b2ce Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 13 Nov 2025 10:36:12 -0500 >Subject: [PATCH] Bug 41248: Add unit tests > >--- > .../BatchUpdateBiblioHoldsQueue.t | 23 ++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t b/t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t >index 1669e4fd328..bf0900d74ea 100755 >--- a/t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t >+++ b/t/db_dependent/Koha/BackgroundJob/BatchUpdateBiblioHoldsQueue.t >@@ -18,7 +18,7 @@ > use Modern::Perl; > > use Test::NoWarnings; >-use Test::More tests => 2; >+use Test::More tests => 3; > use Test::Exception; > > use Koha::Database; >@@ -61,3 +61,24 @@ subtest 'enqueue() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'prevent duplicate jobs tests' => sub { >+ >+ plan tests => 4; >+ >+ $schema->storage->txn_begin; >+ >+ t::lib::Mocks::mock_preference( 'RealTimeHoldsQueue', 1 ); >+ >+ Koha::BackgroundJobs->search()->delete(); >+ >+ my $job_id = Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( { biblio_ids => [1] } ); >+ isnt( $job_id, undef, "Job id was returned for background job with no duplicate" ); >+ is( Koha::BackgroundJobs->search()->count(), 1, "Found one enqueued background job" ); >+ >+ $job_id = Koha::BackgroundJob::BatchUpdateBiblioHoldsQueue->new->enqueue( { biblio_ids => [1] } ); >+ is( $job_id, undef, "No job id was returned for background job with duplicate" ); >+ is( Koha::BackgroundJobs->search()->count(), 1, "Still found one enqueued background job" ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.50.1 (Apple Git-155)
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 41248
:
189567
|
189569
|
189570
|
189571
|
189581
|
189582