Bug 10274

Summary: UT: Acquisition.t needs to create its own data
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: bgkriegel, gmcharlt, kyle, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 10270    
Bug Blocks: 10273, 10403    
Attachments: MT10274: UT: Acquisition.t needs to create its own data
Bug 10274: UT: Acquisition.t needs to create its own data
Bug 10274: UT: Acquisition.t needs to create its own data
Bug 10274: UT: Acquisition.t needs to create its own data
Bug 10274: UT: Acquisition.t needs to create its own data
Bug 10274: Execute sql queries into a transaction
[PASSED QA] Bug 10274: UT: Acquisition.t needs to create its own data
[PASSED QA] Bug 10274: Execute sql queries into a transaction

Description Jonathan Druart 2013-05-17 13:08:05 UTC
t/db_dependent/Acquisition.t depends on the Jenkins database.
We should create the data we want and delete them at the end.
Comment 1 Jonathan Druart 2013-05-17 13:13:15 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2013-05-20 14:41:00 UTC Comment hidden (obsolete)
Comment 3 Jared Camins-Esakov 2013-06-04 18:08:48 UTC
I am not sure this one is right. It looks like the DelOrder calls are hardcoded to expect the bib records to have biblionumbers 1-3, which doesn't make sense to me. Should it perhaps be DelOrder($biblionumber1, $ordernumber1) ... etc.?

Setting to In Discussion in case I am misunderstanding the code.
Comment 4 Jonathan Druart 2013-06-05 08:17:01 UTC
(In reply to comment #3)
> I am not sure this one is right. It looks like the DelOrder calls are
> hardcoded to expect the bib records to have biblionumbers 1-3, which doesn't
> make sense to me. Should it perhaps be DelOrder($biblionumber1,
> $ordernumber1) ... etc.?

Yes, of course! I will provide a new patch. Thanks!
Comment 5 Jonathan Druart 2013-06-05 08:17:35 UTC Comment hidden (obsolete)
Comment 6 Jared Camins-Esakov 2013-06-07 13:07:56 UTC
This looks better, but the bookseller is not getting deleted at the end of the run.
Comment 7 Jonathan Druart 2013-06-07 13:36:12 UTC
(In reply to comment #6)
> This looks better, but the bookseller is not getting deleted at the end of
> the run.

:-/ Did you get an error?

It should be deleted, DelBookseller is called into the END block.
Comment 8 Jared Camins-Esakov 2013-06-14 02:38:26 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2013-07-05 12:50:42 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2013-07-05 12:50:46 UTC Comment hidden (obsolete)
Comment 11 Katrin Fischer 2013-07-14 07:52:38 UTC
Created attachment 19620 [details] [review]
[PASSED QA] Bug 10274: UT: Acquisition.t needs to create its own data

Try before the patch:
prove t/db_dependent/Acquisition.t

And after, it should produce:
  t/db_dependent/Acquisition.t .. ok
  All tests successful.
  Files=1, Tests=41,  2 wallclock secs ( 0.03 usr  0.00 sys +  0.42 cusr
  0.02 csys =  0.47 CPU)
  Result: PASS

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Tests pass and the bookseller is deleted.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Comment 12 Katrin Fischer 2013-07-14 07:53:23 UTC
Created attachment 19621 [details] [review]
[PASSED QA] Bug 10274: Execute sql queries into a transaction

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Comment 13 Galen Charlton 2013-07-16 14:44:46 UTC
Pushed to master.  Thanks, Jonathan!
Comment 14 Tomás Cohen Arazi 2013-07-25 17:12:25 UTC
This patch has been pushed to 3.12.x, will be in 3.12.3.

Thanks Jonathan!
Comment 15 Bernardo Gonzalez Kriegel 2013-08-04 23:38:10 UTC
This does not apply cleanly to 3.10.x