Summary: | SIP tests : fix in 08checkin.t ("alert" field) | ||
---|---|---|---|
Product: | Koha | Reporter: | Adrien SAURAT <adrien.saurat> |
Component: | SIP2 | Assignee: | Adrien SAURAT <adrien.saurat> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | trivial | ||
Priority: | P5 - low | CC: | colin.campbell, gmcharlt, kyle |
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
proposed patch #2 Bug 9845: SIP tests : fixes in 08checkin.t Bug 9845: SIP tests : fixes in 08checkin.t |
Description
Adrien SAURAT
2013-03-19 14:16:21 UTC
Created attachment 16397 [details] [review] proposed patch #1 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 global "make test" or just launch the checkin test (see the README file for more informations) After the patch, the checkin test should run without error. I'm getting the same results pre and post patch. $ perl -I.. 08checkin.t 1..5 ok 1 - login ok 2 - SC status not ok 3 - match leader Checkin: prep: check out item (502326000005) # Failed test 'match leader Checkin: prep: check out item (502326000005)' # at SIPtest.pm line 204. # Response '120NUN20130320 065359AOCPL|AA23529001000463|AB502326000005|AJ|AH|AFInvalid Item|BLY|AY3AZE7E3' doesn't match pattern '(?-xism:^121NNY\d{8} {4}\d{6})' not ok 4 - match leader Checkin: Item (502326000005) is checked out # Failed test 'match leader Checkin: Item (502326000005) is checked out' # at SIPtest.pm line 204. # Response '100NUY20130320 065359AOCPL|AB502326000005|CV99|AFItem not checked out|AY4AZEA99' doesn't match pattern '(?-xism:^101YNN\d{8} {4}\d{6})' not ok 5 - match leader Checkin: Item not checked out # Failed test 'match leader Checkin: Item not checked out' # at SIPtest.pm line 204. # Response '100NUY20130320 065359AOCPL|AB502326000005|CV99|AFItem not checked out|AY5AZEA98' doesn't match pattern '(?-xism:^100YN[NY]\d{8} {4}\d{6})' # Looks like you failed 3 tests of 5. Any idea as to what I'm doing wrong? Well, my patch is actually design to correct the test named 'match leader Checkin: Item not checked out', but your run seems to crash before that, on the test named 'match leader Checkin: prep: check out item'. You have a response beginning with "120NUN" and the test expects "121NNY". Two differences then, the main one being 120 instead of 121 (the checkin failed, and the AF field contains this message : Invalid Item. Looks like your barcode is wrong or something like that ?! Other difference, U instead of N for the "magnetic media" field. I never encountered this U, and the unit test does not expect this, I don't know yet why you're getting this response. From the 3M doc, about the "magnetic media" field: 1-char, fixed-length field: Y or N or U. A 'Y' in this field indicates that this article is magnetic media and the SC will then handle the security discharge accordingly. A 'N' in this field indicates that the article is not magnetic media. A 'U' indicates that the ACS does not identify magnetic media articles. ACS vendors are encouraged to store and provide article magnetic media identification. The following test which fails on your side is the direct consequence of the first fail. It's a checkout which can only success if the former checkin attempt succeeded. On the last failing test, we are working on the test modified by my patch. Here, you get : 100NUY The test awaits: 100YN[NY] Two fields make the test field: - resensitize is on N for you (but should this make the test fail? after all, you can configure this in SIPconfig.xml for a reason) - magnetic media, again you have U and I don't know why!! we should check the code for that. The differences seem to come from different values we have in ILS.pm (with the default file "magnetic media" => 1 but maybe you modified this?) But anyway, it's in fact out of scope when it comes to testing a checkin. A library could use magnetic media or not, choose to desensitize or not, what we are testing here is the ability to checkin, and that is proved by the third character, 0 or 1. I'll thus make a patch allowing different configurations about magnetic madia. Created attachment 16601 [details] [review] proposed patch #2 New version of the patch. Will correct the tests being too restrictive about magnetic medias. But if you use the same barcode as before, you'll still get errors, it seemed to be an invalid item. Created attachment 19269 [details] [review] Bug 9845: SIP tests : fixes in 08checkin.t The tests were too restrictive. It should be possible to pass a checkin/checkout test with different values defined for magnetic medias. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Created attachment 19352 [details] [review] Bug 9845: SIP tests : fixes in 08checkin.t The tests were too restrictive. It should be possible to pass a checkin/checkout test with different values defined for magnetic medias. Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Passes koha-qa.pl, works as advertised. Pushed to master. Thanks, Adrien! |