Summary: | Zebra index not correctly mocked from tests | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Test Suite | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | kyle, tomascohen |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.11.00
|
|
Circulation function: | |||
Attachments: |
Bug 29368: Correctly mock Zebra index from tests
Bug 29368: Don't crash if search engine returns a deleted record Bug 29368: Fix remove_from_cart Bug 29368: Correctly mock Zebra index from tests Bug 29368: Fix remove_from_cart |
Description
Jonathan Druart
2021-10-29 10:35:45 UTC
Created attachment 127087 [details] [review] Bug 29368: Correctly mock Zebra index from tests This is just reusing what is done in Search.t (and that is correct). But search_utf8.t and remove_from_cart.t are wrong Created attachment 127088 [details] [review] Bug 29368: Don't crash if search engine returns a deleted record Needs to be moved to its own bug report Created attachment 127089 [details] [review] Bug 29368: Fix remove_from_cart Reusing what has been done previously (In reply to Jonathan Druart from comment #3) > Created attachment 127089 [details] [review] [review] > Bug 29368: Fix remove_from_cart > > Reusing what has been done previously This does not actually work. I think the trick may have worked before (no plack), but now I really don't see how we could find a fix for mocking correctly the koha-conf (and so zebra config/index). The only solution I see would be to introduce a fixed path for an alternate koha-conf file. Koha::Config->guess_koha_conf would pick it first if exists (only for dev_install). I don't even know if that would work (as we are loading it very early). And we cannot know it's a dev_install before we load koha-conf... We could mess with the usual koha-conf file (replace the zebra paths before and after the tests) but that feels so bad and wrong. I've tried with a ALT_KOHA_CONF to pick before KOHA_CONF (in Koha::Config->guess_koha_conf but it does not work either). Plack is loaded already and the context is kept in a module var. Created attachment 127097 [details] [review] Bug 29368: Correctly mock Zebra index from tests This is just reusing what is done in Search.t (and that is correct). But search_utf8.t and remove_from_cart.t are wrong as we want to use the UI (and we cannot mock the zebra index, ie. koha-conf, from tests for plack). This still needs some work but improve a bit the existing code and make tests pass (hopefully!) Created attachment 127099 [details] [review] Bug 29368: Fix remove_from_cart Reusing what has been done previously. Pushed to master for 21.11, thanks to everybody involved! So basically this is not perfect as we are not really mocking zebra index for UI tests, but tests may be passing and jenkins will be happy for 21.11.00 |