1..72 ok 1 - use C4::Reserves; ok 2 - CheckReserves Test 1 ok 3 - CheckReserves() include reserve_id in its response ok 4 - CheckReserves Test 2 ok 5 - CheckReserves Test 3 ok 6 - GetReservesControlBranch returns item home branch when set to ItemHomeLibrary ok 7 - GetReservesControlBranch returns patron home branch when set to PatronLibrary ok 8 - Item is correctly waiting ok 9 - Item is correctly priority 1 ok 10 - Item is correctly priority 2 ok 11 - GetWaiting got only the waiting reserve ok 12 - GetWaiting got the reserve for the correct borrower Undefined subroutine &C4::Circulation::GetItem called at /home/ubuntu/kohaclone/C4/Circulation.pm line 1852. # Looks like you planned 72 tests but ran 12. # Looks like your test exited with 255 just after 12. I went back in the version history until the test passed this point, and it seems issues began after commit bf1563e60b31244f4ea977eb84954fb8501ed59a from Bug 14610; this commit on top looks to be failing with error Undefined subroutine &C4::Circulation::GetItemnumberFromBarcode called at /home/ubuntu/kohaclone/C4/Circulation.pm line 1853.
Created attachment 57094 [details] [review] Bug 17539: Fix Undefined subroutine &C4::Circulation::GetItem error perl t/db_dependent/Reserves.t 1..72 ok 1 - use C4::Reserves; ok 2 - CheckReserves Test 1 ok 3 - CheckReserves() include reserve_id in its response ok 4 - CheckReserves Test 2 ok 5 - CheckReserves Test 3 ok 6 - GetReservesControlBranch returns item home branch when set to ItemHomeLibrary ok 7 - GetReservesControlBranch returns patron home branch when set to PatronLibrary ok 8 - Item is correctly waiting ok 9 - Item is correctly priority 1 ok 10 - Item is correctly priority 2 ok 11 - GetWaiting got only the waiting reserve ok 12 - GetWaiting got the reserve for the correct borrower Undefined subroutine &C4::Circulation::GetItem called at /home/ubuntu/kohaclone/C4/Circulation.pm line 1853. This patch fixes this error. The solution was to use C4::Reserves before C4::Items.
Created attachment 57095 [details] [review] Bug 17539: Fix Already in a transaction error perl t/db_dependent/Reserves.t 1..72 ok 1 - use C4::Reserves; ok 2 - CheckReserves Test 1 ... ok 52 - Reserve in waiting status cant be canceled ok 53 - Reserving an ageRestricted Biblio without a borrower dateofbirth succeeds DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489. DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489. at /usr/share/perl5/DBIx/Class/Schema.pm line 1080. ... Koha::Object::store('Koha::Patron=HASH(0x9e43b20)') called at /home/ubuntu/kohaclone/C4/Members.pm line 542 C4::Members::ModMember('borrowernumber', 658535, 'dateofbirth', '2001-11-02') called at t/db_dependent/Reserves.t line 516 This patch fixes this issue by replacing dbh autocommit=0 with txn_begin.
Created attachment 57096 [details] [review] Bug 17539: Fix failing Reserves.t tests if category enrolmentfee > 0 To test: 1. Set patron category "S" with enrolmentfee 1 2. perl t/db_dependent/Reserves.t 3. Observe following errors: not ok 59 - Bug 14464 - No fines at beginning ok 60 - Bug 14464 - 1st reserve correctly created ok 61 - Bug 14968 - Keep found column from reserve not ok 62 - Bug 14464 - No fines after cancelling reserve with no charge configured ok 63 - Bug 14464 - 2nd reserve correctly created not ok 64 - Bug 14464 - No fines after cancelling reserve with no charge desired ok 65 - Bug 14464 - 1st reserve correctly created not ok 66 - Bug 14464 - Fine applied after cancelling reserve with charge desired and configured 4. Apply patch 5. perl t/db_dependent/Reserves.t 6. Observe test pass
Lari, good catch. But still fail for me: Tag "" is not a valid tag. at t/db_dependent/Reserves.t line 510.
There is already an use_ok in the Reserves test. If you add another use, maybe change use_ok to require_ok ? Did the same somewhere else..
(In reply to Marcel de Rooy from comment #5) > There is already an use_ok in the Reserves test. > If you add another use, maybe change use_ok to require_ok ? > Did the same somewhere else.. Since we have tests for these modules, I am not sure the use_ok are really useful.
Created attachment 57127 [details] [review] Bug 17539: Fix Undefined subroutine &C4::Circulation::GetItem error perl t/db_dependent/Reserves.t 1..72 ok 1 - use C4::Reserves; ok 2 - CheckReserves Test 1 ok 3 - CheckReserves() include reserve_id in its response ok 4 - CheckReserves Test 2 ok 5 - CheckReserves Test 3 ok 6 - GetReservesControlBranch returns item home branch when set to ItemHomeLibrary ok 7 - GetReservesControlBranch returns patron home branch when set to PatronLibrary ok 8 - Item is correctly waiting ok 9 - Item is correctly priority 1 ok 10 - Item is correctly priority 2 ok 11 - GetWaiting got only the waiting reserve ok 12 - GetWaiting got the reserve for the correct borrower Undefined subroutine &C4::Circulation::GetItem called at /home/ubuntu/kohaclone/C4/Circulation.pm line 1853. This patch fixes this error. The solution was to use C4::Reserves before C4::Items. Also due to this edit, change use_ok to require_ok
Created attachment 57128 [details] [review] Bug 17539: Fix Already in a transaction error perl t/db_dependent/Reserves.t 1..72 ok 1 - use C4::Reserves; ok 2 - CheckReserves Test 1 ... ok 52 - Reserve in waiting status cant be canceled ok 53 - Reserving an ageRestricted Biblio without a borrower dateofbirth succeeds DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489. DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489. at /usr/share/perl5/DBIx/Class/Schema.pm line 1080. ... Koha::Object::store('Koha::Patron=HASH(0x9e43b20)') called at /home/ubuntu/kohaclone/C4/Members.pm line 542 C4::Members::ModMember('borrowernumber', 658535, 'dateofbirth', '2001-11-02') called at t/db_dependent/Reserves.t line 516 This patch fixes this issue by replacing dbh autocommit=0 with txn_begin.
Created attachment 57129 [details] [review] Bug 17539: Fix failing Reserves.t tests if category enrolmentfee > 0 To test: 1. Set patron category "S" with enrolmentfee 1 2. perl t/db_dependent/Reserves.t 3. Observe following errors: not ok 59 - Bug 14464 - No fines at beginning ok 60 - Bug 14464 - 1st reserve correctly created ok 61 - Bug 14968 - Keep found column from reserve not ok 62 - Bug 14464 - No fines after cancelling reserve with no charge configured ok 63 - Bug 14464 - 2nd reserve correctly created not ok 64 - Bug 14464 - No fines after cancelling reserve with no charge desired ok 65 - Bug 14464 - 1st reserve correctly created not ok 66 - Bug 14464 - Fine applied after cancelling reserve with charge desired and configured 4. Apply patch 5. perl t/db_dependent/Reserves.t 6. Observe test pass
(In reply to Jonathan Druart from comment #4) > Lari, good catch. > But still fail for me: > Tag "" is not a valid tag. at t/db_dependent/Reserves.t line 510. Strange! For me it seems to be working. Just a guess, could it be issue with caching as warned at lines 57-58, that set the kohafield for line 509: 57: # Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached 58: $dbh->do("update marc_subfield_structure set kohafield='biblioitems.agerestriction' where tagfield='521' and tagsubfield='a'"); ... 509: my ( $ageres_tagid, $ageres_subfieldid ) = GetMarcFromKohaField( "biblioitems.agerestriction" ); 510: $record->append_fields( MARC::Field->new($ageres_tagid, '', '', $ageres_subfieldid => 'PEGI 16') ); (In reply to Marcel de Rooy from comment #5) > There is already an use_ok in the Reserves test. > If you add another use, maybe change use_ok to require_ok ? > Did the same somewhere else.. I squashed this into the first patch. Thanks!
(In reply to Lari Taskula from comment #10) > Strange! For me it seems to be working. Did not see that one too yesterday..
Created attachment 57134 [details] [review] Bug 17539: Fix Undefined subroutine &C4::Circulation::GetItem error perl t/db_dependent/Reserves.t 1..72 ok 1 - use C4::Reserves; ok 2 - CheckReserves Test 1 ok 3 - CheckReserves() include reserve_id in its response ok 4 - CheckReserves Test 2 ok 5 - CheckReserves Test 3 ok 6 - GetReservesControlBranch returns item home branch when set to ItemHomeLibrary ok 7 - GetReservesControlBranch returns patron home branch when set to PatronLibrary ok 8 - Item is correctly waiting ok 9 - Item is correctly priority 1 ok 10 - Item is correctly priority 2 ok 11 - GetWaiting got only the waiting reserve ok 12 - GetWaiting got the reserve for the correct borrower Undefined subroutine &C4::Circulation::GetItem called at /home/ubuntu/kohaclone/C4/Circulation.pm line 1853. This patch fixes this error. The solution was to use C4::Reserves before C4::Items. Also due to this edit, change use_ok to require_ok Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 57135 [details] [review] Bug 17539: Fix Already in a transaction error perl t/db_dependent/Reserves.t 1..72 ok 1 - use C4::Reserves; ok 2 - CheckReserves Test 1 ... ok 52 - Reserve in waiting status cant be canceled ok 53 - Reserving an ageRestricted Biblio without a borrower dateofbirth succeeds DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489. DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489. at /usr/share/perl5/DBIx/Class/Schema.pm line 1080. ... Koha::Object::store('Koha::Patron=HASH(0x9e43b20)') called at /home/ubuntu/kohaclone/C4/Members.pm line 542 C4::Members::ModMember('borrowernumber', 658535, 'dateofbirth', '2001-11-02') called at t/db_dependent/Reserves.t line 516 This patch fixes this issue by replacing dbh autocommit=0 with txn_begin. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 57136 [details] [review] Bug 17539: Fix failing Reserves.t tests if category enrolmentfee > 0 To test: 1. Set patron category "S" with enrolmentfee 1 2. perl t/db_dependent/Reserves.t 3. Observe following errors: not ok 59 - Bug 14464 - No fines at beginning ok 60 - Bug 14464 - 1st reserve correctly created ok 61 - Bug 14968 - Keep found column from reserve not ok 62 - Bug 14464 - No fines after cancelling reserve with no charge configured ok 63 - Bug 14464 - 2nd reserve correctly created not ok 64 - Bug 14464 - No fines after cancelling reserve with no charge desired ok 65 - Bug 14464 - 1st reserve correctly created not ok 66 - Bug 14464 - Fine applied after cancelling reserve with charge desired and configured 4. Apply patch 5. perl t/db_dependent/Reserves.t 6. Observe test pass Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 57137 [details] [review] Bug 17539: (QA followup) Silence warnings Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 57151 [details] [review] Bug 17539: Fix Undefined subroutine &C4::Circulation::GetItem error perl t/db_dependent/Reserves.t 1..72 ok 1 - use C4::Reserves; ok 2 - CheckReserves Test 1 ok 3 - CheckReserves() include reserve_id in its response ok 4 - CheckReserves Test 2 ok 5 - CheckReserves Test 3 ok 6 - GetReservesControlBranch returns item home branch when set to ItemHomeLibrary ok 7 - GetReservesControlBranch returns patron home branch when set to PatronLibrary ok 8 - Item is correctly waiting ok 9 - Item is correctly priority 1 ok 10 - Item is correctly priority 2 ok 11 - GetWaiting got only the waiting reserve ok 12 - GetWaiting got the reserve for the correct borrower Undefined subroutine &C4::Circulation::GetItem called at /home/ubuntu/kohaclone/C4/Circulation.pm line 1853. This patch fixes this error. The solution was to use C4::Reserves before C4::Items. Also due to this edit, change use_ok to require_ok Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 57152 [details] [review] Bug 17539: Fix Already in a transaction error perl t/db_dependent/Reserves.t 1..72 ok 1 - use C4::Reserves; ok 2 - CheckReserves Test 1 ... ok 52 - Reserve in waiting status cant be canceled ok 53 - Reserving an ageRestricted Biblio without a borrower dateofbirth succeeds DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489. DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489. at /usr/share/perl5/DBIx/Class/Schema.pm line 1080. ... Koha::Object::store('Koha::Patron=HASH(0x9e43b20)') called at /home/ubuntu/kohaclone/C4/Members.pm line 542 C4::Members::ModMember('borrowernumber', 658535, 'dateofbirth', '2001-11-02') called at t/db_dependent/Reserves.t line 516 This patch fixes this issue by replacing dbh autocommit=0 with txn_begin. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 57153 [details] [review] Bug 17539: Fix failing Reserves.t tests if category enrolmentfee > 0 To test: 1. Set patron category "S" with enrolmentfee 1 2. perl t/db_dependent/Reserves.t 3. Observe following errors: not ok 59 - Bug 14464 - No fines at beginning ok 60 - Bug 14464 - 1st reserve correctly created ok 61 - Bug 14968 - Keep found column from reserve not ok 62 - Bug 14464 - No fines after cancelling reserve with no charge configured ok 63 - Bug 14464 - 2nd reserve correctly created not ok 64 - Bug 14464 - No fines after cancelling reserve with no charge desired ok 65 - Bug 14464 - 1st reserve correctly created not ok 66 - Bug 14464 - Fine applied after cancelling reserve with charge desired and configured 4. Apply patch 5. perl t/db_dependent/Reserves.t 6. Observe test pass Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 57154 [details] [review] Bug 17539: (QA followup) Silence warnings Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 57155 [details] [review] Bug 17539: [QA Follow-up] Move handle after schema Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Ok so I tried it again: It pass with an usual install (using the interface), but it did not with the new populate_db.pl script. The bug is somewhere else, sorry!
(In reply to Jonathan Druart from comment #21) > Ok so I tried it again: > It pass with an usual install (using the interface), but it did not with the > new populate_db.pl script. > The bug is somewhere else, sorry! Argh, actually I cannot recreate with populate_db.pl neither!
Pushed to master for 16.11, thanks Lari, Tomas, Marcel!
I did a full prove t/db_dependent, and got: t/db_dependent/Reserves.t ................................ 28/72 C4::Context->userenv not defined! at /home/vagrant/kohaclone/C4/Items.pm line 2267. Use of uninitialized value $tagno in concatenation (.) or string at /usr/share/perl5/MARC/Field.pm line 83. Tag "" is not a valid tag. at t/db_dependent/Reserves.t line 526. # Looks like your test exited with 255 just after 52. t/db_dependent/Reserves.t ................................ Dubious, test returned 255 (wstat 65280, 0xff00) Just after, trying to recreate: prove t/db_dependent/Reserves.t t/db_dependent/Reserves.t .. 1/72 C4::Context->userenv not defined! at /home/vagrant/kohaclone/C4/Items.pm line 2267. t/db_dependent/Reserves.t .. ok All tests successful. Files=1, Tests=72, 3 wallclock secs ( 0.02 usr 0.01 sys + 1.42 cusr 0.78 csys = 2.23 CPU) Result: PASS
(In reply to Jonathan Druart from comment #24) > I did a full prove t/db_dependent, and got: > > t/db_dependent/Reserves.t ................................ 28/72 > C4::Context->userenv not defined! at /home/vagrant/kohaclone/C4/Items.pm > line 2267. > Use of uninitialized value $tagno in concatenation (.) or string at > /usr/share/perl5/MARC/Field.pm line 83. > Tag "" is not a valid tag. at t/db_dependent/Reserves.t line 526. > # Looks like your test exited with 255 just after 52. > t/db_dependent/Reserves.t ................................ Dubious, test > returned 255 (wstat 65280, 0xff00) > > Just after, trying to recreate: > prove t/db_dependent/Reserves.t > t/db_dependent/Reserves.t .. 1/72 C4::Context->userenv not defined! at > /home/vagrant/kohaclone/C4/Items.pm line 2267. > t/db_dependent/Reserves.t .. ok > All tests successful. > Files=1, Tests=72, 3 wallclock secs ( 0.02 usr 0.01 sys + 1.42 cusr 0.78 > csys = 2.23 CPU) > Result: PASS What is the connection between these issues and the use of kohadevbox ?
Jenkins doesn't use kohadevbox and shows the same behavior.