Bug 18748 - Noisy t/db_dependent/AuthorisedValues.t
Summary: Noisy t/db_dependent/AuthorisedValues.t
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Mark Tompsett
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-07 16:52 UTC by Mark Tompsett
Modified: 2018-12-03 20:04 UTC (History)
4 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 18748: Noisy t/db_dependent/AuthorisedValues.t (1.37 KB, patch)
2017-06-07 16:56 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 18748: Noisy t/db_dependent/AuthorisedValues.t (1.48 KB, patch)
2017-06-08 16:45 UTC, Lee Jamison
Details | Diff | Splinter Review
Bug 18748: Noisy t/db_dependent/AuthorisedValues.t (1.85 KB, patch)
2017-06-15 12:20 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 18748: Noisy t/db_dependent/AuthorisedValues.t (1.90 KB, patch)
2017-06-19 15:31 UTC, Lee Jamison
Details | Diff | Splinter Review
Bug 18748: Noisy t/db_dependent/AuthorisedValues.t (2.00 KB, patch)
2017-07-14 10:02 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Tompsett 2017-06-07 16:52:40 UTC
prove t/db_dependent/AuthorisedValues.t

DBD::mysql::st execute failed: Duplicate entry 'ACQ-952-c' for key 'PRIMARY' [for Statement "INSERT INTO `marc_subfield_structure` ( `authorised_value`, `frameworkcode`, `kohafield`, `tagfield`, `tagsubfield`) VALUES ( ?, ?, ?, ?, ? )" with ParamValues: 0='LOC', 1='ACQ', 2='items.location', 3=952, 4='c'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832.
DBIx::Class::Storage::DBI::_dbh_execute(): Duplicate entry 'ACQ-952-c' for key 'PRIMARY' at /home/mtompset/kohaclone/Koha/Object.pm line 121
    # Child (search_by_*_field + find_by_koha_field + get_description) exited without calling finalize()
not ok 15 - search_by_*_field + find_by_koha_field + get_description

Seems that bug 17249 adds both a 952$c for the '' and 'ACQ' framework, but the deletes above only delete the '' framework one.
Comment 1 Mark Tompsett 2017-06-07 16:56:07 UTC
Created attachment 64084 [details] [review]
Bug 18748: Noisy t/db_dependent/AuthorisedValues.t

This noise is from a failure. This patch expands the delete
regardless of framework.

TEST PLAN
---------
prove t/db_dependent/AuthorisedValues.t
-- should have ugly message like in comment #0
apply patch
prove t/db_dependent/AuthorisedValues.t
-- should be green
run koha qa test tools
Comment 2 Lee Jamison 2017-06-08 04:26:14 UTC
I ran 'prove t/db_dependent/AuthorisedValues.t' however I did not encounter any noise. For me, the test was successful.
Comment 3 Mark Tompsett 2017-06-08 14:29:12 UTC
(In reply to Lee Jamison from comment #2)
> I ran 'prove t/db_dependent/AuthorisedValues.t' however I did not encounter
> any noise. For me, the test was successful.

Purposefully add a 952$c 'ACQ' framework into your DB.
I likely got this as a result of killing the test before it completed.
Comment 4 Lee Jamison 2017-06-08 16:45:33 UTC
Created attachment 64112 [details] [review]
Bug 18748: Noisy t/db_dependent/AuthorisedValues.t

This noise is from a failure. This patch expands the delete
regardless of framework.

TEST PLAN
---------
prove t/db_dependent/AuthorisedValues.t
-- should have ugly message like in comment #0
apply patch
prove t/db_dependent/AuthorisedValues.t
-- should be green
run koha qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Test is green after running as directed by the
test plan.
Comment 5 Jonathan Druart 2017-06-09 13:19:34 UTC
Mark, could you make the change more explicit?
It would make more sense to delete 952c for the default and ACQ frameworks.
Comment 6 Mark Tompsett 2017-06-15 12:20:26 UTC
Created attachment 64312 [details] [review]
Bug 18748: Noisy t/db_dependent/AuthorisedValues.t

This noise is from a failure. This patch expands the delete
to 952$c for the ACQ framework as per comment #5.

TEST PLAN
---------

insert into marc_subfield_structure (tagfield,tagsubfield,liblibrarian, libopac, repeatable, mandatory, kohafield,tab,authorised_value,authtypecode,value_builder,isurl,hidden,frameworkcode,seealso,link,defaultvalue,maxlength) values (952,'c','Shelving location','Shelving location',0,0,'items.location',10,'LOC','','',0,0,'ACQ','','',null,9999);
-- this makes sure you have a pre-existing 952$c ACQ record.

prove t/db_dependent/AuthorisedValues.t
-- should have ugly message like in comment #0
apply patch
prove t/db_dependent/AuthorisedValues.t
-- should be green
run koha qa test tools
Comment 7 Lee Jamison 2017-06-19 15:31:46 UTC
Created attachment 64433 [details] [review]
Bug 18748: Noisy t/db_dependent/AuthorisedValues.t

This noise is from a failure. This patch expands the delete
to 952$c for the ACQ framework as per comment #5.

TEST PLAN
---------

insert into marc_subfield_structure (tagfield,tagsubfield,liblibrarian, libopac, repeatable, mandatory, kohafield,tab,authorised_value,authtypecode,value_builder,isurl,hidden,frameworkcode,seealso,link,defaultvalue,maxlength) values (952,'c','Shelving location','Shelving location',0,0,'items.location',10,'LOC','','',0,0,'ACQ','','',null,9999);
-- this makes sure you have a pre-existing 952$c ACQ record.

prove t/db_dependent/AuthorisedValues.t
-- should have ugly message like in comment #0
apply patch
prove t/db_dependent/AuthorisedValues.t
-- should be green
run koha qa test tools

Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Works as described following the test plan.
Comment 8 Marcel de Rooy 2017-07-14 10:02:39 UTC
Created attachment 65047 [details] [review]
Bug 18748: Noisy t/db_dependent/AuthorisedValues.t

This noise is from a failure. This patch expands the delete
to 952$c for the ACQ framework as per comment #5.

TEST PLAN
---------

insert into marc_subfield_structure (tagfield,tagsubfield,liblibrarian, libopac, repeatable, mandatory, kohafield,tab,authorised_value,authtypecode,value_builder,isurl,hidden,frameworkcode,seealso,link,defaultvalue,maxlength) values (952,'c','Shelving location','Shelving location',0,0,'items.location',10,'LOC','','',0,0,'ACQ','','',null,9999);
-- this makes sure you have a pre-existing 952$c ACQ record.

prove t/db_dependent/AuthorisedValues.t
-- should have ugly message like in comment #0
apply patch
prove t/db_dependent/AuthorisedValues.t
-- should be green
run koha qa test tools

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Jonathan Druart 2017-07-14 15:32:55 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 10 Katrin Fischer 2017-07-19 21:23:56 UTC
This patch has been pushed to 16.11.x and will be in 16.11.10.