[Bug 17897] New: Koha:: SearchMappingManager - Simplify search mapping modifications
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Bug ID: 17897 Summary: Koha::SearchMappingManager - Simplify search mapping modifications Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Searching Assignee: gmcharlt@gmail.com Reporter: olli-antti.kivilahti@jns.fi QA Contact: testopia@bugs.koha-community.org Currently there is a lot of DBIC-magic everywhere where search mappings (search_fields, search_marc_to_field, search_marc_map -tables) are CRUD:ed. Encapsulate this hard-to-read DBIC-magic into a Manager class which promotes code-reusability and thus, simpler test case writing. Includes tests for Bug 17885 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 --- Comment #1 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 58942 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=58942&action=edit Bug 17897 - Koha::SearchMappingManager - Simplify search mapping modifications Currently there is a lot of DBIC-magic everywhere where search mappings (search_fields, search_marc_to_field, search_marc_map -tables) are CRUD:ed. Encapsulate this hard-to-read DBIC-magic into a Manager class which promotes code-reusability and thus, simpler test case writing. Includes tests for Buug 17885 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #2 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Test plan is to run the elasticsearch-dependent tests in t/db_dependent/Koha* -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |17855 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17855 [Bug 17855] Updated Koha web installer and new onboarding tool feature to guide users through setting up Koha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|17855 |17885 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17855 [Bug 17855] Updated Koha web installer and new onboarding tool feature to guide users through setting up Koha https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17885 [Bug 17885] Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings throws DBD::mysql Duplicate entry exceptions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 --- Comment #3 from Lari Taskula <lari.taskula@jns.fi> --- Created attachment 65392 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65392&action=edit Bug 17897 - (follow-up) Cleanup after tests Adds rollback to test data in t/db_dependent/Koha/SearchEngine/ElasticSearch.t To test: 1. prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Assignee|gmcharlt@gmail.com |lari.taskula@jns.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |nick@bywatersolutions.com --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- fatal: sha1 information is lacking or useless (Koha/SearchEngine/Elasticsearch.pm). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|lari.taskula@hypernova.fi |koha-bugs@lists.koha-commun | |ity.org -- 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=17897 Emmi Takkinen <emmi.takkinen@outlook.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #58942|0 |1 is obsolete| | Status|Patch doesn't apply |Needs Signoff Assignee|koha-bugs@lists.koha-commun |emmi.takkinen@outlook.com |ity.org | CC| |emmi.takkinen@outlook.com --- Comment #5 from Emmi Takkinen <emmi.takkinen@outlook.com> --- Created attachment 102475 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102475&action=edit Bug 17897: Koha::SearchMappingManager - Simplify search mapping modifications Rebased patch. Added 'search' to 'get_search_mappings' and adjusted tests to work with changed mappings. -- 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=17897 Emmi Takkinen <emmi.takkinen@outlook.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #65392|0 |1 is obsolete| | --- Comment #6 from Emmi Takkinen <emmi.takkinen@outlook.com> --- Created attachment 102476 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102476&action=edit Bug 17897: (follow-up) Cleanup after tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Victoria Faafia <vfaafia29@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vfaafia29@gmail.com Status|Needs Signoff |Patch doesn't apply --- Comment #7 from Victoria Faafia <vfaafia29@gmail.com> --- git bz apply 17897 Bug 17897 - Koha::SearchMappingManager - Simplify search mapping modifications 102475 - Bug 17897: Koha::SearchMappingManager - Simplify search mapping modifications 102476 - Bug 17897: (follow-up) Cleanup after tests Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 17897: Koha::SearchMappingManager - Simplify search mapping modifications Using index info to reconstruct a base tree... M Koha/SearchEngine/Elasticsearch.pm Falling back to patching base and 3-way merge... Auto-merging Koha/SearchEngine/Elasticsearch.pm CONFLICT (content): Merge conflict in Koha/SearchEngine/Elasticsearch.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 17897: Koha::SearchMappingManager - Simplify search mapping modifications The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-17897-KohaSearchMappingManager---Simplify-sear-JiTslW.patch patch does not apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102475|0 |1 is obsolete| | --- Comment #8 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 115320 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115320&action=edit Bug 17897: Koha::SearchMappingManager - Simplify search mapping modifications Currently there is a lot of DBIC-magic everywhere where search mappings (search_fields, search_marc_to_field, search_marc_map -tables) are CRUD:ed. Encapsulate this hard-to-read DBIC-magic into a Manager class which promotes code-reusability and thus, simpler test case writing. Includes tests for Buug 17885 Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102476|0 |1 is obsolete| | --- Comment #9 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 115321 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115321&action=edit Bug 17897: (follow-up) Cleanup after tests Adds rollback to test data in t/db_dependent/Koha/SearchEngine/ElasticSearch.t To test: 1. prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 --- Comment #10 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 115322 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115322&action=edit Bug 17897: Fix failing tests Tests failed when txn_begin and rollback were used inside of subtests. To test prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Failed QA --- Comment #11 from David Nind <david@davidnind.com> --- Patch still applies, but tests fail: prove -vvv t/db_dependent/Koha/SearchEngine/ElasticSearch.t t/db_dependent/Koha/SearchEngine/ElasticSearch.t .. # Subtest: Reset Elasticsearch mappings ok 1 - Scenario: Reset Elasticsearch mappings to an empty database ok 2 - Given empty search mapping tables ok 3 - When reset_elasticsearch_mappings() has been ran ok 4 - Then search mapping tables have been populated ok 5 - Scenario: Reset Elasticsearch mappings when custom mappings already exist 1..5 ok 1 - Reset Elasticsearch mappings DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data truncated for column 'type' at row 1 at /kohadevbox/koha/Koha/Objects.pm line 114 # Tests were run but no plan was declared and done_testing() was not seen. # Looks like your test exited with 11 just after 1. Dubious, test returned 11 (wstat 2816, 0xb00) All 1 subtests passed Test Summary Report ------------------- t/db_dependent/Koha/SearchEngine/ElasticSearch.t (Wstat: 2816 Tests: 1 Failed: 0) Non-zero exit status: 11 Parse errors: No plan found in TAP output Files=1, Tests=1, 4 wallclock secs ( 0.03 usr 0.00 sys + 3.53 cusr 0.19 csys = 3.75 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115322|0 |1 is obsolete| | --- Comment #12 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 143744 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143744&action=edit Bug 17897: Fix failing tests Tests failed when txn_begin and rollback were used inside of subtests. To test prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #13 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Fixed tests, patches should apply cleanly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #14 from David Nind <david@davidnind.com> --- Tests are still failing for me: prove -vvv t/db_dependent/Koha/SearchEngine/ElasticSearch.t t/db_dependent/Koha/SearchEngine/ElasticSearch.t .. # Subtest: Reset Elasticsearch mappings ok 1 - Scenario: Reset Elasticsearch mappings to an empty database ok 2 - Given empty search mapping tables ok 3 - When reset_elasticsearch_mappings() has been ran ok 4 - Then search mapping tables have been populated ok 5 - Scenario: Reset Elasticsearch mappings when custom mappings already exist 1..5 ok 1 - Reset Elasticsearch mappings DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data truncated for column 'type' at row 1 at /kohadevbox/koha/Koha/Objects.pm line 114 # Tests were run but no plan was declared and done_testing() was not seen. # Looks like your test exited with 11 just after 1. Dubious, test returned 11 (wstat 2816, 0xb00) All 1 subtests passed Test Summary Report ------------------- t/db_dependent/Koha/SearchEngine/ElasticSearch.t (Wstat: 2816 Tests: 1 Failed: 0) Non-zero exit status: 11 Parse errors: No plan found in TAP output Files=1, Tests=1, 4 wallclock secs ( 0.02 usr 0.00 sys + 3.65 cusr 0.15 csys = 3.82 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 --- Comment #15 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- I just realized tests also lack "tests", "plan tests" etc. and subtests aren't declared inside sub. Also, should test file be named something else? It's now ElasticSearch.t but we also have Elasticsearch.t. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 --- Comment #16 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to David Nind from comment #14)
Tests are still failing for me:
prove -vvv t/db_dependent/Koha/SearchEngine/ElasticSearch.t t/db_dependent/Koha/SearchEngine/ElasticSearch.t .. # Subtest: Reset Elasticsearch mappings ok 1 - Scenario: Reset Elasticsearch mappings to an empty database ok 2 - Given empty search mapping tables ok 3 - When reset_elasticsearch_mappings() has been ran ok 4 - Then search mapping tables have been populated ok 5 - Scenario: Reset Elasticsearch mappings when custom mappings already exist 1..5 ok 1 - Reset Elasticsearch mappings DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data truncated for column 'type' at row 1 at /kohadevbox/koha/Koha/Objects.pm line 114 # Tests were run but no plan was declared and done_testing() was not seen. # Looks like your test exited with 11 just after 1. Dubious, test returned 11 (wstat 2816, 0xb00) All 1 subtests passed
Test Summary Report ------------------- t/db_dependent/Koha/SearchEngine/ElasticSearch.t (Wstat: 2816 Tests: 1 Failed: 0) Non-zero exit status: 11 Parse errors: No plan found in TAP output Files=1, Tests=1, 4 wallclock secs ( 0.02 usr 0.00 sys + 3.65 cusr 0.15 csys = 3.82 CPU) Result: FAIL
Tables search_field column type only accepts following values: '','string','date','number','boolean','sum','isbn','stdno','year','callnumber'. Tests use value "keyword". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #143744|0 |1 is obsolete| | --- Comment #17 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 157224 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157224&action=edit Bug 17897: Fix failing tests and QA issues Tests failed because 1) txn_begin and rollback were used inside of subtests. 2) column search_field.type was filled with unallowed value. This patch also fixes QA issue with test file exec rights and incorrect license statement. To test prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #18 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Fixed tests and QA issues qa-tool found. Didn't change test files name yet. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115320|0 |1 is obsolete| | --- Comment #19 from David Nind <david@davidnind.com> --- Created attachment 157282 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157282&action=edit Bug 17897: Koha::SearchMappingManager - Simplify search mapping modifications Currently there is a lot of DBIC-magic everywhere where search mappings (search_fields, search_marc_to_field, search_marc_map -tables) are CRUD:ed. Encapsulate this hard-to-read DBIC-magic into a Manager class which promotes code-reusability and thus, simpler test case writing. Includes tests for Buug 17885 Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115321|0 |1 is obsolete| | --- Comment #20 from David Nind <david@davidnind.com> --- Created attachment 157283 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157283&action=edit Bug 17897: (follow-up) Cleanup after tests Adds rollback to test data in t/db_dependent/Koha/SearchEngine/ElasticSearch.t To test: 1. prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157224|0 |1 is obsolete| | --- Comment #21 from David Nind <david@davidnind.com> --- Created attachment 157284 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=157284&action=edit Bug 17897: Fix failing tests and QA issues Tests failed because 1) txn_begin and rollback were used inside of subtests. 2) column search_field.type was filled with unallowed value. This patch also fixes QA issue with test file exec rights and incorrect license statement. To test prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Please rebase! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157282|0 |1 is obsolete| | --- Comment #23 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 158487 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158487&action=edit Bug 17897: Koha::SearchMappingManager - Simplify search mapping modifications Currently there is a lot of DBIC-magic everywhere where search mappings (search_fields, search_marc_to_field, search_marc_map -tables) are CRUD:ed. Encapsulate this hard-to-read DBIC-magic into a Manager class which promotes code-reusability and thus, simpler test case writing. Includes tests for Buug 17885 Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157283|0 |1 is obsolete| | --- Comment #24 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 158488 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158488&action=edit Bug 17897: (follow-up) Cleanup after tests Adds rollback to test data in t/db_dependent/Koha/SearchEngine/ElasticSearch.t To test: 1. prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157282|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157283|1 |0 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158487|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158488|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157282|0 |1 is obsolete| | --- Comment #25 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 158489 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158489&action=edit Bug 17897: Koha::SearchMappingManager - Simplify search mapping modifications Currently there is a lot of DBIC-magic everywhere where search mappings (search_fields, search_marc_to_field, search_marc_map -tables) are CRUD:ed. Encapsulate this hard-to-read DBIC-magic into a Manager class which promotes code-reusability and thus, simpler test case writing. Includes tests for Buug 17885 Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157283|0 |1 is obsolete| | --- Comment #26 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 158490 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158490&action=edit Bug 17897: (follow-up) Cleanup after tests Adds rollback to test data in t/db_dependent/Koha/SearchEngine/ElasticSearch.t To test: 1. prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #157284|0 |1 is obsolete| | --- Comment #27 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 158491 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158491&action=edit Bug 17897: Fix failing tests and QA issues Tests failed because 1) txn_begin and rollback were used inside of subtests. 2) column search_field.type was filled with unallowed value. This patch also fixes QA issue with test file exec rights and incorrect license statement. To test prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |ASSIGNED --- Comment #28 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Made some mess and accidentally rebased patches without Davids sign off first. Also these are missing "filter" param, will add it in a moment. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 --- Comment #29 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 158492 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158492&action=edit Bug 17897: Add search_marc_to_field.filter to SearhMappingManager Methods in SearchMappingManager didn't take into account search_marc_to_field.filter indtroduced in bug 27153. To test, prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158489|0 |1 is obsolete| | --- Comment #30 from David Nind <david@davidnind.com> --- Created attachment 158561 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158561&action=edit Bug 17897: Koha::SearchMappingManager - Simplify search mapping modifications Currently there is a lot of DBIC-magic everywhere where search mappings (search_fields, search_marc_to_field, search_marc_map -tables) are CRUD:ed. Encapsulate this hard-to-read DBIC-magic into a Manager class which promotes code-reusability and thus, simpler test case writing. Includes tests for Buug 17885 Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158490|0 |1 is obsolete| | --- Comment #31 from David Nind <david@davidnind.com> --- Created attachment 158562 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158562&action=edit Bug 17897: (follow-up) Cleanup after tests Adds rollback to test data in t/db_dependent/Koha/SearchEngine/ElasticSearch.t To test: 1. prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t Rebased-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158491|0 |1 is obsolete| | --- Comment #32 from David Nind <david@davidnind.com> --- Created attachment 158563 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158563&action=edit Bug 17897: Fix failing tests and QA issues Tests failed because 1) txn_begin and rollback were used inside of subtests. 2) column search_field.type was filled with unallowed value. This patch also fixes QA issue with test file exec rights and incorrect license statement. To test prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #158492|0 |1 is obsolete| | --- Comment #33 from David Nind <david@davidnind.com> --- Created attachment 158564 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158564&action=edit Bug 17897: Add search_marc_to_field.filter to SearhMappingManager Methods in SearchMappingManager didn't take into account search_marc_to_field.filter indtroduced in bug 27153. To test, prove t/db_dependent/Koha/SearchEngine/ElasticSearch.t Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17897 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | Status|Signed Off |Failed QA CC| |m.de.rooy@rijksmuseum.nl --- Comment #34 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- WARN Koha/SearchMappingManager.pm WARN tidiness The file is less tidy than before (bad/messy lines before: 0, now: 11) WARN t/db_dependent/Koha/SearchEngine/ElasticSearch.t WARN tidiness The file is less tidy than before (bad/messy lines before: 0, now: 76) +@THROWS die when parameters are not properly given. Should throw a Koha::Exception::BadParameter, + but pushing all those Exceptions to the community version would take ages. Hmm. Just adding that exception does not take ages. One die ? diff --git a/t/db_dependent/Koha/SearchEngine/ElasticSearch.t b/t/db_dependent/Koha/SearchEngine/ElasticSearch.t new file mode 100644 OK Fixed later +# Copyright 2015 Catalyst IT Fix? +use Modern::Perl qw(2014); Not what we do elsewhere? + $rv = Koha::SearchMappingManager::flush(); No transactions, no rollbacks ? OK Added later. General remark / question Given this comment: "Currently there is a lot of DBIC-magic everywhere where search mappings (search_fields, search_marc_to_field, search_marc_map -tables) are CRUD:ed. Encapsulate this hard-to-read DBIC-magic into a Manager class which promotes code-reusability and thus, simpler test case writing." Koha/SearchEngine/Elasticsearch.pm | 27 +--- Koha/SearchMappingManager.pm | 151 ++++++++++++++++++ .../Koha/SearchEngine/ElasticSearch.t | 127 +++++++++++++++ 3 files changed, 280 insertions(+), 25 deletions(-) I am not seeing large number of replaces to start using this new class? So could you explain the benefit of adding those 250 lines please? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org