Bug 14204

Summary: Fix t/db_dependent/Labels/t_Batch.t failing test from Bug 12911
Product: Koha Reporter: Nick Clemens <nick>
Component: Test SuiteAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi <tomascohen>
Severity: normal    
Priority: P5 - low CC: chris, mtj, mtompset, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 12911    
Bug Blocks:    
Attachments: Bug 14204 - Fix t/db_dependent/Labels/t_Batch.t failing test from Bug 12991
Bug 14204 - Fix t/db_dependent/Labels/t_Batch.t failing test from Bug 12991
[PASSED QA] Bug 14204: Fix t/db_dependent/Labels/t_Batch.t failing test from Bug 12991
Bug 14204: (QA followup) remove unneeded messages
Bug 14204: (QA followup) remove unneeded messages

Description Nick Clemens 2015-05-14 19:53:49 UTC
Bug 12991 altered the creation of label batches such that the batch_id is set at 0 until items are added.  The variable in the tests was set at batch creation and not updated after items were added to test batch and this led to failing tests
Comment 1 Nick Clemens 2015-05-14 19:59:40 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2015-05-15 05:27:22 UTC
Bug 12991 has no patches on it, and it is set to NEW.
prove t/db_dependent/Labels/t_Batch.t works in master fine.
Granted I have no labels.
Do you? I'm trying to see why this is a problem.
Comment 3 Mark Tompsett 2015-05-15 14:44:23 UTC Comment hidden (obsolete)
Comment 4 Tomás Cohen Arazi 2015-05-15 18:30:52 UTC
Created attachment 39217 [details] [review]
[PASSED QA] Bug 14204: Fix t/db_dependent/Labels/t_Batch.t failing test from Bug 12991

This patch updaes the batch_id variable after items are added to test batch

To test:
1. prove t/db_dependent/Labels/t_Batch.t and see two tests fail
2. apply patch
3. prove again, tests pass!

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

NOTE: The $batch->add_item() call to C4::Creators::Batch::add_item
      triggers the change of the batch_id so this line is necessary!
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Comment 5 Tomás Cohen Arazi 2015-05-15 18:32:07 UTC Comment hidden (obsolete)
Comment 6 Tomás Cohen Arazi 2015-05-15 18:43:49 UTC
Patch pushed to master.

Thanks Nick for this quick response!
Comment 7 Mark Tompsett 2015-05-15 18:45:20 UTC
Created attachment 39219 [details] [review]
Bug 14204: (QA followup) remove unneeded messages

TEST PLAN
---------
1) Apply first patch
2) prove -v t/db_dependent/Labels/t_Batch.t
   -- YUCK! No meaningful messages on a lot of the ok's.
3) Apply this patch
4) prove -v t/db_dependent/Labels/t_Batch.t
   -- YAY! Meaningful test results
5) koha qa test tools

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 8 Chris Cormack 2015-05-17 23:26:59 UTC
Pushed to 3.18.x will be in 3.18.7
Comment 9 Mason James 2015-05-29 08:01:32 UTC
Pushed to 3.16.x, will be in 3.16.11