Bugzilla – Attachment 189582 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.81 KB, created by
Lucas Gass (lukeg)
on 2025-11-13 18:41:45 UTC
(
hide
)
Description:
Bug 41248: Add unit tests
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-11-13 18:41:45 UTC
Size:
1.81 KB
patch
obsolete
>From e15d8a635898bc23d966d22f35125723e6e851a0 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 > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../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 cd2276b4d31..99df2a54671 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.39.5
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