Bug 18951 - Some t/Biblio tests are database dependent
Summary: Some t/Biblio tests are database dependent
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: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on: 18361
Blocks: 10306
  Show dependency treegraph
 
Reported: 2017-07-18 14:22 UTC by Marcel de Rooy
Modified: 2018-12-03 20:04 UTC (History)
3 users (show)

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


Attachments
Bug 18951: Some t/Biblio tests are database dependent (git mv) (1.06 KB, patch)
2017-07-19 12:19 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18951: Create data for TransformKohaToMarc.t (2.82 KB, patch)
2017-07-19 12:20 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18951: Adjust Isbd.t (1.65 KB, patch)
2017-07-19 12:20 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18951: Some t/Biblio tests are database dependent (git mv) (1.07 KB, patch)
2017-07-19 12:43 UTC, Lee Jamison
Details | Diff | Splinter Review
Bug 18951: Create data for TransformKohaToMarc.t (2.84 KB, patch)
2017-07-19 12:43 UTC, Lee Jamison
Details | Diff | Splinter Review
Bug 18951: Adjust Isbd.t (1.67 KB, patch)
2017-07-19 12:43 UTC, Lee Jamison
Details | Diff | Splinter Review
Bug 18951: Some t/Biblio tests are database dependent (git mv) (1.12 KB, patch)
2017-07-21 10:41 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18951: Create data for TransformKohaToMarc.t (2.89 KB, patch)
2017-07-21 10:41 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18951: Adjust Isbd.t (1.72 KB, patch)
2017-07-21 10:41 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2017-07-18 14:22:14 UTC
t/Biblio/Isbd.t SHOULD MOVE to db_dependent
Same for TransformKohaToMarc.t
Comment 1 Marcel de Rooy 2017-07-19 12:19:56 UTC
Created attachment 65093 [details] [review]
Bug 18951: Some t/Biblio tests are database dependent (git mv)

Move Isbd.t and TransformKohaToMarc.t to db_dependent.
Next patch will add a few adjustments too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2017-07-19 12:20:00 UTC
Created attachment 65094 [details] [review]
Bug 18951: Create data for TransformKohaToMarc.t

Adding schema and caching statements.
Adjust it so that the Koha to MARC mappings are not assumed to be present,
but are created as needed.
Remove the mock on marcflavour. It is no longer needed.
Resolving a small typo.

Test plan:
Run t/db_dependent/Biblio/TransformKohaToMarc.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2017-07-19 12:20:04 UTC
Created attachment 65095 [details] [review]
Bug 18951: Adjust Isbd.t

Add schema calls.
Remove an unneeded AddBiblio call.

Test plan:
Run t/db_dependent/Biblio/Isbd.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Lee Jamison 2017-07-19 12:43:15 UTC
Created attachment 65096 [details] [review]
Bug 18951: Some t/Biblio tests are database dependent (git mv)

Move Isbd.t and TransformKohaToMarc.t to db_dependent.
Next patch will add a few adjustments too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 5 Lee Jamison 2017-07-19 12:43:28 UTC
Created attachment 65097 [details] [review]
Bug 18951: Create data for TransformKohaToMarc.t

Adding schema and caching statements.
Adjust it so that the Koha to MARC mappings are not assumed to be present,
but are created as needed.
Remove the mock on marcflavour. It is no longer needed.
Resolving a small typo.

Test plan:
Run t/db_dependent/Biblio/TransformKohaToMarc.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 6 Lee Jamison 2017-07-19 12:43:31 UTC
Created attachment 65098 [details] [review]
Bug 18951: Adjust Isbd.t

Add schema calls.
Remove an unneeded AddBiblio call.

Test plan:
Run t/db_dependent/Biblio/Isbd.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Comment 7 Nick Clemens 2017-07-21 10:41:29 UTC
Created attachment 65167 [details] [review]
Bug 18951: Some t/Biblio tests are database dependent (git mv)

Move Isbd.t and TransformKohaToMarc.t to db_dependent.
Next patch will add a few adjustments too.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 8 Nick Clemens 2017-07-21 10:41:32 UTC
Created attachment 65168 [details] [review]
Bug 18951: Create data for TransformKohaToMarc.t

Adding schema and caching statements.
Adjust it so that the Koha to MARC mappings are not assumed to be present,
but are created as needed.
Remove the mock on marcflavour. It is no longer needed.
Resolving a small typo.

Test plan:
Run t/db_dependent/Biblio/TransformKohaToMarc.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 9 Nick Clemens 2017-07-21 10:41:34 UTC
Created attachment 65169 [details] [review]
Bug 18951: Adjust Isbd.t

Add schema calls.
Remove an unneeded AddBiblio call.

Test plan:
Run t/db_dependent/Biblio/Isbd.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 10 Jonathan Druart 2017-07-24 19:04:23 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 11 Fridolin Somers 2017-07-31 07:57:33 UTC
Testing on 17.05.x, I get a crash :

$ prove t/db_dependent/Biblio/TransformKohaToMarc.t 
t/db_dependent/Biblio/TransformKohaToMarc.t .. DBIx::Class::ResultSet::find(): find() expects either a column/value hashref, or a list of values corresponding to the columns of the specified unique constraint 'primary' at /home/koha/src/Koha/Objects.pm line 83
# Looks like your test exited with 255 before it could output anything.
t/db_dependent/Biblio/TransformKohaToMarc.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/1 subtests 

Test Summary Report
-------------------
t/db_dependent/Biblio/TransformKohaToMarc.t (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 1 tests but ran 0.
Files=1, Tests=0,  1 wallclock secs ( 0.02 usr  0.00 sys +  0.71 cusr  0.04 csys =  0.77 CPU)
Result: FAIL

Looks like Koha::MarcSubfieldStructures->find('','300','b') crashed.
May I use Koha::MarcSubfieldStructures->search( { frameworkcode => '', tagfield => '300', tagsubfield => 'a' } ) like in AuthorisedValues.t ?
Comment 12 Marcel de Rooy 2017-07-31 09:31:49 UTC
(In reply to Fridolin SOMERS from comment #11)
> Looks like Koha::MarcSubfieldStructures->find('','300','b') crashed.
> May I use Koha::MarcSubfieldStructures->search( { frameworkcode => '',
> tagfield => '300', tagsubfield => 'a' } ) like in AuthorisedValues.t ?

Yes, that should do it. You will need an extra ->next or ->first or so.
There was an adjustment to Koha::Object's find. Probably not in 17.05.
Comment 13 Fridolin Somers 2017-08-03 07:47:41 UTC
(In reply to Marcel de Rooy from comment #12)
> (In reply to Fridolin SOMERS from comment #11)
> > Looks like Koha::MarcSubfieldStructures->find('','300','b') crashed.
> > May I use Koha::MarcSubfieldStructures->search( { frameworkcode => '',
> > tagfield => '300', tagsubfield => 'a' } ) like in AuthorisedValues.t ?
> 
> Yes, that should do it. You will need an extra ->next or ->first or so.
> There was an adjustment to Koha::Object's find. Probably not in 17.05.

Yes I found it is dependent from Bug 18361 not in 17.05.x.
I choose to integrate it.
Comment 14 Fridolin Somers 2017-08-03 07:50:08 UTC
Pushed to 17.05.x, will be in 17.05.03.
Comment 15 Katrin Fischer 2017-08-15 10:17:10 UTC
Blocked by 18361 not applying to 16.11.x. If you want this to be included, please help by rebasing it to the latest 16.11.x.
Comment 16 Marcel de Rooy 2017-08-15 12:13:10 UTC
(In reply to Katrin Fischer from comment #15)
> Blocked by 18361 not applying to 16.11.x. If you want this to be included,
> please help by rebasing it to the latest 16.11.x.

Try again :)
Comment 17 Katrin Fischer 2017-08-16 21:00:49 UTC
These patches have been pushed to 16.11.x and will be in 16.11.11.
Comment 18 Mason James 2017-08-24 13:57:10 UTC
Pushed to 16.05.x, for 16.05.16 release