Bugzilla – Attachment 100248 Details for
Bug 24760
BackgroundJob tests fail with latest versions of YAML or YAML::Syck
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24760: Use C4::BackgroundJob->fetch in tests
Bug-24760-Use-C4BackgroundJob-fetch-in-tests.patch (text/plain), 2.70 KB, created by
Marcel de Rooy
on 2020-03-06 11:16:08 UTC
(
hide
)
Description:
Bug 24760: Use C4::BackgroundJob->fetch in tests
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2020-03-06 11:16:08 UTC
Size:
2.70 KB
patch
obsolete
>From f7f379b60bdd46dad29fcec69429f7a55de8b7b9 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 28 Feb 2020 14:22:34 +0100 >Subject: [PATCH] Bug 24760: Use C4::BackgroundJob->fetch in tests >Content-Type: text/plain; charset=utf-8 > >Starting with YAML 1.30 and YAML::Syck 1.32, these modules don't bless >loaded objects by default. This is not a problem as >C4::BackgroundJob->fetch bless them anyway. > >So, instead of testing what's in the session, test the result of >C4::BackgroundJob->fetch, which is what's used everywhere else > >Test plan: >1. Install latest version of YAML::Syck (or YAML if YAML::Syck is not >installed) >2. prove t/db_dependent/BackgroundJob.t => should FAIL >3. Apply patch >4. prove t/db_dependent/BackgroundJob.t => should PASS >5. Verify that background jobs are still working (for instance, >tools/batchMod.pl) > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/BackgroundJob.t | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/BackgroundJob.t b/t/db_dependent/BackgroundJob.t >index ae5c25a78d..81a295979d 100644 >--- a/t/db_dependent/BackgroundJob.t >+++ b/t/db_dependent/BackgroundJob.t >@@ -50,10 +50,8 @@ is( $job->status, 'completed', "testing finished" ); > ok( $job->results ); #Will return undef unless finished > > my $second_job = C4::BackgroundJob->new( $sessionID, "making new job" ); >-$session = C4::Auth::get_session( $job->{sessionID} ); >-is( ref( $session->param( 'job_' . $job->id ) ), "C4::BackgroundJob", 'job_$jobid should be a C4::BackgroundJob for uncleared job 1' ); >-is( ref( $session->param( 'job_' . $second_job->id ) ), "C4::BackgroundJob", 'job_$jobid should be a C4::BackgroundJob for uncleared job 2' ); >+is( ref( C4::BackgroundJob->fetch( $sessionID, $job->id ) ), "C4::BackgroundJob", 'job_$jobid should be a C4::BackgroundJob for uncleared job 1' ); >+is( ref( C4::BackgroundJob->fetch( $sessionID, $second_job->id ) ), "C4::BackgroundJob", 'job_$jobid should be a C4::BackgroundJob for uncleared job 2' ); > $job->clear; >-$session = C4::Auth::get_session( $job->{sessionID} ); >-is( $session->param( 'job_' . $job->id ), undef, 'After clearing it, job 1 should not exist anymore in the session' ); >-is( ref( $session->param( 'job_' . $second_job->id ) ), "C4::BackgroundJob", 'After clear on job 1, job 2 should still be a C4::BackgroundJob' ); >+is( C4::BackgroundJob->fetch( $sessionID, $job->id ), undef, 'After clearing it, job 1 should not exist anymore in the session' ); >+is( ref( C4::BackgroundJob->fetch( $sessionID, $second_job->id ) ), "C4::BackgroundJob", 'After clear on job 1, job 2 should still be a C4::BackgroundJob' ); >-- >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 24760
:
99756
|
99968
| 100248 |
100249