Bug 26250: Fix tests when SearchEngine=Elastic
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 19 Aug 2020 12:03:29 +0000 (14:03 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 31 Aug 2020 14:10:26 +0000 (16:10 +0200)
commit9c9dddeaa46bc605dd319db0538e3e6d2e151ff1
tree1f3dc5052e66252a12af62ee228f79a927e67765
parent5fd8774c687c6aaf6716485ab9bd72a69a0e2f76
Bug 26250: Fix tests when SearchEngine=Elastic

Most of the time the tests are failing because the item is not created
correctly (missing biblio and/or biblioitem).
The usual error is:
 t/db_dependent/selenium/regressions.t ..... 5/5 Can't call method "leader" on an undefined value at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch.pm line 534.

In this patch we are making sure $builder->build({ source => 'Item' })
is replace with $builder->build_sample_item

Test plan:
Turn on Elastic and confirm that all the tests pass!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
53 files changed:
t/db_dependent/Accounts.t
t/db_dependent/Acquisition.t
t/db_dependent/ArticleRequests.t
t/db_dependent/Barcodes.t
t/db_dependent/Barcodes_ValueBuilder.t
t/db_dependent/Biblio/ModBiblioMarc.t
t/db_dependent/Budgets.t
t/db_dependent/Circulation.t
t/db_dependent/Circulation/CalcFine.t
t/db_dependent/Circulation/MarkIssueReturned.t
t/db_dependent/Circulation/NoIssuesChargeGuarantees.t
t/db_dependent/Circulation/ReturnClaims.t
t/db_dependent/Circulation/Returns.t
t/db_dependent/Circulation/StoreLastBorrower.t
t/db_dependent/Circulation/SwitchOnSiteCheckouts.t
t/db_dependent/Circulation/dateexpiry.t
t/db_dependent/CourseReserves/CourseItems.t
t/db_dependent/Exporter/Record.t
t/db_dependent/Holds/HoldFulfillmentPolicy.t
t/db_dependent/Holds/WaitingReserves.t
t/db_dependent/ILSDI_Services.t
t/db_dependent/ImportBatch.t
t/db_dependent/Items.t
t/db_dependent/Items/GetHostItemsInfo.t
t/db_dependent/Items/GetItemsForInventory.t
t/db_dependent/Items/MoveItemFromBiblio.t
t/db_dependent/Koha/Account/Line.t
t/db_dependent/Koha/Biblios.t
t/db_dependent/Koha/Checkouts.t
t/db_dependent/Koha/Filter/EmbedItemsAvailability.t
t/db_dependent/Koha/Item.t
t/db_dependent/Koha/Item/Transfers.t
t/db_dependent/Koha/Patrons.t
t/db_dependent/Koha/Ratings.t
t/db_dependent/Koha/Reviews.t
t/db_dependent/Koha/SharedContent.t
t/db_dependent/Koha/Subscription.t
t/db_dependent/Koha/Suggestions.t
t/db_dependent/Koha/Z3950Responder/Session.t
t/db_dependent/Koha/Z3950Responder/Session2.t
t/db_dependent/Letters/TemplateToolkit.t
t/db_dependent/Reserves.t
t/db_dependent/Reserves/CancelExpiredReserves.t
t/db_dependent/Reserves/GetReserveFee.t
t/db_dependent/Reserves/MultiplePerRecord.t
t/db_dependent/Reserves/ReserveSlip.t
t/db_dependent/SIP/Message.t
t/db_dependent/StockRotationRotas.t
t/db_dependent/Virtualshelves.t
t/db_dependent/api/v1/items.t
t/db_dependent/cronjobs/advance_notices_digest.t
t/db_dependent/rollingloans.t
t/db_dependent/selenium/regressions.t