[Bug 10336] New: UT: HoldsQueue.t needs to create its own data
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Bug ID: 10336 Summary: UT: HoldsQueue.t needs to create its own data Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: gmcharlt@gmail.com Reporter: jonathan.druart@biblibre.com t/db_dependent/HoldsQueue.t depends on the Jenkins database. We should create the data we want and delete them at the end. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Blocks| |10273 Assignee|gmcharlt@gmail.com |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 18388 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18388&action=edit WIP: HoldsQueue.t needs to create its own data -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- Hi Kyle, I tried to pass HoldsQueue unit tests but I am not able to do :-/ The idea is to create all data the tests need before launching them in order not to be dependent on the Jenkins database. Could you take a look at it please? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- I create a new database containing sample data with script submitted on bug 10337. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff CC| |kyle.m.hall@gmail.com --- Comment #4 from Kyle M Hall <kyle.m.hall@gmail.com> --- Looks like this needs updated a bit. perl t/db_dependent/HoldsQueue.t 1..18 ok 1 - use C4::Reserves; ok 2 - use C4::HoldsQueue; Type of arg 1 to keys must be hash (not subroutine entry) at t/db_dependent/HoldsQueue.t line 42, near "GetBranches;" Execution of t/db_dependent/HoldsQueue.t aborted due to compilation errors. # Looks like you planned 18 tests but ran 2. # Looks like your test exited with 255 just after 2. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to comment #4)
Looks like this needs updated a bit.
Kyle, did you seen my comment 2? :) Do you plan to work on it? That would be really good if this file passes all the tests. I managed to pass all tests from all others files, but not these ones. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 --- Comment #6 from Kyle M Hall <kyle.m.hall@gmail.com> --- I read it, but I didn't fully understand it until today. I should have noticed the WIP in the title. I hadn't planned on working on this. If I can get some free time I'd be more than happy to assist! However, I cannot say when that may be. (In reply to comment #5)
(In reply to comment #4)
Looks like this needs updated a bit.
Kyle, did you seen my comment 2? :) Do you plan to work on it? That would be really good if this file passes all the tests. I managed to pass all tests from all others files, but not these ones.
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 --- Comment #7 from Galen Charlton <gmcharlt@gmail.com> --- Comment on attachment 18388 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18388 WIP: HoldsQueue.t needs to create its own data Review of attachment 18388: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=10336&attachment=18388) ----------------------------------------------------------------- ::: t/db_dependent/HoldsQueue.t @@ +35,5 @@
+ branchcode => 'CPL', +); + +my $borrowernumber = AddMember(%data); +my $borrower = GetMember( borrowernumber => $borrowernumber );
Looks good -- this also removes the requirement that there be at least one item on loan in the database, which isn't relevant to the functionality being tested. @@ +51,2 @@
$dbh->{AutoCommit} = 0; $dbh->{RaiseError} = 1;
This section should be moved to before the call to AddMember. That way, we don't need to call DelMember to clean up; the rollback will take care of that. @@ +153,5 @@
$dbh->rollback;
+END { + C4::Members::DelMember( $borrowernumber ); +};
Not needed -- see above comment. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18388|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 19167 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19167&action=edit WIP: HoldsQueue.t needs to create its own data -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- Thanks Galen! Unfortunately, 2 tests still don't pass. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gmcharlt@gmail.com --- Comment #10 from Galen Charlton <gmcharlt@gmail.com> --- (In reply to comment #9)
Unfortunately, 2 tests still don't pass.
Bug 10495 may be relevant. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |10495 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 --- Comment #11 from Galen Charlton <gmcharlt@gmail.com> --- Please see my comment in bug 10495. If you attach a non-WIP version of your patch, I'm ready to test it and sign off on it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19167|0 |1 is obsolete| | --- Comment #12 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 19177 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19177&action=edit Bug 10336: HoldsQueue.t needs to create its own data After applying this patch and the patch submitted in bug 10495, you can run prove t/db_dependent/HoldsQueue.t and admire that all tests pass. This patch creates a borrower and uses Koha routines instead of directly request the database. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #13 from Kyle M Hall <kyle@bywatersolutions.com> --- (In reply to comment #12)
Created attachment 19177 [details] [review] Bug 10336: HoldsQueue.t needs to create its own data
After applying this patch and the patch submitted in bug 10495, you can run prove t/db_dependent/HoldsQueue.t and admire that all tests pass.
This patch creates a borrower and uses Koha routines instead of directly request the database.
Then I apply both patches and run HoldsQueue.t, I get the following error: perl t/db_dependent/HoldsQueue.t 1..18 ok 1 - use C4::Reserves; ok 2 - use C4::HoldsQueue; Type of arg 1 to keys must be hash (not subroutine entry) at t/db_dependent/HoldsQueue.t line 47, near "GetBranches;" Execution of t/db_dependent/HoldsQueue.t aborted due to compilation errors. # Looks like you planned 18 tests but ran 2. # Looks like your test exited with 255 just after 2. And this: prove t/db_dependent/HoldsQueue.t t/db_dependent/HoldsQueue.t .. 1/18 Type of arg 1 to keys must be hash (not subroutine entry) at t/db_dependent/HoldsQueue.t line 47, near "GetBranches;" Execution of t/db_dependent/HoldsQueue.t aborted due to compilation errors. # Looks like you planned 18 tests but ran 2. # Looks like your test exited with 255 just after 2. t/db_dependent/HoldsQueue.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 16/18 subtests Test Summary Report ------------------- t/db_dependent/HoldsQueue.t (Wstat: 65280 Tests: 2 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 18 tests but ran 2. Files=1, Tests=2, 1 wallclock secs ( 0.02 usr 0.01 sys + 0.60 cusr 0.05 csys = 0.68 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19177|0 |1 is obsolete| | --- Comment #14 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 19179 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19179&action=edit Bug 10336: HoldsQueue.t needs to create its own data After applying this patch and the patch submitted in bug 10495, you can run prove t/db_dependent/HoldsQueue.t and admire that all tests pass. This patch creates a borrower and uses Koha routines instead of directly request the database. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 --- Comment #15 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to comment #13)
Type of arg 1 to keys must be hash (not subroutine entry) at t/db_dependent/HoldsQueue.t line 47, near "GetBranches;"
It's certainly caused by the perl version (I am using v.5.14). Could you try again with the last patch please? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19179|0 |1 is obsolete| | --- Comment #16 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 19191 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19191&action=edit Bug 10336: HoldsQueue.t needs to create its own data After applying this patch and the patch submitted in bug 10495, you can run prove t/db_dependent/HoldsQueue.t and admire that all tests pass. This patch creates a borrower and uses Koha routines instead of directly request the database. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #19191|0 |1 is obsolete| | --- Comment #17 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 19256 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19256&action=edit Bug 10336: HoldsQueue.t needs to create its own data After applying this patch and the patch submitted in bug 10495, you can run prove t/db_dependent/HoldsQueue.t and admire that all tests pass. This patch creates a borrower and uses Koha routines instead of directly request the database. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #18 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |tomascohen@gmail.com --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This patch has been pushed to 3.12.x, will be in 3.12.2. Thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10336 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bgkriegel@gmail.com --- Comment #20 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Pushed to 3.10.x, will be in 3.10.8 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org