Bug 5327 - Omnibus for unit tests required for all C4 modules
Summary: Omnibus for unit tests required for all C4 modules
Status: RESOLVED MOVED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P3 enhancement (vote)
Assignee: Bart Jorgensen
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on: 8728
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-30 03:26 UTC by Katrin Fischer
Modified: 2015-03-18 14:23 UTC (History)
18 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
adds some basic unit tests (11.93 KB, patch)
2010-10-30 03:48 UTC, Katrin Fischer
Details | Diff | Splinter Review
more basic unit tests to C4 modules (16.27 KB, patch)
2010-10-31 21:06 UTC, Katrin Fischer
Details | Diff | Splinter Review
fix whitespace in the test (1016 bytes, patch)
2011-09-20 22:08 UTC, Maxime Pelletier
Details | Diff | Splinter Review
Bug 5327 : Adding more unit tests (3.41 KB, patch)
2011-11-06 07:01 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 5327 : Adding more unit tests (1.50 KB, patch)
2011-11-06 07:25 UTC, Chris Cormack
Details | Diff | Splinter Review
Adds missing case for boolean unit tests, adds in actual unit tests for barkertaylor (2.94 KB, patch)
2011-11-22 00:29 UTC, Chris Hall
Details | Diff | Splinter Review
Bug 5327: Unit tests for C4/Exteral/BakerTaylor.pm (2.62 KB, patch)
2011-12-04 06:54 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 5327 : Complete coverage for BackgroundJob.pm (994 bytes, patch)
2011-12-04 07:03 UTC, Chris Cormack
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5327 : Adding more unit tests (1.60 KB, patch)
2011-12-04 07:12 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5327 : Complete coverage for BackgroundJob.pm (1.07 KB, patch)
2011-12-04 07:12 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 5327 : Fixing unit test for SQLHelper.pm (1.90 KB, patch)
2011-12-06 20:18 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 5327 : Fixing unit test for SQLHelper.pm (2.06 KB, patch)
2011-12-06 20:20 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 5327: Fixing the Members.t test (658 bytes, patch)
2011-12-06 21:10 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 5327: Fixing the Members.t test (1.25 KB, patch)
2011-12-06 21:46 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 5327 : Fixing unit test for SQLHelper.pm (2.18 KB, patch)
2011-12-06 21:51 UTC, Liz Rea
Details | Diff | Splinter Review
[Signed off] Bug 5327: Fixing the Members.t test (790 bytes, patch)
2011-12-06 21:53 UTC, Liz Rea
Details | Diff | Splinter Review
Patch to increase boolean.t coverage (866 bytes, patch)
2011-12-07 20:37 UTC, Chris Hall
Details | Diff | Splinter Review
Bug 5327 - fixing t/db_dependent/Record.t to not fail because of whitespace. (1.41 KB, patch)
2011-12-07 22:54 UTC, Liz Rea
Details | Diff | Splinter Review
Unit test for SIP/Sip/Checksum.pm (1.42 KB, patch)
2011-12-08 01:49 UTC, Duncan
Details | Diff | Splinter Review
Test for AuthoritiesMarc/UNIMARC.pm (829 bytes, patch)
2011-12-08 19:58 UTC, Duncan
Details | Diff | Splinter Review
Added unit test for Scrubber.pm (2.01 KB, patch)
2011-12-08 21:21 UTC, Duncan
Details | Diff | Splinter Review
Patch removes unneeded self=shift from TTParser::unshift_token (639 bytes, patch)
2011-12-08 22:06 UTC, Chris Hall
Details | Diff | Splinter Review
Added test coverage for TTParser (957 bytes, patch)
2011-12-08 22:33 UTC, Duncan
Details | Diff | Splinter Review
Added missing reference case to Boolean.t and corrected count (917 bytes, patch)
2011-12-13 07:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Added unit tests for Sip Checksum.pm (1.54 KB, patch)
2011-12-13 07:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Added unit test for AuthoritiesMarc/UNIMARC.pm (962 bytes, patch)
2011-12-13 07:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Added unit tests for Scrubber (2.14 KB, patch)
2011-12-13 07:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5327: Patch removes unneeded self=shift from TTParser::unshift_token (837 bytes, patch)
2011-12-13 07:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Added coverage to unit test for TTParser (1.06 KB, patch)
2011-12-13 07:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Added missing reference case to Boolean.t and corrected count (1000 bytes, patch)
2011-12-13 07:09 UTC, Katrin Fischer
Details | Diff | Splinter Review
Unit test for SIP/ILS/Transaction/RenewAll.pm (1.14 KB, patch)
2011-12-14 19:51 UTC, Duncan
Details | Diff | Splinter Review
Patch to move SIP_ILS.t to db_dependent (2.27 KB, patch)
2011-12-15 03:27 UTC, Duncan
Details | Diff | Splinter Review
[SINGED-OFF] Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm (1.34 KB, patch)
2011-12-15 06:21 UTC, Katrin Fischer
Details | Diff | Splinter Review
Corrected findbin path for SIP_ILS bug 5327 (684 bytes, patch)
2011-12-15 19:49 UTC, Duncan
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm (1.34 KB, patch)
2011-12-16 06:00 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5327: Moving SIP_ILS.t to db_dependent (851 bytes, patch)
2011-12-16 06:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5327: Corrected findbin path for SIP_ILS bug 5327 (791 bytes, patch)
2011-12-16 06:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm (2.02 KB, patch)
2011-12-16 14:43 UTC, Paul Poulain
Details | Diff | Splinter Review
Added unit tests for C4/Utils (670 bytes, patch)
2012-01-17 01:00 UTC, Sam Sanders
Details | Diff | Splinter Review
added unit tests for Classsortroutine/Generic (1011 bytes, patch)
2012-01-17 01:02 UTC, Connor Dewar
Details | Diff | Splinter Review
Added unit tests for C4/ClassSortRoutine/LCC.pm (1.55 KB, patch)
2012-01-17 01:27 UTC, Sam Sanders
Details | Diff | Splinter Review
added unit tests for C4/ClassSortRoutine/Dewey.pm (1.32 KB, patch)
2012-01-17 01:34 UTC, Connor Dewar
Details | Diff | Splinter Review
Bug 5327 added unit tests for C4/ClassSortRoutine/Generic (1.03 KB, patch)
2012-01-17 01:39 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 5327 added unit tests for C4/Utils (722 bytes, patch)
2012-01-17 01:40 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 5327 added unit tests for C4/ClassSortRoutine/Generic (1.03 KB, patch)
2012-01-17 01:41 UTC, Chris Cormack
Details | Diff | Splinter Review
bug 5327 add tests for C4/ClassSortRoutine/LCC.pm (1.59 KB, patch)
2012-01-17 01:44 UTC, Chris Cormack
Details | Diff | Splinter Review
bug 5327 add tests for C4/ClassSortRoutine/LCC.pm (1.59 KB, patch)
2012-01-17 01:45 UTC, Chris Cormack
Details | Diff | Splinter Review
bug 5327 add tests for C4/ClassSortRoutine/LCC.pm (1.59 KB, patch)
2012-01-17 01:46 UTC, Chris Cormack
Details | Diff | Splinter Review
[SIGNED-OFF] bug 5327 add tests for C4/ClassSortRoutine/LCC.pm (1.61 KB, patch)
2012-01-17 01:46 UTC, Chris Cormack
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5327 Added unit tests for C4/ClassSortRoutine/Dewey.pm (1.39 KB, patch)
2012-01-17 01:49 UTC, Chris Cormack
Details | Diff | Splinter Review
tests for C4/BackgroundJob.pm (1.75 KB, patch)
2012-01-17 02:41 UTC, Sam Sanders
Details | Diff | Splinter Review
added unit tests for C4/Reports.pm (703 bytes, patch)
2012-01-17 02:42 UTC, Connor Dewar
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5327 Added unit tests for C4/Reports.pm (832 bytes, patch)
2012-01-17 06:52 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] bug 5327 add tests for C4/BackgroundJob.pm (1.95 KB, patch)
2012-01-17 06:57 UTC, Katrin Fischer
Details | Diff | Splinter Review
Added unit tests for C4/ClassSortRoutine/LCC.pm (1.54 KB, patch)
2012-01-17 20:43 UTC, Sam Sanders
Details | Diff | Splinter Review
Added unit tests for C4/Koha.pm (2.65 KB, patch)
2012-01-17 22:52 UTC, Sam Sanders
Details | Diff | Splinter Review
added unit tests for C4/SIP/ILS/Transaction/Renew.pm (793 bytes, patch)
2012-01-18 02:37 UTC, Connor Dewar
Details | Diff | Splinter Review
Added unit tests for C4/Ris (951 bytes, patch)
2012-01-18 02:41 UTC, Sam Sanders
Details | Diff | Splinter Review
Added unit tests for C4/AuthoritiesMarc/MARC21.pm (1.16 KB, patch)
2012-01-18 22:06 UTC, Jono Mingard
Details | Diff | Splinter Review
Added unit tests for C4/Search/PazPar2.pm (1.16 KB, patch)
2012-01-18 22:30 UTC, Kate Henderson
Details | Diff | Splinter Review
added unit tests for C4/TmplToken.pm (1.72 KB, patch)
2012-01-18 23:23 UTC, Bart Jorgensen
Details | Diff | Splinter Review
added unit test for C4/Barcodes/PrinterConfig.pm (1.29 KB, patch)
2012-01-18 23:33 UTC, Jorgia
Details | Diff | Splinter Review
tests for C4/Label.pm (1.07 KB, patch)
2012-01-19 00:57 UTC, Sam Sanders
Details | Diff | Splinter Review
Added unit tests for C4/Languages.pm (854 bytes, patch)
2012-01-19 01:20 UTC, Sam Sanders
Details | Diff | Splinter Review
Added unit tests for C4/Creators/PDF.pm (1.82 KB, patch)
2012-01-19 01:33 UTC, Jono Mingard
Details | Diff | Splinter Review
Added unit tests for C4/Scheduler.pm (1015 bytes, patch)
2012-01-19 01:34 UTC, Kate Henderson
Details | Diff | Splinter Review
Added unit tests for C4/Csv.pm (728 bytes, patch)
2012-01-19 03:20 UTC, Sam Sanders
Details | Diff | Splinter Review
Signed off (1.13 KB, patch)
2012-01-19 03:38 UTC, Chris Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Added unit tests for C4/Csv.pm (792 bytes, patch)
2012-01-19 03:41 UTC, Chris Hall
Details | Diff | Splinter Review
[SIGNED-OFF] added unit tests for C4/Labels.pm (1.13 KB, patch)
2012-01-19 03:42 UTC, Chris Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Added unit tests for C4/AuthoritiesMarc/MARC21.pm (1.18 KB, patch)
2012-01-19 03:48 UTC, Chris Hall
Details | Diff | Splinter Review
[SIGNED-OFF] added unit test for C4/Barcodes/PrinterConfig.pm (1.36 KB, patch)
2012-01-19 03:52 UTC, Chris Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Added unit tests for C4/ClassSortRoutine/LCC.pm (1.61 KB, patch)
2012-01-19 03:55 UTC, Chris Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Added unit tests for C4/Creators/PDF.pm (1.84 KB, patch)
2012-01-19 03:58 UTC, Chris Hall
Details | Diff | Splinter Review
[SIGNED-OFF] added unit tests for C4/Ris (1015 bytes, patch)
2012-01-19 03:59 UTC, Chris Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Added unit tests for C4/Scheduler.pm (1.05 KB, patch)
2012-01-19 04:05 UTC, Chris Hall
Details | Diff | Splinter Review
Added unit tests for C4/Serials.pm (3.11 KB, patch)
2012-01-19 04:06 UTC, Sam Sanders
Details | Diff | Splinter Review
[SIGNED-OFF] Added unit tests for C4/Search/PazPar2.pm (1.22 KB, patch)
2012-01-19 04:07 UTC, Chris Hall
Details | Diff | Splinter Review
[SIGNED-OFF] added unit tests for C4/TmplToken.pm (1.78 KB, patch)
2012-01-19 04:09 UTC, Chris Hall
Details | Diff | Splinter Review
[SIGNED-OFF] added unit tests for C4/SIP/ILS/Transaction/Renew.pm (857 bytes, patch)
2012-01-19 04:11 UTC, Chris Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Added unit tests for C4/Languages.pm (918 bytes, patch)
2012-01-19 04:14 UTC, Chris Hall
Details | Diff | Splinter Review
Bug 5327: Shifting a db dependent test to the right place (514 bytes, patch)
2012-01-31 20:56 UTC, Chris Cormack
Details | Diff | Splinter Review
Merge remote-tracking branch 'origin/new/bug_5327' (17.73 KB, patch)
2012-02-01 00:41 UTC, Robin Sheat
Details | Diff | Splinter Review
Bug 5327: Shifting a db dependent test to the right place (565 bytes, patch)
2012-02-01 00:43 UTC, Robin Sheat
Details | Diff | Splinter Review
Bug 5327 - move another test around (464 bytes, patch)
2012-02-01 01:14 UTC, Robin Sheat
Details | Diff | Splinter Review
Bug 5327 : Removing a broken test (764 bytes, patch)
2012-02-10 22:10 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 5327: Patch removes unneeded self=shift from TTParser::unshift_token (929 bytes, patch)
2012-02-12 19:45 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Added coverage to unit test for TTParser (1.16 KB, patch)
2012-02-12 19:45 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 5327 : Removing a broken test (870 bytes, patch)
2012-02-12 19:46 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 5327 : Fix for XISBN test, thingisbn is now handing back different results (737 bytes, patch)
2012-06-01 22:30 UTC, Chris Cormack
Details | Diff | Splinter Review
Added some C4/Items.pm tests (2.68 KB, patch)
2012-06-11 16:14 UTC, stacey
Details | Diff | Splinter Review
bug 5327: added some tests for C4/Items.pm (2.78 KB, patch)
2012-07-02 17:30 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
t/Koha.t (2.86 KB, patch)
2012-07-06 02:45 UTC, Mason James
Details | Diff | Splinter Review
Bug 5327 - Unit tests required for all C4 modules (7.07 KB, patch)
2012-07-06 03:46 UTC, Mason James
Details | Diff | Splinter Review
Added coverage to unit test for TTParser (1.46 KB, patch)
2012-07-06 03:55 UTC, Mason James
Details | Diff | Splinter Review
added date and ISBN tests to Koha.t (3.17 KB, patch)
2012-07-06 04:21 UTC, Mason James
Details | Diff | Splinter Review
Bug 5327 : Follow up for TTParser test (1.06 KB, patch)
2012-07-06 23:39 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 5327 : Unit tests for C4::ItemType (1.66 KB, patch)
2012-07-26 04:19 UTC, Chris Cormack
Details | Diff | Splinter Review
Patch of 'ItemType.t' - added a few tests (2.34 KB, patch)
2012-07-30 08:32 UTC, Bart Jorgensen
Details | Diff | Splinter Review
Bug 5327: improve t/ItemType.t (2.46 KB, patch)
2012-07-30 21:45 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 5327 follow-up: add DBD::Mock dependency (959 bytes, patch)
2012-07-30 21:45 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Changed Itemtype.t patch (2.33 KB, patch)
2012-08-02 03:52 UTC, Bart Jorgensen
Details | Diff | Splinter Review
Bug 5327 : Added a few more lines of code to the ItemType.t unit test (2.45 KB, patch)
2012-08-02 04:40 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 5327 follow-up: add DBD::Mock dependency (955 bytes, patch)
2012-08-02 04:41 UTC, Chris Cormack
Details | Diff | Splinter Review
Added tests to C4 Matcher. (2.12 KB, patch)
2012-08-02 05:06 UTC, Bart Jorgensen
Details | Diff | Splinter Review
Bug 5327 : Added a few more lines of code to the ItemType.t unit test (2.50 KB, patch)
2012-08-03 15:37 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 5327 follow-up: add DBD::Mock dependency (1.00 KB, patch)
2012-08-03 15:38 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 5327 Tests for C4::Matcher (2.17 KB, patch)
2012-08-03 15:38 UTC, Kyle M Hall
Details | Diff | Splinter Review
Added unit tests to 'Members_AttributeTypes.t' (2.51 KB, patch)
2012-08-08 09:31 UTC, Bart Jorgensen
Details | Diff | Splinter Review
Added fake db and a test (1.25 KB, patch)
2012-08-09 05:03 UTC, Bart Jorgensen
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5327 : Added a few more lines of code to the ItemType.t unit test (2.57 KB, patch)
2012-08-09 05:24 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED-QA] Bug 5327 follow-up: add DBD::Mock dependency (1.05 KB, patch)
2012-08-09 05:24 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5327 Tests for C4::Matcher (2.24 KB, patch)
2012-08-09 05:24 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Added and tested a mock-db tested a couple of features (2.63 KB, patch)
2012-08-09 05:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Added a mock-db table and tested a line (1.38 KB, patch)
2012-08-09 05:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED-QA]Bug 5327 : Added a few more lines of code to the ItemType.t unit test (2.72 KB, patch)
2012-08-09 14:29 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED-QA]Bug 5327 Tests for C4::Matcher (2.31 KB, patch)
2012-08-09 14:31 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED-QA]Added and tested a mock-db tested a couple of features (2.84 KB, patch)
2012-08-09 14:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED-QA]Added a mock-db table and tested a line (1.60 KB, patch)
2012-08-09 14:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Added unit tests to 'Installer_perlmodules' (2.11 KB, patch)
2012-08-16 05:45 UTC, Bart Jorgensen
Details | Diff | Splinter Review
Testing c4 Images (1.73 KB, patch)
2012-08-23 05:00 UTC, Bart Jorgensen
Details | Diff | Splinter Review
[PASSED-QA] Added tests to installer_perlmodules (2.21 KB, patch)
2012-08-23 05:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 5327: Testing c4 Images (1.78 KB, patch)
2012-08-23 05:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Tests C4 Social Data (1.74 KB, patch)
2012-08-23 05:48 UTC, Bart Jorgensen
Details | Diff | Splinter Review
[SIGNED OFF]Bug 5327: Unit tests for C4 socialdata (1.86 KB, patch)
2012-08-27 16:50 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 5327 : Fixing a typo in the test that was causing a false fail (1.02 KB, patch)
2012-09-05 18:30 UTC, Chris Cormack
Details | Diff | Splinter Review
[PASSED-QA] Bug 5327 : Fixing a typo in the test that was causing a false fail (1.21 KB, patch)
2012-09-05 22:43 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
[PASSED-QA]Bug 5327: Unit tests for C4 socialdata (1.84 KB, patch)
2012-09-06 10:23 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED-QA]Bug 5327: Testing c4 Images (1.76 KB, patch)
2012-09-06 10:25 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2010-10-30 03:26:42 UTC
We need more unit tests!
Comment 1 Katrin Fischer 2010-10-30 03:48:22 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2010-10-31 21:06:54 UTC Comment hidden (obsolete)
Comment 3 Daniel Latrémolière 2010-11-02 13:13:13 UTC
(In reply to comment #2)
> Created attachment 2726 [details] [review]
> more basic unit tests to C4 modules

I think that these tests fails if Perl module "Cache::Memcached::Fast" is not in Perl path, but this dependency is not referenced in file "C4/Installer/PerlDependencies.pm".

It will probably be useful to add "Cache::Memcached::Fast" to the list of dependencies in "C4/Installer/PerlDependencies.pm" with a minimal version and probably an optional status.
Comment 4 Chris Cormack 2010-11-02 18:00:35 UTC
Actually, I plan to remove the dependency of Cache::Memcached::Fast, it isn't being used by anything in Koha, and there is no immediate plans to make it be.

I will create another bug for that and remove it.
Comment 6 Chris Nighswonger 2010-11-18 03:15:04 UTC
This bug has a patch presently committed to HEAD and 3.2.x.

Please take the appropriate action to update the status of this bug.

Remember, bugs which have been resolved should be tested and marked closed, preferably by the original reporter.
Comment 7 Katrin Fischer 2010-11-23 09:36:30 UTC
At the moment all C4 modules have a basic unit test. (use)

More tests are still required.
Comment 8 Chris Nighswonger 2010-11-30 13:49:17 UTC
This bug has a fix which was committed to the 3.2.x branch and released in 3.2.1.

Please take time to update the status of this bug and mark it RESOLVED FIXED so that it may be closed.
Comment 10 Maxime Pelletier 2011-09-20 22:08:37 UTC Comment hidden (obsolete)
Comment 11 Maxime Pelletier 2011-09-20 22:09:24 UTC
(In reply to comment #10)
> Created attachment 5485 [details] [review]
> fix whitespace in the test

I meant in the t/db_dependent/Record.t test
Comment 12 Chris Cormack 2011-09-21 03:38:06 UTC
 perl t/db_dependent/Record.t 
1..10
ok 1 - use C4::Record;
ok 2 - error works
DBD::mysql::db do failed: Unknown or incorrect time zone: 'Pacific/Auckland' at C4/Context.pm line 700, <DATA> line 496.
ok 3 - testing marc2xml
ok 4 - testing marc2xml
ok 5 - testing xml2marc
ok 6 - testing marc2dcxml
ok 7 - testing marcQualified
not ok 8 - testing marc2mosxml
#   Failed test 'testing marc2mosxml'
#   at t/db_dependent/Record.t line 85.
#          got: '<?xml version="1.0" encoding="UTF-8"?>
# <mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/v3" version="3.1" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-1.xsd">
#   <typeOfResource/>
#   <originInfo>
#     <issuance/>
#   </originInfo>
#   <recordInfo/>
# </mods>
# '
#     expected: '<?xml version="1.0" encoding="UTF-8"?>
# <mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/v3" version="3.1" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-1.xsd">
# <typeOfResource/>
# <originInfo>
# <issuance/>
# </originInfo>
# <recordInfo/>
# </mods>
# '
ok 9 - testing bibtex
ok 10 - Html umlauts
# Looks like you failed 1 test of 10

If i revert the patch, the test passes
Comment 13 Chris Cormack 2011-11-06 07:01:00 UTC Comment hidden (obsolete)
Comment 14 Chris Cormack 2011-11-06 07:25:58 UTC Comment hidden (obsolete)
Comment 15 Chris Hall 2011-11-22 00:29:14 UTC Comment hidden (obsolete)
Comment 16 Chris Cormack 2011-12-04 06:54:01 UTC Comment hidden (obsolete)
Comment 17 Chris Cormack 2011-12-04 07:03:51 UTC Comment hidden (obsolete)
Comment 18 Katrin Fischer 2011-12-04 07:12:07 UTC Comment hidden (obsolete)
Comment 19 Katrin Fischer 2011-12-04 07:12:21 UTC Comment hidden (obsolete)
Comment 20 Paul Poulain 2011-12-06 18:43:30 UTC
Chris-es, I tried to apply those patches on the branch 5327, but one of them does not apply anymore:

Bug 5327: Unit tests for C4/Exteral/BakerTaylor.pm
Apply? [yn] y

Applying: Bug 5327: Unit tests for C4/Exteral/BakerTaylor.pm
fatal: sha1 information is lacking or useless (t/Boolean.t).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Bug 5327: Unit tests for C4/Exteral/BakerTaylor.pm
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
Patch left in /tmp/Bug-5327-Unit-tests-for-C4ExteralBakerTaylorpm-gQ0UGT.patch

Could you rebase against the 5327 branch and update the patch please ?
Comment 21 Katrin Fischer 2011-12-06 18:56:06 UTC
Hi Paul, all patches apply for me using 'git bz apply'?
Comment 22 Paul Poulain 2011-12-06 19:07:39 UTC
(In reply to comment #21)
> Hi Paul, all patches apply for me using 'git bz apply'?

Katrin, do you have noticed i'm trying to apply them not from master, but from origin/new/bug_5327 ?
(after doing a git checkout --track origin/new/bug_5327)
Comment 23 Chris Cormack 2011-12-06 19:10:47 UTC
Paul you will want to merge master into your 5327 branch, then apply them. That branch is old so will be out of date with master.

We don't base patches against the branches, but against master. So if a branch is old, it needs to be brought up to date, don't rebase though, a simple merge will bring it up to master level.
Comment 24 Chris Cormack 2011-12-06 20:18:11 UTC Comment hidden (obsolete)
Comment 25 Chris Cormack 2011-12-06 20:20:19 UTC Comment hidden (obsolete)
Comment 26 Chris Cormack 2011-12-06 21:10:50 UTC Comment hidden (obsolete)
Comment 27 Chris Cormack 2011-12-06 21:20:27 UTC
2 more requiring sign off
Comment 28 Liz Rea 2011-12-06 21:46:31 UTC Comment hidden (obsolete)
Comment 29 Liz Rea 2011-12-06 21:48:50 UTC
That is NOT AT ALL RIGHT.

I had to change some of the incidental data in the test to run it - and that's what that was. My dumb. signoff inc.
Comment 30 Liz Rea 2011-12-06 21:51:07 UTC Comment hidden (obsolete)
Comment 31 Liz Rea 2011-12-06 21:53:37 UTC Comment hidden (obsolete)
Comment 32 Paul Poulain 2011-12-07 15:39:09 UTC
Comment on attachment 5485 [details] [review]
fix whitespace in the test

this patch pushed today
Comment 33 Paul Poulain 2011-12-07 15:39:38 UTC
Comment on attachment 6560 [details] [review]
Bug 5327: Unit tests for C4/Exteral/BakerTaylor.pm

This patch pushed today
Comment 34 Paul Poulain 2011-12-07 15:40:12 UTC
Comment on attachment 6562 [details] [review]
[SIGNED-OFF] Bug 5327 : Adding more unit tests

This patch pushed today, with a small follow-up to initial comment
Comment 35 Paul Poulain 2011-12-07 15:40:28 UTC
Comment on attachment 6563 [details] [review]
[SIGNED-OFF] Bug 5327 : Complete coverage for BackgroundJob.pm

This patch pushed today
Comment 36 Paul Poulain 2011-12-07 15:41:53 UTC
Comment on attachment 6621 [details] [review]
Bug 5327 : Fixing unit test for SQLHelper.pm

This patch pushed today, HOWEVER:

Chris, could you explain why you removed the SearchInTable tests and replace it by nothing ?
I see it fixes the test, but why are those 2 tests irrelevant now ?
Comment 37 Paul Poulain 2011-12-07 15:42:47 UTC
Comment on attachment 6622 [details] [review]
[Signed off] Bug 5327: Fixing the Members.t test

Patch pushed today

HOWEVER:
Chris, could you explain why BRANCH_IDX now need to be 4 instead of 5 ?
Comment 38 Chris Hall 2011-12-07 20:37:23 UTC Comment hidden (obsolete)
Comment 39 Liz Rea 2011-12-07 22:54:11 UTC Comment hidden (obsolete)
Comment 40 Liz Rea 2011-12-08 01:18:06 UTC
Comment on attachment 6650 [details] [review]
Bug 5327 - fixing t/db_dependent/Record.t to not fail because of whitespace.

keke, ChrisC did this exact same thing *and I even signed off on it.* 

This attachment is hereby invalid. ;)
Comment 41 Liz Rea 2011-12-08 01:18:32 UTC
Comment on attachment 6650 [details] [review]
Bug 5327 - fixing t/db_dependent/Record.t to not fail because of whitespace.

keke, ChrisC did this exact same thing *and I even signed off on it.* 

This attachment is hereby invalid. ;)
Comment 42 Duncan 2011-12-08 01:49:21 UTC Comment hidden (obsolete)
Comment 43 Duncan 2011-12-08 19:58:34 UTC Comment hidden (obsolete)
Comment 44 Chris Cormack 2011-12-08 21:12:08 UTC
(In reply to comment #36)
> Comment on attachment 6621 [details] [review]
> Bug 5327 : Fixing unit test for SQLHelper.pm
> 
> This patch pushed today, HOWEVER:
> 
> Chris, could you explain why you removed the SearchInTable tests and replace it
> by nothing ?
> I see it fixes the test, but why are those 2 tests irrelevant now ?

Because the SearchInTable function has changed, it does OR, not AND, those tests will never ever pass
Comment 45 Chris Cormack 2011-12-08 21:13:45 UTC
(In reply to comment #37)
> Comment on attachment 6622 [details] [review]
> [Signed off] Bug 5327: Fixing the Members.t test
> 
> Patch pushed today
> 
> HOWEVER:
> Chris, could you explain why BRANCH_IDX now need to be 4 instead of 5 ?

Because the branchcode is the 5th (not 6th) element in the array (starts at 0 of course)

These two fixes were me fixing tests that others had broken, so hopefully in future I won't be doing this :)
Comment 46 Duncan 2011-12-08 21:21:05 UTC Comment hidden (obsolete)
Comment 47 Chris Hall 2011-12-08 22:06:52 UTC Comment hidden (obsolete)
Comment 48 Duncan 2011-12-08 22:33:23 UTC Comment hidden (obsolete)
Comment 49 Duncan 2011-12-08 22:34:28 UTC
(In reply to comment #48)
> Created attachment 6683 [details] [review]
> Added test coverage for TTParser

Meant to add this on the attachment, this test relies on the patch submitted by Chris in comment 47.
Comment 50 Katrin Fischer 2011-12-13 07:04:02 UTC Comment hidden (obsolete)
Comment 51 Katrin Fischer 2011-12-13 07:04:57 UTC Comment hidden (obsolete)
Comment 52 Katrin Fischer 2011-12-13 07:05:14 UTC Comment hidden (obsolete)
Comment 53 Katrin Fischer 2011-12-13 07:05:22 UTC Comment hidden (obsolete)
Comment 54 Katrin Fischer 2011-12-13 07:05:29 UTC Comment hidden (obsolete)
Comment 55 Katrin Fischer 2011-12-13 07:05:38 UTC Comment hidden (obsolete)
Comment 56 Katrin Fischer 2011-12-13 07:09:08 UTC Comment hidden (obsolete)
Comment 57 Duncan 2011-12-14 19:51:54 UTC Comment hidden (obsolete)
Comment 58 Duncan 2011-12-15 03:27:06 UTC Comment hidden (obsolete)
Comment 59 Katrin Fischer 2011-12-15 06:21:04 UTC Comment hidden (obsolete)
Comment 60 Katrin Fischer 2011-12-15 06:24:15 UTC
Hi Duncan, 
your first patch works, but after moving the test it fails:
perl t/db_dependent/SIP_ILS.t 
1..4
not ok 1 - use C4::SIP::ILS;
#   Failed test 'use C4::SIP::ILS;'
#   at t/db_dependent/SIP_ILS.t line 14.
#     Tried to use 'C4::SIP::ILS'.
#     Error:  Can't locate ILS/Item.pm in @INC (@INC contains: /home/katrin/kohaclone/t/db_dependent/../C4/SIP /home/katrin/kohaclone /etc/perl /usr/local/lib/perl/5.12.4 /usr/local/share/perl/5.12.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.12 /usr/share/perl/5.12 /usr/local/lib/site_perl .) at /home/katrin/kohaclone/C4/SIP/ILS.pm line 11.
# BEGIN failed--compilation aborted at /home/katrin/kohaclone/C4/SIP/ILS.pm line 11.
# Compilation failed in require at (eval 8) line 2.
# BEGIN failed--compilation aborted at (eval 8) line 2.
Can't locate object method "new" via package "ILS::Transaction::RenewAll" (perhaps you forgot to load "ILS::Transaction::RenewAll"?) at t/db_dependent/SIP_ILS.t line 17.
# Looks like you planned 4 tests but ran 1.
# Looks like you failed 1 test of 1 run.
# Looks like your test exited with 255 just after 1.
Comment 61 Katrin Fischer 2011-12-15 06:25:35 UTC
Changing to signed-off as there are a lot of patches here that are ready for QA.
Comment 62 Paul Poulain 2011-12-15 12:46:30 UTC
Comment on attachment 6727 [details] [review]
[SIGNED-OFF] Added unit tests for Sip Checksum.pm

patch pushed please test
Comment 63 Paul Poulain 2011-12-15 12:47:12 UTC
Comment on attachment 6728 [details] [review]
[SIGNED-OFF] Added unit test for AuthoritiesMarc/UNIMARC.pm

patch pushed, please test
Comment 64 Paul Poulain 2011-12-15 12:47:36 UTC
Comment on attachment 6729 [details] [review]
[SIGNED-OFF] Added unit tests for Scrubber

patch pushed please test
Comment 65 Paul Poulain 2011-12-15 12:48:04 UTC
Comment on attachment 6730 [details] [review]
[SIGNED-OFF] Bug 5327: Patch removes unneeded self=shift from TTParser::unshift_token

patch pushed, please test
Comment 66 Paul Poulain 2011-12-15 12:54:08 UTC
Comment on attachment 6805 [details] [review]
[SINGED-OFF] Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm

patch pushed
Comment 67 Paul Poulain 2011-12-15 12:54:47 UTC
Comment on attachment 6732 [details] [review]
[SIGNED-OFF] Added missing reference case to Boolean.t and corrected count

patch pushed
Comment 68 Paul Poulain 2011-12-15 12:55:27 UTC
QA comments:
2 tests not merged:
==== TEST 1 ====
[SIGNED-OFF] Added coverage to unit test for TTParser

I don't understand what this patch is adding. A little bit more explanatory on the commit notes welcomed...

==== TEST 2 ====
Applying: Moving SIP_ILS.t to db_dependent
fatal: sha1 information is lacking or useless (t/SIP_ILS.t).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Moving SIP_ILS.t to db_dependent
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
Comment 69 Paul Poulain 2011-12-15 15:13:20 UTC
Comment on attachment 6730 [details] [review]
[SIGNED-OFF] Bug 5327: Patch removes unneeded self=shift from TTParser::unshift_token

unobsoleting this patch because I'll revert it

Why did I miss the patch break the tests ? I don't know. But here it is:

prove xt/author/translatable-templates.t
xt/author/translatable-templates.t .. 1/2 
#   Failed test 'opac templates are translatable'
#   at xt/author/translatable-templates.t line 54.
# Can't locate object method "type" via package "C4::TTParser" at TmplTokenizer.pm line 324, <INPUT> line 1.
# 
# tmpl_process3.pl: ERROR: Text extraction failed: ./xgettext.pl: Ioctl() inappropré pour un périphérique
# 
# tmpl_process3.pl: ERROR: Will not run msgmerge
# 
xt/author/translatable-templates.t .. 2/2 
#   Failed test 'intranet templates are translatable'
#   at xt/author/translatable-templates.t line 54.
# Can't locate object method "type" via package "C4::TTParser" at TmplTokenizer.pm line 324, <INPUT> line 1.
# 
# tmpl_process3.pl: ERROR: Text extraction failed: ./xgettext.pl: Ioctl() inappropré pour un périphérique
# 
# tmpl_process3.pl: ERROR: Will not run msgmerge
# 
# Looks like you failed 2 tests of 2.
xt/author/translatable-templates.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2 subtests 

Test Summary Report
-------------------
xt/author/translatable-templates.t (Wstat: 512 Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2

after reverting this patch, prove is OK
Comment 70 Paul Poulain 2011-12-15 15:19:00 UTC
Comment on attachment 6805 [details] [review]
[SINGED-OFF] Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm

push reverted, make jenkins unhappy, seems it's a database problem thing so the other ILS moved to db_dependant is required to have this one working
Comment 71 Duncan 2011-12-15 19:49:40 UTC Comment hidden (obsolete)
Comment 72 Katrin Fischer 2011-12-16 06:00:03 UTC Comment hidden (obsolete)
Comment 73 Katrin Fischer 2011-12-16 06:02:28 UTC Comment hidden (obsolete)
Comment 74 Katrin Fischer 2011-12-16 06:02:39 UTC Comment hidden (obsolete)
Comment 75 Katrin Fischer 2011-12-16 06:03:30 UTC
The last 3 patches for the SIP tests go together (attachments 6826-6828)
Comment 76 Paul Poulain 2011-12-16 14:43:26 UTC Comment hidden (obsolete)
Comment 77 Paul Poulain 2011-12-16 14:44:58 UTC
Comment on attachment 6834 [details] [review]
Bug 5327: Added unit test for C4/SIP/ILS/Transaction/RenewAll.pm

QA comment for SIP_ILS patches:

prove t/db_dependent/SIP_ILS.t 
t/db_dependent/SIP_ILS.t .. Subroutine new redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 44.
Subroutine find_patron redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 55.
Subroutine find_item redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 61.
Subroutine institution redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 67.
Subroutine institution_id redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 72.
Subroutine supports redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 77.
Subroutine check_inst_id redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 82.
Subroutine to_bool redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 90.
Subroutine checkout_ok redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 99.
Subroutine checkin_ok redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 104.
Subroutine status_update_ok redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 109.
Subroutine offline_ok redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 114.
Subroutine checkout redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 128.
Subroutine checkin redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 174.
Subroutine end_patron_session redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 210.
Subroutine pay_fee redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 217.
Subroutine add_hold redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 238.
Subroutine cancel_hold redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 282.
Subroutine alter_hold redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 337.
Subroutine renew redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 382.
Subroutine renew_all redefined at /home/paul/koha.dev/koha-community//C4/SIP/ILS.pm line 447.
t/db_dependent/SIP_ILS.t .. ok   
All tests successful.


The 2 follow-ups are really small, i've squashed them into 1 single commit

passed QA

patch pushed
Comment 78 Paul Poulain 2011-12-16 14:48:07 UTC
About the 2 patches TTParser:

They make translatable-template.t fail:

prove xt/author/translatable-templates.t
xt/author/translatable-templates.t .. 1/2 
#   Failed test 'opac templates are translatable'
#   at xt/author/translatable-templates.t line 54.
# Can't locate object method "type" via package "C4::TTParser" at TmplTokenizer.pm line 324, <INPUT> line 1.
# 
# tmpl_process3.pl: ERROR: Text extraction failed: ./xgettext.pl: Ioctl() inappropré pour un périphérique
# 
# tmpl_process3.pl: ERROR: Will not run msgmerge
# 
xt/author/translatable-templates.t .. 2/2 
#   Failed test 'intranet templates are translatable'
#   at xt/author/translatable-templates.t line 54.
# Can't locate object method "type" via package "C4::TTParser" at TmplTokenizer.pm line 324, <INPUT> line 1.
# 
# tmpl_process3.pl: ERROR: Text extraction failed: ./xgettext.pl: Ioctl() inappropré pour un périphérique
# 
# tmpl_process3.pl: ERROR: Will not run msgmerge
# 
# Looks like you failed 2 tests of 2.
xt/author/translatable-templates.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2 subtests 

Test Summary Report
-------------------
xt/author/translatable-templates.t (Wstat: 512 Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2
Files=1, Tests=2,  1 wallclock secs ( 0.04 usr  0.00 sys +  0.42 cusr  0.06 csys =  0.52 CPU)


when switching back to master, everything work fine:
prove xt/author/translatable-templates.t
xt/author/translatable-templates.t .. ok   
All tests successful.


Rejecting those patches for instance
Comment 79 Paul Poulain 2012-01-16 17:32:22 UTC
unless i'm mistaking, the 2 attached patches are failed QA. updating bug status.
Comment 80 Sam Sanders 2012-01-17 01:00:23 UTC Comment hidden (obsolete)
Comment 81 Connor Dewar 2012-01-17 01:02:43 UTC Comment hidden (obsolete)
Comment 82 Sam Sanders 2012-01-17 01:27:32 UTC Comment hidden (obsolete)
Comment 83 Connor Dewar 2012-01-17 01:34:30 UTC Comment hidden (obsolete)
Comment 84 Chris Cormack 2012-01-17 01:39:16 UTC Comment hidden (obsolete)
Comment 85 Chris Cormack 2012-01-17 01:40:31 UTC Comment hidden (obsolete)
Comment 86 Chris Cormack 2012-01-17 01:41:46 UTC Comment hidden (obsolete)
Comment 87 Chris Cormack 2012-01-17 01:44:17 UTC Comment hidden (obsolete)
Comment 88 Chris Cormack 2012-01-17 01:45:06 UTC Comment hidden (obsolete)
Comment 89 Chris Cormack 2012-01-17 01:46:11 UTC Comment hidden (obsolete)
Comment 90 Chris Cormack 2012-01-17 01:46:47 UTC Comment hidden (obsolete)
Comment 91 Chris Cormack 2012-01-17 01:49:37 UTC Comment hidden (obsolete)
Comment 92 Sam Sanders 2012-01-17 02:41:22 UTC Comment hidden (obsolete)
Comment 93 Connor Dewar 2012-01-17 02:42:49 UTC Comment hidden (obsolete)
Comment 94 Katrin Fischer 2012-01-17 06:52:27 UTC Comment hidden (obsolete)
Comment 95 Katrin Fischer 2012-01-17 06:57:21 UTC Comment hidden (obsolete)
Comment 96 Paul Poulain 2012-01-17 14:19:29 UTC
Comment on attachment 7184 [details] [review]
Bug 5327 added unit tests for C4/Utils

QA comment about C4::Utils unit test: I think this package is never user and could be removed. It's declared only in C4/Auth_with_cas.pm and no use seems to be made of the functions in Utils.
Could someone confirm ?
Comment 97 Paul Poulain 2012-01-17 14:20:20 UTC
Comment on attachment 7185 [details] [review]
Bug 5327 added unit tests for C4/ClassSortRoutine/Generic

QA comment: no comment, this one is OK
Comment 98 Paul Poulain 2012-01-17 14:24:02 UTC
Comment on attachment 7189 [details] [review]
[SIGNED-OFF] bug 5327 add tests for C4/ClassSortRoutine/LCC.pm

QA comment: Failed QA => a small typo here: "Arguements" is not english, it should be "Arguments"
(confirmed by oleonard on IRC, i'm not english native, I had a doubt...)
Comment 99 Paul Poulain 2012-01-17 14:25:18 UTC
Comment on attachment 7190 [details] [review]
[SIGNED-OFF] Bug 5327 Added unit tests for C4/ClassSortRoutine/Dewey.pm

QA comment = this one is OK
Comment 100 Paul Poulain 2012-01-17 14:26:11 UTC
Comment on attachment 7194 [details] [review]
[SIGNED-OFF] Bug 5327 Added unit tests for C4/Reports.pm

QA comment: this one is OK
Comment 101 Paul Poulain 2012-01-17 14:27:57 UTC
Comment on attachment 7195 [details] [review]
[SIGNED-OFF] bug 5327 add tests for C4/BackgroundJob.pm

QA comment: this one is OK
Comment 102 Paul Poulain 2012-01-17 14:29:09 UTC
100 comments, 54 patches attached, this entry becomes hard to deal with... shouldn't we transform it into an omnibus (and each test added in a separate bug entry blocking this one) ?
Comment 103 Paul Poulain 2012-01-17 14:32:36 UTC
Comment on attachment 7185 [details] [review]
Bug 5327 added unit tests for C4/ClassSortRoutine/Generic

patch pushed
Comment 104 Paul Poulain 2012-01-17 14:32:55 UTC
Comment on attachment 7190 [details] [review]
[SIGNED-OFF] Bug 5327 Added unit tests for C4/ClassSortRoutine/Dewey.pm

patch pushed
Comment 105 Paul Poulain 2012-01-17 14:33:10 UTC
Comment on attachment 7194 [details] [review]
[SIGNED-OFF] Bug 5327 Added unit tests for C4/Reports.pm

patch pushed
Comment 106 Paul Poulain 2012-01-17 14:33:31 UTC
Comment on attachment 7195 [details] [review]
[SIGNED-OFF] bug 5327 add tests for C4/BackgroundJob.pm

patch pushed
Comment 107 Paul Poulain 2012-01-17 14:34:59 UTC
everything pushable has been pushed. The 4 attachements not pushed are failing QA for instance.
Please submit an updated patch for LCC.pm & we will see if it's needed to push something for Utils, if Utils is deprecated, then please open a bug to request his removal !
Comment 108 Sam Sanders 2012-01-17 20:43:43 UTC Comment hidden (obsolete)
Comment 109 Sam Sanders 2012-01-17 22:52:19 UTC Comment hidden (obsolete)
Comment 110 Connor Dewar 2012-01-18 02:37:37 UTC Comment hidden (obsolete)
Comment 111 Sam Sanders 2012-01-18 02:41:38 UTC Comment hidden (obsolete)
Comment 112 Jono Mingard 2012-01-18 22:06:40 UTC Comment hidden (obsolete)
Comment 113 Kate Henderson 2012-01-18 22:30:50 UTC Comment hidden (obsolete)
Comment 114 Bart Jorgensen 2012-01-18 23:23:19 UTC Comment hidden (obsolete)
Comment 115 Jorgia 2012-01-18 23:33:58 UTC Comment hidden (obsolete)
Comment 116 Sam Sanders 2012-01-19 00:57:32 UTC Comment hidden (obsolete)
Comment 117 Sam Sanders 2012-01-19 01:20:18 UTC Comment hidden (obsolete)
Comment 118 Jono Mingard 2012-01-19 01:33:24 UTC Comment hidden (obsolete)
Comment 119 Kate Henderson 2012-01-19 01:34:51 UTC Comment hidden (obsolete)
Comment 120 Sam Sanders 2012-01-19 03:20:03 UTC Comment hidden (obsolete)
Comment 121 Chris Hall 2012-01-19 03:38:31 UTC Comment hidden (obsolete)
Comment 122 Chris Hall 2012-01-19 03:41:38 UTC Comment hidden (obsolete)
Comment 123 Chris Hall 2012-01-19 03:42:44 UTC Comment hidden (obsolete)
Comment 124 Chris Hall 2012-01-19 03:48:46 UTC Comment hidden (obsolete)
Comment 125 Chris Hall 2012-01-19 03:52:07 UTC Comment hidden (obsolete)
Comment 126 Chris Hall 2012-01-19 03:55:54 UTC Comment hidden (obsolete)
Comment 127 Chris Hall 2012-01-19 03:58:15 UTC Comment hidden (obsolete)
Comment 128 Chris Hall 2012-01-19 03:59:43 UTC Comment hidden (obsolete)
Comment 129 Chris Hall 2012-01-19 04:05:25 UTC Comment hidden (obsolete)
Comment 130 Sam Sanders 2012-01-19 04:06:26 UTC Comment hidden (obsolete)
Comment 131 Chris Hall 2012-01-19 04:07:40 UTC Comment hidden (obsolete)
Comment 132 Chris Hall 2012-01-19 04:09:24 UTC Comment hidden (obsolete)
Comment 133 Chris Hall 2012-01-19 04:11:22 UTC Comment hidden (obsolete)
Comment 134 Chris Hall 2012-01-19 04:14:47 UTC Comment hidden (obsolete)
Comment 135 Paul Poulain 2012-01-31 16:11:30 UTC
Comment on attachment 7184 [details] [review]
Bug 5327 added unit tests for C4/Utils

Utils is obsoled AFAIK, so marking this patch as obsolete. If i'm wrong, remove the obsolete status & let me know
Comment 136 Paul Poulain 2012-01-31 16:14:24 UTC
Comment on attachment 7206 [details] [review]
Added unit tests for C4/Koha.pm

QA Comment : this patch depends on what is in the database
+is(C4::Koha::GetSupportName('BK'),"Books", 'testing support name');
+is(C4::Koha::GetSupportName(''),undef, 'testing support name');

It should be in t/db_dependant. and not in t/

marking obsolete as it fails QA

2 possible fixes:
* remove db_dependant from those tests & create another one in t/db_dependant
* move everything to t/db_dependant
Comment 137 Paul Poulain 2012-01-31 16:30:51 UTC
Comment on attachment 7230 [details] [review]
[SIGNED-OFF] Added unit tests for C4/Csv.pm

this patch has been pushed
Comment 138 Paul Poulain 2012-01-31 16:31:10 UTC
Comment on attachment 7231 [details] [review]
[SIGNED-OFF] added unit tests for C4/Labels.pm

this patch has been pushed
Comment 139 Paul Poulain 2012-01-31 16:31:39 UTC
Comment on attachment 7232 [details] [review]
[SIGNED-OFF] Added unit tests for C4/AuthoritiesMarc/MARC21.pm

this patch has been pushed
Comment 140 Paul Poulain 2012-01-31 16:31:55 UTC
Comment on attachment 7233 [details] [review]
[SIGNED-OFF] added unit test for C4/Barcodes/PrinterConfig.pm

this patch has been pushed
Comment 141 Paul Poulain 2012-01-31 16:32:54 UTC
Comment on attachment 7234 [details] [review]
[SIGNED-OFF] Added unit tests for C4/ClassSortRoutine/LCC.pm

this patch has been pushed
Comment 142 Paul Poulain 2012-01-31 16:33:45 UTC
Comment on attachment 7235 [details] [review]
[SIGNED-OFF] Added unit tests for C4/Creators/PDF.pm

this patch has been pushed
Comment 143 Paul Poulain 2012-01-31 16:34:01 UTC
Comment on attachment 7236 [details] [review]
[SIGNED-OFF] added unit tests for C4/Ris

this patch has been pushed
Comment 144 Paul Poulain 2012-01-31 16:34:19 UTC
Comment on attachment 7237 [details] [review]
[SIGNED-OFF] Added unit tests for C4/Scheduler.pm

this patch has been pushed
Comment 145 Paul Poulain 2012-01-31 16:35:09 UTC
Comment on attachment 7238 [details] [review]
Added unit tests for C4/Serials.pm

this patch has been pushed
Comment 146 Paul Poulain 2012-01-31 16:35:26 UTC
Comment on attachment 7239 [details] [review]
[SIGNED-OFF] Added unit tests for C4/Search/PazPar2.pm

this patch has been pushed
Comment 147 Paul Poulain 2012-01-31 16:35:40 UTC
Comment on attachment 7240 [details] [review]
[SIGNED-OFF] added unit tests for C4/TmplToken.pm

this patch has been pushed
Comment 148 Paul Poulain 2012-01-31 16:35:53 UTC
Comment on attachment 7241 [details] [review]
[SIGNED-OFF] added unit tests for C4/SIP/ILS/Transaction/Renew.pm

this patch has been pushed
Comment 149 Paul Poulain 2012-01-31 16:36:07 UTC
Comment on attachment 7242 [details] [review]
[SIGNED-OFF] Added unit tests for C4/Languages.pm

this patch has been pushed
Comment 150 Paul Poulain 2012-01-31 16:37:59 UTC
Comment on attachment 7206 [details] [review]
Added unit tests for C4/Koha.pm

changing my mind about "obsolete" = it's much easier to keep all pending patches not obsolete !
Comment 151 Chris Cormack 2012-01-31 20:56:47 UTC Comment hidden (obsolete)
Comment 152 Robin Sheat 2012-02-01 00:41:47 UTC Comment hidden (obsolete)
Comment 153 Robin Sheat 2012-02-01 00:42:48 UTC
Comment on attachment 7402 [details] [review]
Merge remote-tracking branch 'origin/new/bug_5327'

Whoops, wrong patch
Comment 154 Robin Sheat 2012-02-01 00:43:37 UTC Comment hidden (obsolete)
Comment 155 Robin Sheat 2012-02-01 01:14:31 UTC Comment hidden (obsolete)
Comment 156 Paul Poulain 2012-02-01 16:37:30 UTC
Robin / chris_c = I understood db_dependant directory as where we should put tests that work only if the database need something specific to work.
A script that run subs using the database but does not depend on what is should be in t/
that's why I've pushed Csv and Reports, and am not sure the 2 patches moving them submitted yesterday are applicable.
Comment 157 Chris Cormack 2012-02-01 17:06:20 UTC
(In reply to comment #156)
> Robin / chris_c = I understood db_dependant directory as where we should put
> tests that work only if the database need something specific to work.
> A script that run subs using the database but does not depend on what is should
> be in t/
> that's why I've pushed Csv and Reports, and am not sure the 2 patches moving
> them submitted yesterday are applicable.

db_dependent is for the tests that require a db connection, the ones in just t/ don't need a database. They are the ones run during a make test, having ones that require a db connection means tests fail during install which is confusing for users.

So no db_dependent is for tests that depend on a db connection, not some specific data. (no other tests in t/ depend on a db connection)
Comment 158 Paul Poulain 2012-02-01 17:15:56 UTC
Comment on attachment 7403 [details] [review]
Bug 5327: Shifting a db dependent test to the right place

patch pushed
Comment 159 Paul Poulain 2012-02-01 17:16:17 UTC
Comment on attachment 7405 [details] [review]
Bug 5327 - move another test around

this patch pushed
Comment 160 Paul Poulain 2012-02-03 14:47:38 UTC
The 3 attachments not pushed are failing QA,so marking this bug failed QA
Comment 161 Chris Cormack 2012-02-10 22:10:39 UTC Comment hidden (obsolete)
Comment 162 Chris Cormack 2012-02-10 22:11:25 UTC
New patch needs signoff and will stop the failing tests on jenkins
Comment 163 Jared Camins-Esakov 2012-02-12 19:45:26 UTC Comment hidden (obsolete)
Comment 164 Jared Camins-Esakov 2012-02-12 19:45:54 UTC Comment hidden (obsolete)
Comment 165 Jared Camins-Esakov 2012-02-12 19:46:31 UTC Comment hidden (obsolete)
Comment 166 Jared Camins-Esakov 2012-02-12 19:47:17 UTC
The test for C4/Koha did not work for me, but I tested and signed off on the other three.
Comment 167 Paul Poulain 2012-02-13 14:15:16 UTC
Comment on attachment 7594 [details] [review]
Bug 5327 : Removing a broken test

this patch has been pushed
Comment 168 Paul Poulain 2012-02-13 14:15:53 UTC
removing signed-off status, the 3 remaining patches should not be applied
Comment 169 Paul Poulain 2012-02-15 09:49:58 UTC
Comment on attachment 7593 [details] [review]
Added coverage to unit test for TTParser

this patch has been pushed
Comment 170 Paul Poulain 2012-02-15 09:51:08 UTC
Comment on attachment 7592 [details] [review]
Bug 5327: Patch removes unneeded self=shift from TTParser::unshift_token

This patch has been pushed, after discussion with Jared: I missed that those 2 patches had been updated and now work, so my comment 168 was wrong for them.

C4/Koha.pm still un-needed though
Comment 171 Paul Poulain 2012-02-15 12:53:40 UTC
Comment on attachment 7593 [details] [review]
Added coverage to unit test for TTParser

Un-obsoleting those patches this one and http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7592

After pushing them jenkins became unstable again.
prove xt/author_translatable_templates.t fails:

13:51 ~/koha.dev/koha-community (master $% u=)$ prove xt/author/translatable-templates.t
xt/author/translatable-templates.t .. 1/2 
#   Failed test 'opac templates are translatable'
#   at xt/author/translatable-templates.t line 54.
# Can't locate object method "type" via package "C4::TTParser" at TmplTokenizer.pm line 324, <INPUT> line 1.
# 
# tmpl_process3.pl: ERROR: Text extraction failed: ./xgettext.pl: Ioctl() inappropré pour un périphérique
# 
# tmpl_process3.pl: ERROR: Will not run msgmerge
# 

#   Failed test 'intranet templates are translatable'
#   at xt/author/translatable-templates.t line 54.
# Can't locate object method "type" via package "C4::TTParser" at TmplTokenizer.pm line 324, <INPUT> line 1.
# 
# tmpl_process3.pl: ERROR: Text extraction failed: ./xgettext.pl: Ioctl() inappropré pour un périphérique
# 
# tmpl_process3.pl: ERROR: Will not run msgmerge
# 
# Looks like you failed 2 tests of 2.
xt/author/translatable-templates.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2 subtests 

Test Summary Report
-------------------
xt/author/translatable-templates.t (Wstat: 512 Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2
Files=1, Tests=2,  0 wallclock secs ( 0.04 usr  0.00 sys +  0.46 cusr  0.04 csys =  0.54 CPU)
Result: FAIL

Reverting them make this test pass.

I've reverted the 2 patches
Comment 172 Chris Cormack 2012-06-01 22:30:48 UTC Comment hidden (obsolete)
Comment 173 Paul Poulain 2012-06-05 14:25:41 UTC
Comment on attachment 9897 [details] [review]
Bug 5327 : Fix for XISBN test, thingisbn is now handing back different results

This patch has been pushed, should please jenkins (seems librarything changes the returned results, making the test fail)
Comment 174 stacey 2012-06-11 16:14:14 UTC Comment hidden (obsolete)
Comment 175 Jared Camins-Esakov 2012-07-02 17:30:32 UTC Comment hidden (obsolete)
Comment 176 Jared Camins-Esakov 2012-07-02 17:32:56 UTC
Last patch was signed off.
Comment 177 Mason James 2012-07-06 02:45:17 UTC Comment hidden (obsolete)
Comment 178 Mason James 2012-07-06 03:46:34 UTC Comment hidden (obsolete)
Comment 179 Mason James 2012-07-06 03:48:24 UTC
(In reply to comment #178)
> Created attachment 10659 [details] [review]
> Bug 5327 - Unit tests required for all C4 modules
> 
> renamed:    Koha.t -> db_dependent/Koha.t
> 
> Signed-off-by: Mason James <mtj@kohaaloha.com>

test works well

$ prove -v ./t/db_dependent/Koha.t 
./t/db_dependent/Koha.t .. 
1..8
ok 1 - use C4::Koha;
ok 2 - slashifyDate
ok 3 - xml_escape() returns empty string on undef input
ok 4 - xml_escape() works as expected
ok 5 - ... and does not change input in place
ok 6 - _isbn_cleanup removes hyphens
ok 7 - _isbn_cleanup removes parenthetical
ok 8 - _isbn_cleanup converts ISBN-13 to ISBN-10
ok
All tests successful.
Files=1, Tests=8,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.22 cusr  0.02 csys =  0.27 CPU)
Result: PASS
Comment 180 Mason James 2012-07-06 03:55:21 UTC Comment hidden (obsolete)
Comment 181 Mason James 2012-07-06 03:58:28 UTC
(In reply to comment #180)
> Created attachment 10660 [details] [review]
> Added coverage to unit test for TTParser
> 
> http://bugs.koha-community.org/show_bug.cgi?id=5327
> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
> Test passes.
> 
> Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>


Passing QA on this, test passed OK


$ prove  -v xt/tt_valid.t 
xt/tt_valid.t .. 
1..2
ok 1 - TT syntax: not using TT directive within HTML tag
ok 2 - Token received same as original put on stack
ok
All tests successful.
Files=1, Tests=2,  3 wallclock secs ( 0.02 usr  0.01 sys +  2.68 cusr  0.03 csys =  2.74 CPU)
Result: PASS
Comment 182 Mason James 2012-07-06 04:01:10 UTC
(In reply to comment #175)
> Created attachment 10616 [details] [review]
> bug 5327: added some tests for C4/Items.pm
> 
> Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Passing QA on this patch,  all test pass OK

$ prove -v  t/db_dependent/Items.t
1..7
ok 1 - use C4::Items;
# Creating biblio instance for testing.
ok 2 - New item is linked to correct biblionumber.
ok 3 - New item is linked to correct biblioitemnumber.
ok 4 - Retrieved item has correct itemnumber.
ok 5 - Retrieved item has correct biblioitemnumber.
ok 6 - Modified item barcode successfully to: 987654321.
ok 7 - Item deleted as expected.
# Deleting biblio testing instance.
ok
All tests successful.
Files=1, Tests=7,  1 wallclock secs ( 0.03 usr  0.00 sys +  0.48 cusr  0.05 csys =  0.56 CPU)
Result: PASS
Comment 183 Mason James 2012-07-06 04:21:52 UTC Comment hidden (obsolete)
Comment 184 Paul Poulain 2012-07-06 09:36:32 UTC
Comment on attachment 10616 [details] [review]
bug 5327: added some tests for C4/Items.pm

This patch pushed
Comment 185 Paul Poulain 2012-07-06 09:36:49 UTC
Comment on attachment 10660 [details] [review]
Added coverage to unit test for TTParser

This patch pushed
Comment 186 Paul Poulain 2012-07-06 09:37:04 UTC
Comment on attachment 10661 [details] [review]
added date and ISBN tests to Koha.t

This patch pushed
Comment 187 Paul Poulain 2012-07-06 09:38:00 UTC
May I suggest that we close this bug an open a new one = 186 comments, 96 attachments, it could become hard to follow
Comment 188 Paul Poulain 2012-07-06 15:02:32 UTC
Comment on attachment 10660 [details] [review]
Added coverage to unit test for TTParser

I've reverted this test, it seems it causes problem to Jenkins, so, unobsoleting it
Comment 189 Chris Cormack 2012-07-06 21:55:12 UTC
Im not pushing the patch for Koha.t to stable, it should be in db_dependent

It will break installing otherwise. Please push a follow up so I can push them both
Comment 190 Chris Cormack 2012-07-06 23:39:38 UTC Comment hidden (obsolete)
Comment 191 Paul Poulain 2012-07-12 15:15:29 UTC
Comment on attachment 10660 [details] [review]
Added coverage to unit test for TTParser

This patch pushed
Comment 192 Paul Poulain 2012-07-12 15:15:49 UTC
Comment on attachment 10680 [details] [review]
Bug 5327 : Follow up for TTParser test

This patch pushed
Comment 193 Paul Poulain 2012-07-12 15:17:03 UTC
Assigning this bug to myself, a lot of ppl in cc: you can remove yourself from this bug if you don't want to be annoyed anymore. Edit cc list, on the top right of the page
Comment 194 Chris Cormack 2012-07-26 04:19:37 UTC Comment hidden (obsolete)
Comment 195 Bart Jorgensen 2012-07-30 08:32:01 UTC Comment hidden (obsolete)
Comment 196 Jared Camins-Esakov 2012-07-30 21:45:37 UTC Comment hidden (obsolete)
Comment 197 Jared Camins-Esakov 2012-07-30 21:45:56 UTC Comment hidden (obsolete)
Comment 198 Jared Camins-Esakov 2012-07-30 21:49:10 UTC
I signed off on the test, but the follow-up needs a sign off.
Comment 199 Paul Poulain 2012-08-01 12:47:09 UTC
(In reply to comment #195)
> Created attachment 11186 [details] [review]
> Patch of 'ItemType.t' - added a few tests

Hi Bart,

just for information = your git config is not correct. Git says that submit patches with a mail address of :
From: Bart Jorgensen <bartjorgensen@ubuntu>

I suspect it's not your real mail address ;-)
Check here to fix it:
http://wiki.koha-community.org/wiki/Version_Control_Using_Git#Fill_some_parameters

Could you resubmit with a valid mail address please ?
Comment 200 Bart Jorgensen 2012-08-02 03:52:08 UTC Comment hidden (obsolete)
Comment 201 Chris Cormack 2012-08-02 04:40:14 UTC Comment hidden (obsolete)
Comment 202 Chris Cormack 2012-08-02 04:41:49 UTC Comment hidden (obsolete)
Comment 203 Bart Jorgensen 2012-08-02 05:06:04 UTC Comment hidden (obsolete)
Comment 204 Kyle M Hall 2012-08-03 15:37:46 UTC Comment hidden (obsolete)
Comment 205 Kyle M Hall 2012-08-03 15:38:08 UTC Comment hidden (obsolete)
Comment 206 Kyle M Hall 2012-08-03 15:38:26 UTC Comment hidden (obsolete)
Comment 207 Bart Jorgensen 2012-08-08 09:31:47 UTC Comment hidden (obsolete)
Comment 208 Bart Jorgensen 2012-08-09 05:03:33 UTC Comment hidden (obsolete)
Comment 209 Katrin Fischer 2012-08-09 05:24:28 UTC Comment hidden (obsolete)
Comment 210 Katrin Fischer 2012-08-09 05:24:47 UTC Comment hidden (obsolete)
Comment 211 Katrin Fischer 2012-08-09 05:24:57 UTC Comment hidden (obsolete)
Comment 212 Katrin Fischer 2012-08-09 05:25:08 UTC Comment hidden (obsolete)
Comment 213 Katrin Fischer 2012-08-09 05:25:19 UTC Comment hidden (obsolete)
Comment 214 Jonathan Druart 2012-08-09 14:29:52 UTC Comment hidden (obsolete)
Comment 215 Jonathan Druart 2012-08-09 14:31:57 UTC Comment hidden (obsolete)
Comment 216 Jonathan Druart 2012-08-09 14:33:39 UTC Comment hidden (obsolete)
Comment 217 Jonathan Druart 2012-08-09 14:35:07 UTC Comment hidden (obsolete)
Comment 218 Jonathan Druart 2012-08-09 14:37:58 UTC
Last 5 patches resubmited (perltidy)

Marked as Passed QA
Comment 219 Julian Maurice 2012-08-13 12:14:50 UTC
Hello all,

Jonathan tells me to try DBD::Mock for one of my patch (Bug 5339), which I did.
But I noticed some odd behaviour and I'm wondering if we are using it like we should.
Example:

# This assume C4::Context::_new_dbh is mocked.

my $rs = [
    ['id', 'column1', ...],
    [1, 'a', ...],
    [2, 'b', ...]
];
my $dbh = C4::Context->dbh;
$dbh->{mock_add_resultset} = $rs;
my @a = my_function();


my_function execute a single 'select' query and return data like in $rs,
but in fact, even if my query is "SELECT * FROM bar WHERE id=1", it returns
all the resultset. And even worse, if my query is something like
"SELECT foo FROM bar", the whole resultset is still returned.

My question is: how can we use DBD::Mock for testing subroutines while subroutines
will always return what we expect, and not what they should?

Is there something I'm doing wrong or something I don't understand?
Comment 220 Chris Cormack 2012-08-13 15:57:15 UTC
(In reply to comment #219)
> Hello all,
> 
> Jonathan tells me to try DBD::Mock for one of my patch (Bug 5339), which I
> did.
> But I noticed some odd behaviour and I'm wondering if we are using it like
> we should.
> Example:
> 
> # This assume C4::Context::_new_dbh is mocked.
> 
> my $rs = [
>     ['id', 'column1', ...],
>     [1, 'a', ...],
>     [2, 'b', ...]
> ];
> my $dbh = C4::Context->dbh;
> $dbh->{mock_add_resultset} = $rs;
> my @a = my_function();
> 
> 
> my_function execute a single 'select' query and return data like in $rs,
> but in fact, even if my query is "SELECT * FROM bar WHERE id=1", it returns
> all the resultset. And even worse, if my query is something like
> "SELECT foo FROM bar", the whole resultset is still returned.
> 
> My question is: how can we use DBD::Mock for testing subroutines while
> subroutines
> will always return what we expect, and not what they should?
> 
> Is there something I'm doing wrong or something I don't understand?

Yep

You can also associate a resultset with a particular SQL statement instead of adding them in the order they will be fetched:

  $dbh->{mock_add_resultset} = {
     sql     => 'SELECT foo, bar FROM baz',
     results => [
         [ 'foo', 'bar' ],
         [ 'this_one', 'that_one' ],
         [ 'this_two', 'that_two' ],
     ],
  };

http://search.cpan.org/~dichi/DBD-Mock-1.43/lib/DBD/Mock.pm
Comment 221 Bart Jorgensen 2012-08-16 05:45:32 UTC Comment hidden (obsolete)
Comment 222 Bart Jorgensen 2012-08-23 05:00:32 UTC Comment hidden (obsolete)
Comment 223 Katrin Fischer 2012-08-23 05:32:24 UTC Comment hidden (obsolete)
Comment 224 Katrin Fischer 2012-08-23 05:32:38 UTC Comment hidden (obsolete)
Comment 225 Bart Jorgensen 2012-08-23 05:48:06 UTC Comment hidden (obsolete)
Comment 226 Jared Camins-Esakov 2012-08-27 16:50:49 UTC Comment hidden (obsolete)
Comment 227 Chris Cormack 2012-09-05 18:30:11 UTC Comment hidden (obsolete)
Comment 228 Jared Camins-Esakov 2012-09-05 22:43:07 UTC Comment hidden (obsolete)
Comment 229 Jared Camins-Esakov 2012-09-05 22:47:10 UTC
Note that final patch is required in order to fix currently failing tests on Jenkins. Also note that the first 5 patches already passed QA.
Comment 230 Jonathan Druart 2012-09-06 10:23:08 UTC Comment hidden (obsolete)
Comment 231 Jonathan Druart 2012-09-06 10:25:16 UTC Comment hidden (obsolete)
Comment 232 Jonathan Druart 2012-09-06 10:27:48 UTC
(In reply to comment #231)
(In reply to comment #230)
New perltidied patches
Comment 233 Paul Poulain 2012-09-07 12:43:19 UTC
Comment on attachment 11470 [details] [review]
[PASSED-QA] Bug 5327 follow-up: add DBD::Mock dependency

This patch has been pushed
Comment 234 Paul Poulain 2012-09-07 12:43:34 UTC
Comment on attachment 11500 [details] [review]
[PASSED-QA]Bug 5327 : Added a few more lines of code to the ItemType.t unit test

This patch has been pushed
Comment 235 Paul Poulain 2012-09-07 12:43:49 UTC
Comment on attachment 11503 [details] [review]
[PASSED-QA]Bug 5327 Tests for C4::Matcher

This patch has been pushed
Comment 236 Paul Poulain 2012-09-07 12:44:04 UTC
Comment on attachment 11505 [details] [review]
[PASSED-QA]Added and tested a mock-db tested a couple of features

This patch has been pushed
Comment 237 Paul Poulain 2012-09-07 12:44:19 UTC
Comment on attachment 11506 [details] [review]
[PASSED-QA]Added a mock-db table and tested a line

This patch has been pushed
Comment 238 Paul Poulain 2012-09-07 12:44:34 UTC
Comment on attachment 11763 [details] [review]
[PASSED-QA] Added tests to installer_perlmodules

This patch has been pushed
Comment 239 Paul Poulain 2012-09-07 12:44:48 UTC
Comment on attachment 11993 [details] [review]
[PASSED-QA] Bug 5327 : Fixing a typo in the test that was causing a false fail

This patch has been pushed
Comment 240 Paul Poulain 2012-09-07 12:45:02 UTC
Comment on attachment 12002 [details] [review]
[PASSED-QA]Bug 5327: Unit tests for C4 socialdata

This patch has been pushed
Comment 241 Paul Poulain 2012-09-07 12:45:17 UTC
Comment on attachment 12003 [details] [review]
[PASSED-QA]Bug 5327: Testing c4 Images

This patch has been pushed
Comment 242 Kyle M Hall 2012-09-17 13:32:53 UTC
I think there is general agreement that future patches for this issue should be filed as separate bugs and set as depending on this bug. The number of comments on this one is becoming unwieldy.
Comment 243 Jonathan Druart 2015-03-18 14:23:00 UTC
There is no activity on this bug for more than 2 years and a lot of other bug reports have been opened.
This one can be closed.