Bugzilla – Attachment 179095 Details for
Bug 34070
background_jobs_worker.pl floods logs when it gets error frames
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34070: Add tests
Bug-34070-Add-tests.patch (text/plain), 2.54 KB, created by
Jonathan Druart
on 2025-03-10 10:28:52 UTC
(
hide
)
Description:
Bug 34070: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-03-10 10:28:52 UTC
Size:
2.54 KB
patch
obsolete
>From 4402359b37c95cb4ac75556d57819a1ece00c24f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 10 Mar 2025 11:22:23 +0100 >Subject: [PATCH] Bug 34070: Add tests > >--- > t/db_dependent/Koha/BackgroundJob.t | 39 +++++++++++++++++++++-------- > 1 file changed, 29 insertions(+), 10 deletions(-) > >diff --git a/t/db_dependent/Koha/BackgroundJob.t b/t/db_dependent/Koha/BackgroundJob.t >index 3e4e0354e99..035823d6f73 100755 >--- a/t/db_dependent/Koha/BackgroundJob.t >+++ b/t/db_dependent/Koha/BackgroundJob.t >@@ -303,17 +303,36 @@ subtest 'decoded_data() and set_encoded_data() tests' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'decoded_data() and set_encoded_data() tests' => sub { >- plan tests => 3; >+subtest 'connect' => sub { >+ plan tests => 2; >+ >+ subtest 'JobsNotificationMethod' => sub { >+ plan tests => 3; >+ t::lib::Mocks::mock_config( 'message_broker', { hostname => 'not_localhost', port => '99999' } ); >+ >+ t::lib::Mocks::mock_preference( 'JobsNotificationMethod', 'STOMP' ); >+ my $job; >+ warning_like { $job = Koha::BackgroundJob->connect() } qr{Cannot connect to broker}; >+ is( $job, undef, "Return undef if unable to connect when using stomp" ); > >- t::lib::Mocks::mock_config( 'message_broker', { hostname => 'not_localhost', port => '99999' } ); >+ t::lib::Mocks::mock_preference( 'JobsNotificationMethod', 'polling' ); >+ $job = Koha::BackgroundJob->connect(); >+ is( $job, undef, "Return undef if using polling" ); >+ }; >+ >+ subtest 'wrong credentials' => sub { >+ plan tests => 2; >+ t::lib::Mocks::mock_preference( 'JobsNotificationMethod', 'STOMP' ); > >- t::lib::Mocks::mock_preference( 'JobsNotificationMethod', 'STOMP' ); >- my $job; >- warning_like { $job = Koha::BackgroundJob->connect() } qr{Cannot connect to broker}; >- is( $job, undef, "Return undef if unable to connect when using stomp" ); >+ t::lib::Mocks::mock_config( >+ 'message_broker', >+ { hostname => 'localhost', port => '61613', username => 'guest', password => 'wrong_password' } >+ ); > >- t::lib::Mocks::mock_preference( 'JobsNotificationMethod', 'polling' ); >- $job = Koha::BackgroundJob->connect(); >- is( $job, undef, "Return undef if using polling" ); >+ my $job; >+ warning_is { $job = Koha::BackgroundJob->connect() } >+ q{Cannot connect to broker (Access refused for user 'guest')}; >+ is( $job, undef, "Return undef if unable to connect when using stomp" ); >+ >+ }; > }; >-- >2.34.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 34070
:
178068
|
179024
|
179025
|
179094
|
179095
|
179214
|
179215
|
179216
|
179217
|
179218
|
182570
|
182571
|
182572
|
182573
|
182574