https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40294

--- Comment #35 from David Nind <[email protected]> ---
(In reply to Emily Lamancusa (emlam) from comment #34)
> Thanks again for the thorough testing! I updated the tests again; hopefully
> third time's the charm!

Tests still fail for me:
- Apply the patches
- Run the database update
- Restart everything
- Test failures for test 43 and 52 - see [1]

They pass after step 3 of the test plan.

I tried various combinations of settings, but I think it is because there are
no phone and sms notices.

If I:
- Set SMSSendDriver to Email (required so I can add an SMS notice)
- Set PhoneNotification to Enable (required so I can a phone notice)
- Add text to the phone and sms notices for MEMBERSHIP_EXPIRY and
MEMBERSHIP_RENEWED
==> The tests pass

> > Step 9: 
> > - No message options selected under messaging preferences for either patron
> > category or the individual patron (for Patron account expiry (mandatory)).
> > - Ran: perl misc/cronjobs/membership_expiry.pl -c -v -before 10 -after 10
> > - For the patron, a MEMBERSHIP_EXPIRY print notice was queued
> 
> Did the patron account have any email address, sms, or primary phone number
> saved when you ran step 9? If it had no contact information saved, queueing
> the print notice is the expected behavior.

I'm not sure (I thought I had added email and an SMS number), but it looks like
I hadn't at that stage. Things work as expected after I retested:
- With an email address, SMS number, and primary phone number:
  ==> email notice
- With no email address (but SMS number and primary phone number):
  ==> Phone notice
- With no email address or SMS number (but a primary phone number):
  ==> Phone notice
- With no email address or primary phone number (but an SMS number)
  ==> SMS notice
- With no info for email address, SMS number, and primary phone number:
  ==> print notice

So all as expected when I test it right 8-)

> The patron category messaging preferences (other than the setting to make
> the expiry notices mandatory) shouldn't affect the behavior here - those are
> just the default settings that get set when a new patron account is created.
> The rest of your test results do match the expected behavior based on the
> individual patron account's messaging preferences.

Great!

[1] Test failures
=================

I get test failures after applying the patches, running the database update,
and a restart_all.

I think it is because MEMBERSHIP_EXPIRY and MEMBERSHIP_RENEWED don't have
default phone and sms notice.

If I:
- Set SMSSendDriver to Email (required so I can add an SMS notice)
- Set PhoneNotification to Enable (required so I can a phone notice)
- Add text to the phone and sms notices for MEMBERSHIP_EXPIRY and
MEMBERSHIP_RENEWED
==> The tests pass

prove t/db_dependent/Koha/Patrons.t
t/db_dependent/Koha/Patrons.t .. 42/52 
    #   Failed test 'Mandatory expiry notice falls back to phone if patron
email undefined and phone allowed'
    #   at t/db_dependent/Koha/Patrons.t line 3456.
    #          got: '0'
    #     expected: '1'

    #   Failed test 'Mandatory expiry notice falls back to sms if patron email
undefined, phone not allowed, and sms allowed'
    #   at t/db_dependent/Koha/Patrons.t line 3472.
    #          got: '1'
    #     expected: '2'
    # Looks like you failed 2 tests of 15.

#   Failed test 'queue_notice'
#   at t/db_dependent/Koha/Patrons.t line 3495.
t/db_dependent/Koha/Patrons.t .. 51/52 
#   Failed test 'no warnings'
#   at /usr/share/perl/5.40/Test/Builder.pm line 193.
# There were 2 warning(s)
#     Previous test 12 'Mandatory expiry notice falls back to email if patron
email is defined'
#     No members MEMBERSHIP_RENEWED letter transported by phone at
/kohadevbox/koha/C4/Letters.pm line 598.
#  at /kohadevbox/koha/C4/Letters.pm line 598.
#       C4::Letters::GetPreparedLetter("module", "members",
"message_transport_type", "phone", "borrowernumber", 639, "letter_code",
"MEMBERSHIP_RENEWED", ...) called at /kohadevbox/koha/Koha/Patron.pm line 3291
#       Koha::Patron::queue_notice(Koha::Patron=HASH(0x564ae6b345a8),
HASH(0x564ae69efa40)) called at t/db_dependent/Koha/Patrons.t line 3454
#       main::__ANON__() called at /usr/share/perl/5.40/Test/Builder.pm line
374
#       eval {...} called at /usr/share/perl/5.40/Test/Builder.pm line 374
#       Test::Builder::subtest(Test::Builder=HASH(0x564ada214bd0),
"queue_notice", CODE(0x564ae6928660)) called at
/usr/share/perl/5.40/Test/More.pm line 831
#       Test::More::subtest("queue_notice", CODE(0x564ae6928660)) called at
t/db_dependent/Koha/Patrons.t line 3495
# 
# ----------
#     Previous test 13 'Mandatory expiry notice falls back to phone if patron
email undefined and phone allowed'
#     No members MEMBERSHIP_RENEWED letter transported by sms at
/kohadevbox/koha/C4/Letters.pm line 598.
#  at /kohadevbox/koha/C4/Letters.pm line 598.
#       C4::Letters::GetPreparedLetter("module", "members",
"message_transport_type", "sms", "borrowernumber", 639, "letter_code",
"MEMBERSHIP_RENEWED", ...) called at /kohadevbox/koha/Koha/Patron.pm line 3291
#       Koha::Patron::queue_notice(Koha::Patron=HASH(0x564ae6b345a8),
HASH(0x564ae69efa40)) called at t/db_dependent/Koha/Patrons.t line 3470
#       main::__ANON__() called at /usr/share/perl/5.40/Test/Builder.pm line
374
#       eval {...} called at /usr/share/perl/5.40/Test/Builder.pm line 374
#       Test::Builder::subtest(Test::Builder=HASH(0x564ada214bd0),
"queue_notice", CODE(0x564ae6928660)) called at
/usr/share/perl/5.40/Test/More.pm line 831
#       Test::More::subtest("queue_notice", CODE(0x564ae6928660)) called at
t/db_dependent/Koha/Patrons.t line 3495
# 
# Looks like you failed 2 tests of 52.
t/db_dependent/Koha/Patrons.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/52 subtests 

Test Summary Report
-------------------
t/db_dependent/Koha/Patrons.t (Wstat: 512 (exited 2) Tests: 52 Failed: 2)
  Failed tests:  43, 52
  Non-zero exit status: 2
Files=1, Tests=52, 68 wallclock secs ( 0.10 usr  0.01 sys + 45.02 cusr 16.70
csys = 61.83 CPU)
Result: FAIL

More details:

...
not ok 43 - queue_notice
#   Failed test 'queue_notice'
#   at t/db_dependent/Koha/Patrons.t line 3495.
...
not ok 52 - no warnings
#   Failed test 'no warnings'
#   at /usr/share/perl/5.40/Test/Builder.pm line 193.
# There were 1 warning(s)
#     Previous test 12 'Mandatory expiry notice falls back to email if patron
email is defined'
#     No members MEMBERSHIP_RENEWED letter transported by phone at
/kohadevbox/koha/C4/Letters.pm line 598.
#  at /kohadevbox/koha/C4/Letters.pm line 598.
#       C4::Letters::GetPreparedLetter("lang", "u4uW79M0Tj45ZzSZ7", "tables",
HASH(0x562c1bc7a8d0), "borrowernumber", 2249, "letter_code",
"MEMBERSHIP_RENEWED", ...) called at /kohadevbox/koha/Koha/Patron.pm line 3291
#       Koha::Patron::queue_notice(Koha::Patron=HASH(0x562c1bc394c8),
HASH(0x562c1bec5850)) called at t/db_dependent/Koha/Patrons.t line 3454
#       main::__ANON__() called at /usr/share/perl/5.40/Test/Builder.pm line
374
#       eval {...} called at /usr/share/perl/5.40/Test/Builder.pm line 374
#       Test::Builder::subtest(Test::Builder=HASH(0x562c0f560f28),
"queue_notice", CODE(0x562c1b653030)) called at
/usr/share/perl/5.40/Test/More.pm line 831
#       Test::More::subtest("queue_notice", CODE(0x562c1b653030)) called at
t/db_dependent/Koha/Patrons.t line 3495
# 
# Looks like you failed 2 tests of 52.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to