Bug 10274 - UT: Acquisition.t needs to create its own data
Summary: UT: Acquisition.t needs to create its own data
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact:
URL:
Keywords:
Depends on: 10270
Blocks: 10273 10403
  Show dependency treegraph
 
Reported: 2013-05-17 13:08 UTC by Jonathan Druart
Modified: 2014-12-07 20:03 UTC (History)
4 users (show)

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


Attachments
MT10274: UT: Acquisition.t needs to create its own data (7.35 KB, patch)
2013-05-17 13:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10274: UT: Acquisition.t needs to create its own data (7.35 KB, patch)
2013-05-20 14:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10274: UT: Acquisition.t needs to create its own data (7.39 KB, patch)
2013-06-05 08:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10274: UT: Acquisition.t needs to create its own data (7.49 KB, patch)
2013-06-14 02:38 UTC, Jared Camins-Esakov
Details | Diff | Splinter Review
Bug 10274: UT: Acquisition.t needs to create its own data (7.41 KB, patch)
2013-07-05 12:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10274: Execute sql queries into a transaction (1.32 KB, patch)
2013-07-05 12:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PASSED QA] Bug 10274: UT: Acquisition.t needs to create its own data (7.49 KB, patch)
2013-07-14 07:52 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 10274: Execute sql queries into a transaction (1.40 KB, patch)
2013-07-14 07:53 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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