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
Created attachment 39203 [details] [review] 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!
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.
Created attachment 39213 [details] [review] 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!
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>
Created attachment 39218 [details] [review] Bug 14204: (QA followup) remove unneeded messages Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Patch pushed to master. Thanks Nick for this quick response!
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>
Pushed to 3.18.x will be in 3.18.7
Pushed to 3.16.x, will be in 3.16.11