[Bug 36765] New: TestBuilder should explode if FK broken
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36765 Bug ID: 36765 Summary: TestBuilder should explode if FK broken Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Right now, it only warns and continues. While this might mean 'there already exists a resource with the value we need for the test', this is really hiding a design issue with the tests. For example ```perl my $library = $builde->build_object( { class => 'Koha::Libraries, value => { branchcode => 'ILL', pickup_location => 1 } } ); ``` might fail because 'ILL' already exists, but if the DB entry doesn't contain the other fixed condition (pickup_location=1) then the tests could fail weirdly, and tracking it would be harder (i.e. you read the code, see you are setting pickup_location=1, but it fails because it is not). I propose we make it explode loudly instead. And fix the poorly written tests that explode because of it. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36765 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com, | |kyle@bywatersolutions.com, | |martin.renvoize@ptfs-europe | |.com, tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36765 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Sounds sensible to me -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36765 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- IIRC we decided that on purpose, so the test does not fail if the DB had the data before running the tests. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36765 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- But yes, I agree we could change the behaviour and explode instead. In your example we do not care about the branchcode, we should build a library with a random branchcode and reuse it later. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org