[Bug 9209] New: Mocked Koha::Calendar tests
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Bug ID: 9209 Summary: Mocked Koha::Calendar tests 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: tomascohen@gmail.com Using specific method for populating the internal data structures from Koha::Calendar has yielded to the non-detection of several bugs. There are also several tests that where db_dependent which is not always desirable. I propose the use of DBD::Mock (::Session) for using the actual code used by Koha in production for testing, mocking the DB queries itselves. I also took the time to repeat several tests in different syspref configurations (they applied only to daysMode=Calendar, and now cover all confs). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored Assignee|gmcharlt@gmail.com |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 13885 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=13885&action=edit Bug 9209 - Mocked Koha::Calendar tests Using specific method for populating the internal data structures from Koha::Calendar has yielded to the non-detection of several bugs. There are also several tests that where db_dependent which is not always desirable. I propose the use of DBD::Mock (::Session) for using the actual code used by Koha in production for testing, mocking the DB queries itselves. I also took the time to repeat several tests in different syspref configurations (they applied only to daysMode=Calendar, and now cover all confs). Notes: - I used DBD:Mock 1.45 as previous version (1.43, from 12.04) was broken - Some tests revealed a bug on days_between as I see it... reporting as Bug #9211 Sponsored-by: Universidad Nacional de Córdoba -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Elliott Davis <elliott@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |elliott@bywatersolutions.co | |m --- Comment #2 from Elliott Davis <elliott@bywatersolutions.com> --- Looks like the parameter flip isn't returning the desired behavior. I believe you have addressed the bug in 9211. t/Calendar.t .. 1/35 # Failed test 'Test parameter order not relevant (Days)' # at t/Calendar.t line 240. # got: 56 # expected: 40 # Failed test 'Test parameter order not relevant (Calendar)' # at t/Calendar.t line 280. # got: 56 # expected: 40 # Failed test 'Test parameter order not relevant (Days)' # at t/Calendar.t line 319. # got: 56 # expected: 40 # Looks like you failed 3 tests of 35. t/Calendar.t .. Dubious, test returned 3 (wstat 768, 0x300) Failed 3/35 subtests Test Summary Report ------------------- t/Calendar.t (Wstat: 768 Tests: 35 Failed: 3) Failed tests: 23, 29, 35 Non-zero exit status: 3 Files=1, Tests=35, 1 wallclock secs ( 0.01 usr 0.01 sys + 0.37 cusr 0.01 csys = 0.40 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=9209 Elliott Davis <elliott@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #13885|0 |1 is obsolete| | --- Comment #3 from Elliott Davis <elliott@bywatersolutions.com> --- Created attachment 13932 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=13932&action=edit Bug 9209 - Mocked Koha::Calendar tests Using specific method for populating the internal data structures from Koha::Calendar has yielded to the non-detection of several bugs. There are also several tests that where db_dependent which is not always desirable. I propose the use of DBD::Mock (::Session) for using the actual code used by Koha in production for testing, mocking the DB queries itselves. I also took the time to repeat several tests in different syspref configurations (they applied only to daysMode=Calendar, and now cover all confs). Notes: - I used DBD:Mock 1.45 as previous version (1.43, from 12.04) was broken - Some tests revealed a bug on days_between as I see it... reporting as Bug #9211 Sponsored-by: Universidad Nacional de Córdoba Signed-off-by: Elliott Davis <elliott@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |9211 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Are all tests supposed to pass with success ? I get 11 test fails. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to comment #4)
Are all tests supposed to pass with success ? I get 11 test fails.
Please check you have the latest DBD::Mock via CPAN as 1.43 had issues. There should be three tests failing, addressed by 9211 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.poulain@biblibre.com QA Contact| |paul.poulain@biblibre.com --- Comment #6 from Paul Poulain <paul.poulain@biblibre.com> --- (In reply to comment #5)
(In reply to comment #4)
Are all tests supposed to pass with success ? I get 11 test fails.
Please check you have the latest DBD::Mock via CPAN as 1.43 had issues. There should be three tests failing, addressed by 9211
Which issues have you seen ? DBD::Mock was used until now without any problem, unless i'm wrong. So more details are required before I can QA this patch (i've tested it and confirm i've 11 tests failing on my ubuntu 12.04, as joubu had) is it working on a debian stable without manual configuration ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 --- Comment #7 from Paul Poulain <paul.poulain@biblibre.com> --- (In reply to comment #6)
without manual configuration ?
s/without manual configuration/without manual cpan install/ -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 --- Comment #8 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to comment #6)
(In reply to comment #5)
(In reply to comment #4)
Are all tests supposed to pass with success ? I get 11 test fails.
Please check you have the latest DBD::Mock via CPAN as 1.43 had issues. There should be three tests failing, addressed by 9211
Which issues have you seen ? DBD::Mock was used until now without any problem, unless i'm wrong.
You are not wrong, the problem is related to DBD::Mock::Session and fetchrow_hashref together I guess. https://rt.cpan.org/Public/Bug/Display.html?id=71438 Please check which version of DBD::Mock are you using. If it is 1.43, then maybe that's the problem. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Same for me - 1.43 and 11 tests failing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Not sure how to fix this - maybe we could comment out the tests that are broken now and reactivate them later when a new version is available? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 --- Comment #11 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- Created attachment 14305 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14305&action=edit Bug 9209: Skip tests for older DBD::Mock Because the calendar tests require a more recent version of DBD::Mock than has been packaged by Debian, it makes sense to skip all the tests requiring the database when only an older version is present. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 --- Comment #12 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- The test plan for the follow-up is the same as for the original: run `prove t/Calendar.t`. If you have a version of DBD::Mock older than 1.45, all the tests will be skipped once the follow-up is applied. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Liz Rea (CatalystIT) <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #14305|0 |1 is obsolete| | --- Comment #13 from Liz Rea (CatalystIT) <liz@catalyst.net.nz> --- Created attachment 14306 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=14306&action=edit Bug 9209: Skip tests for older DBD::Mock Because the calendar tests require a more recent version of DBD::Mock than has been packaged by Debian, it makes sense to skip all the tests requiring the database when only an older version is present. Signed-off-by: Liz Rea <liz@catalyst.net.nz> Works as advertised -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Liz Rea (CatalystIT) <liz@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |liz@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #14 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- Although I would not usually do this, since QAing these patches presents a problem for the QA team, and I am able to, I am going to go ahead and mark these patches as Passed QA. The test is now a no-op for systems that do not have DBD::Mock installed from CPAN and so are safe, and without them we will have no way to spot if further work on the calendar code breaks things. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Jared Camins-Esakov <jcamins@cpbibliography.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #15 from Jared Camins-Esakov <jcamins@cpbibliography.com> --- This patch has been pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #16 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.10.x will be in 3.10.2 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9209 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |11061 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org