Summary: | SIP tests : fix for 07hold.t on Cancel Hold | ||
---|---|---|---|
Product: | Koha | Reporter: | Adrien SAURAT <adrien.saurat> |
Component: | SIP2 | Assignee: | Christophe Croullebois <christophe.croullebois> |
Status: | RESOLVED WONTFIX | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | trivial | ||
Priority: | P5 - low | CC: | christophe.croullebois, colin.campbell, dcook, m.de.rooy |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26700 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Attachments: |
proposed patch #1
Bug 9842: SIP tests, fix for 07hold.t on Cancel Hold |
Description
Adrien SAURAT
2013-03-19 11:40:31 UTC
Created attachment 16380 [details] [review] proposed patch #1 Proposed patch : removes the ERRORS #2 and #3 Once these errors disappear, another one replaces them: # Failed test 'match leader Cancel Hold: no hold on specified item' # at /home/asaurat/workspace/versions/community/C4/SIP/t/SIPtest.pm line 204. # Response '161N20130319 123020AA1X981|AB1783B|AJL ANGOISSE DU ROI SALOMON|AOVIL|AFHold Cancelled.|AY8AZE623' doesn't match pattern '(?-xism:^160N\d{8} {4}\d{6})' The lack of efficient return value when calling CancelReserve is causing this. I'd rather resolve this in another patch once this one has been validated. TEST PLAN : 1) In "C4/SIP/t", configure the SIPtest.pm file. 2) Configure your SIPconfig.xml if needed. 3) Start your SIP server. 4) In "C4/SIP/t", do a "make test" (see the README file for more informations) You can also run the 07hold.t only. Still, running everything can help to ensure that your SIPtest.pm is well configured. Before the patch, this plan should generate 3 errors for 7hold. After the patch it will generate 2 errors. Created attachment 17563 [details] [review] Bug 9842: SIP tests, fix for 07hold.t on Cancel Hold Fixes tests resulting in a "No such hold on patron record" error when it was not true. When running the SIP tests, 07hold.t returns errors. ERROR 1: patron (1X981)' line 204. DU ROI SALOMON|AOVIL|AY3AZEA76' doesn't match pattern '(?-xism:^161Y\d{8} {4}\d{6})' Here, the most important return value is the "1" after "16", indicating a success. And indeed, the hold is correctly recorded in Koha. The following character, indicating the "available" status (and which can be of "Y" or "N" value), is fed by the "available" method in C4/SIP/ILS/Item.pm which is not totally functionnal yet. So, the question is : - should the test gives a OK result by accepting N or Y as long as we get a 161 and not a 160? - should we keep this as it is? (seems safer and cleaner, if we want to respect the SIP protocol the item should be marked as available if it is... I'll go this way and won't touch this in this patch) ERROR 2: line 204. patron record.|AY6AZEA73' doesn't match pattern '(?-xism:^161[NY]\d{8} {4}\d{6})' Here, the hold actually exists, but the "No such hold on patron record" result is caused by an error in the perl script of ILS.pm Tests like "unless ($trans->ok)" should be written unless "($trans->ok(1))". ERROR 3: (1X999)' line 204. patron record.|AY0AZEA70' doesn't match pattern '(?-xism:^161[NY]\d{8} {4}\d{6})' Proposed patch : removes the ERRORS #2 and #3 Once these errors disappear, another one replaces them: line 204. SALOMON|AOVIL|AFHold Cancelled.|AY8AZE623' doesn't match pattern '(?-xism:^160N\d{8} {4}\d{6})' The lack of efficient return value when calling CancelReserve is causing this. I'd rather resolve this in another patch once this one has been validated. TEST PLAN : 1) In "C4/SIP/t", configure the SIPtest.pm file. 2) Configure your SIPconfig.xml if needed. 3) Start your SIP server. 4) In "C4/SIP/t", do a "make test" (see the README file for more informations) You can also run the 07hold.t only. Still, running everything can help to ensure that your SIPtest.pm is well configured. Before the patch, this plan should generate 3 errors for 7hold. After the patch it will generate 2 errors. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> I am not sure if I understand this patch.. You say that this is wrong: unless ($trans->ok) { And that it should be: unless ($trans->ok(1)) { For me, it looks like that you test the ok status in the first case (via AUTOLOAD in Transaction.pm), and in the second case you set ok to 1 and this should also return 1. So you actually say: $trans->ok(1); unless(1) { So, whatever follows after this unless will never be executed. You will never get that error message any more :) I am setting status to Failed QA. Please convince me if I am wrong.. I am not sure how to set up the config files in order to make these tests pass (or not). Could someone else confirm if they are still failing or not maybe? (In reply to Katrin Fischer from comment #4) > I am not sure how to set up the config files in order to make these tests > pass (or not). Could someone else confirm if they are still failing or not > maybe? I don't know if anyone even uses them anymore. In Bug 26700, I propose that we remove them. If someone is using them, they need to move them into the t/ directory I think. |