Bug 17538

Summary: t/db_dependent/Upload.t is broken
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: kyle, mtj
Version: unspecified   
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: 17216    
Bug Blocks:    
Attachments: Bug 17538: (Bug 17216 follow-up) Fix t/db_dependent/Upload.t
Bug 17538: (Bug 17216 follow-up) Fix t/db_dependent/Upload.t
Bug 17538: (Bug 17216 follow-up) Fix t/db_dependent/Upload.t

Description Jonathan Druart 2016-11-02 11:01:47 UTC
% prove t/db_dependent/Upload.t
t/db_dependent/Upload.t .. 1/8 DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`koha_kohadev`.`authorised_values`, CONSTRAINT `authorised_values_authorised_values_category` FOREIGN KEY (`category`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE CASC) [for Statement "INSERT INTO authorised_values (category, authorised_value, lib) VALUES (?,?,?) "] at t/db_dependent/Upload.t line 164.

    #   Failed test 'getCategories returned at least one category'
    #   at t/db_dependent/Upload.t line 166.
    #          got: ''
    #     expected: '1'
    # Looks like you failed 1 test of 2.

#   Failed test 'Test07'
#   at t/db_dependent/Upload.t line 76.
# Looks like you failed 1 test of 8.
t/db_dependent/Upload.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/8 subtests 

Test Summary Report
-------------------
t/db_dependent/Upload.t (Wstat: 256 Tests: 8 Failed: 1)
  Failed test:  7
  Non-zero exit status: 1
Files=1, Tests=8,  1 wallclock secs ( 0.02 usr  0.00 sys +  0.88 cusr  0.65 csys =  1.55 CPU)
Result: FAIL
Comment 1 Jonathan Druart 2016-11-02 11:03:07 UTC
Created attachment 57077 [details] [review]
Bug 17538: (Bug 17216 follow-up) Fix t/db_dependent/Upload.t

The insert into authorised_values failed because of the missing FK

Test plan:
  prove t/db_dependent/Upload.t
should return green
Comment 2 Marcel de Rooy 2016-11-02 13:33:44 UTC
Created attachment 57097 [details] [review]
Bug 17538: (Bug 17216 follow-up) Fix t/db_dependent/Upload.t

The insert into authorised_values failed because of the missing FK

Test plan:
  prove t/db_dependent/Upload.t
should return green

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Tomás Cohen Arazi 2016-11-03 14:39:42 UTC
Created attachment 57133 [details] [review]
Bug 17538: (Bug 17216 follow-up) Fix t/db_dependent/Upload.t

The insert into authorised_values failed because of the missing FK

Test plan:
  prove t/db_dependent/Upload.t
should return green

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Kyle M Hall 2016-11-04 11:05:40 UTC
Pushed to master for 16.11, thanks Jonathan!
Comment 5 Mason James 2016-11-30 08:23:58 UTC
blocked by DB changes, passing for 16.05