Bug 17716 - Remove itemtype-related t/db_dependent/CourseReserves.t warnings
Summary: Remove itemtype-related t/db_dependent/CourseReserves.t warnings
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Galen Charlton
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-02 18:20 UTC by Tomás Cohen Arazi
Modified: 2017-06-14 22:18 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 17716: Remove itemtype-related t/db_dependent/CourseReserves.t (1.98 KB, patch)
2016-12-02 18:35 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 17716: (followup) Remove dep on existing data and tidy (3.33 KB, patch)
2016-12-02 18:35 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17716: Remove itemtype-related t/db_dependent/CourseReserves.t (2.03 KB, patch)
2016-12-02 18:59 UTC, M. Tompsett
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17716: (followup) Remove dep on existing data and tidy (3.39 KB, patch)
2016-12-02 18:59 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 17716: Remove itemtype-related t/db_dependent/CourseReserves.t (2.08 KB, patch)
2016-12-05 13:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17716: (followup) Remove dep on existing data and tidy (3.44 KB, patch)
2016-12-05 13:24 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 Tomás Cohen Arazi 2016-12-02 18:20:35 UTC

    
Comment 1 Tomás Cohen Arazi 2016-12-02 18:35:34 UTC
Created attachment 57938 [details] [review]
Bug 17716: Remove itemtype-related t/db_dependent/CourseReserves.t

This patch makes t/db_dependent/CourseReserves.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/CourseReserves.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
  set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/CourseReserves.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D
Comment 2 Tomás Cohen Arazi 2016-12-02 18:35:39 UTC
Created attachment 57939 [details] [review]
Bug 17716: (followup) Remove dep on existing data and tidy

This patch removes the requirement for this tests for the DB to include
at least 10 borrowers to pass. Borrowers are now created on each run
using t::lib::TestBuilder and a loop.

Bonus: some tiny changes to tidy the file.

To test:
- Run:
  $ prove t/db_dependent/CourseReserves.t
SUCCESS => Tests pass with and without the patch.
- Sign off :-D
Comment 3 M. Tompsett 2016-12-02 18:57:48 UTC
Comment on attachment 57939 [details] [review]
Bug 17716: (followup) Remove dep on existing data and tidy

Review of attachment 57939 [details] [review]:
-----------------------------------------------------------------

::: t/db_dependent/CourseReserves.t
@@ -36,5 @@
> -# Create the item
> -my $record = MARC::Record->new();
> -$record->append_fields(
> -    MARC::Field->new( '952', '0', '0', a => $library->{branchcode}, b => $library->{branchcode} )
> -);

Wow. That's strange adding an empty item, but then calling AddItem 2 lines later. Nice catch.
Comment 4 M. Tompsett 2016-12-02 18:59:43 UTC
Created attachment 57941 [details] [review]
[SIGNED-OFF] Bug 17716: Remove itemtype-related t/db_dependent/CourseReserves.t

This patch makes t/db_dependent/CourseReserves.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/CourseReserves.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
  set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/CourseReserves.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 5 M. Tompsett 2016-12-02 18:59:53 UTC
Created attachment 57942 [details] [review]
[SIGNED-OFF] Bug 17716: (followup) Remove dep on existing data and tidy

This patch removes the requirement for this tests for the DB to include
at least 10 borrowers to pass. Borrowers are now created on each run
using t::lib::TestBuilder and a loop.

Bonus: some tiny changes to tidy the file.

To test:
- Run:
  $ prove t/db_dependent/CourseReserves.t
SUCCESS => Tests pass with and without the patch.
- Sign off :-D

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 6 Jonathan Druart 2016-12-05 13:24:30 UTC
Created attachment 57960 [details] [review]
Bug 17716: Remove itemtype-related t/db_dependent/CourseReserves.t

This patch makes t/db_dependent/CourseReserves.t create
good sample data for its tests. It does so by creating a random
itemtype.

To test:
- Run
  $ prove t/db_dependent/CourseReserves.t
=> FAIL: lots of warnings about "item-level_itypes set but no itemtype
  set for item"
- Apply the patch
- Run:
  $ prove t/db_dependent/CourseReserves.t
=> SUCCESS: Tests are green, and no warnings.
- Sign off :-D

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 7 Jonathan Druart 2016-12-05 13:24:34 UTC
Created attachment 57961 [details] [review]
Bug 17716: (followup) Remove dep on existing data and tidy

This patch removes the requirement for this tests for the DB to include
at least 10 borrowers to pass. Borrowers are now created on each run
using t::lib::TestBuilder and a loop.

Bonus: some tiny changes to tidy the file.

To test:
- Run:
  $ prove t/db_dependent/CourseReserves.t
SUCCESS => Tests pass with and without the patch.
- Sign off :-D

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 8 Kyle M Hall 2016-12-05 15:33:31 UTC
Pushed to master for 17.05, thanks Tomas!
Comment 9 Katrin Fischer 2016-12-05 20:30:08 UTC
These patches have been pushed to 16.11.x, will be in 16.11.01.