Bugzilla – Attachment 144232 Details for
Bug 32304
Fix subtest search_limited and purge in BackgroundJobs.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32304: BackgroundJobs.t: Fix subtest purge
Bug-32304-BackgroundJobst-Fix-subtest-purge.patch (text/plain), 2.11 KB, created by
Martin Renvoize (ashimema)
on 2022-11-25 08:32:25 UTC
(
hide
)
Description:
Bug 32304: BackgroundJobs.t: Fix subtest purge
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-11-25 08:32:25 UTC
Size:
2.11 KB
patch
obsolete
>From 3ef0f659d8ae53fc4d4138fb089d2f531f8436f6 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 21 Nov 2022 09:53:31 +0000 >Subject: [PATCH] Bug 32304: BackgroundJobs.t: Fix subtest purge > >Instead of deleting, I added a count :) >Note that one of the purges eventually deletes my >older jobs.. > >Test plan: >Run t/db_dependent/Koha/BackgroundJobs.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/BackgroundJobs.t | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/BackgroundJobs.t b/t/db_dependent/Koha/BackgroundJobs.t >index 158565df4c..c9cfdca132 100755 >--- a/t/db_dependent/Koha/BackgroundJobs.t >+++ b/t/db_dependent/Koha/BackgroundJobs.t >@@ -146,6 +146,7 @@ subtest 'search_limited' => sub { > subtest 'purge' => sub { > plan tests => 9; > $schema->storage->txn_begin; >+ my $cnt_finished = Koha::BackgroundJobs->search({ status => 'finished' })->count; > > my $recent_date = dt_from_string; > my $old_date = dt_from_string->subtract({ days => 3 }); >@@ -161,7 +162,7 @@ subtest 'purge' => sub { > is( Koha::BackgroundJobs->purge($params), 1, 'Only the old finished type1 job would be purged' ); > > $params->{'job_types'} = ['all']; >- is( Koha::BackgroundJobs->purge($params), 2, 'All finished old jobs would be purged with job_types = all' ); >+ is( Koha::BackgroundJobs->purge($params), $cnt_finished + 2, 'All finished old jobs would be purged with job_types = all' ); > > my $rs = Koha::BackgroundJobs->search( > { >@@ -182,7 +183,7 @@ subtest 'purge' => sub { > is( $rs->count, 3, '3 jobs still left in queue'); > > $params->{'job_types'} = ['all']; >- is( Koha::BackgroundJobs->purge($params), 1, 'The remaining old finished jobs is purged' ); >+ is( Koha::BackgroundJobs->purge($params), $cnt_finished + 1, 'The remaining old finished jobs is purged' ); > $rs = Koha::BackgroundJobs->search( > { > id => [ $job_recent_t1_new->id, $job_recent_t2_fin->id, $job_old_t1_fin->id, $job_old_t2_fin->id ] >-- >2.20.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 32304
:
144108
|
144227
|
144228
|
144231
| 144232