Currently, the test in this module rely on the page callback in the search_api_test module in the Search API project. This is an unnecessary cross-dependency, as complex queries can only be added in a very complicated way.
Instead, we can just execute the queries directly in the test code, using search_api_query(), as long as we manually reset the caches after changing server settings.
This lets us easily add more complex tests.
In the patch attached in #1, there are also several new tests added, regarding handling of multi-valued fields.
Additionally, I have removed all unnecessary/wrong t() calls, as per the official documentation.
This new tests rely on a change in the Search API testing module. Also, it uncovered several bugs, one of them in the Search API itself. Therefore, tests with this patch will fail without fixes for the following issues:
- #2013581: Add multi-valued field to test module (Seach API)
- #2012706: Fix $reset parameter for load functions (Seach API)
- #1863672: Multiple content in the search result, when using multiple terms to filtering (still no completely working patch)
- #2012688: Fix left-over data when executing two searches in a row
Furthermore, due to the lag for the test bot regarding dependencies (#1993504: Test seems to use older version of a dependency), the automatic test of this patch will fail until there is a new stable release of the Search API with the two needed patches included. Thus, we cannot commit this patch until then.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2013609-5--test_overhaul.patch | 22.73 KB | drunken monkey |
| #5 | 2013609-5--test_overhaul--do-not-test.patch | 22.73 KB | drunken monkey |
| #3 | 2013609-3--test_overhaul--do-not-test.patch | 22.7 KB | drunken monkey |
| #1 | 2013609-1--test_overhaul.patch | 21.02 KB | drunken monkey |
Comments
Comment #1
drunken monkeyPatch attached.
Comment #3
drunken monkeyAdded some regression tests for #2007872: Missing results when using OR filters. (Note: This needs #2013581-6: Add multi-valued field to test module to work.)
Also changed the repeated filters (
keywords = orange OR keywords = orangeetc.) to something more realistic, which still fails in the same cases.Comment #4
drunken monkey(There's still a debug line in there, but since I'll probably change something else anyways, I didn't re-roll for now.)
Comment #5
drunken monkeyMoved the new tests to the regression test section for #1863672: Multiple content in the search result, when using multiple terms to filtering.
I also thought about creating a helper method that would execute the four asserts automatically for given results, saving a LOT of code duplication – however, I finally decided against it since that would make it impossible to use line numbers for finding a certain failing test.
Comment #6
bago commentedReviewed, it makes sense and work.
Comment #7
drunken monkeyIdentical patch, but without the "do-not-test" prefix in the name.
Dear test bot, please test (and be gentle)!
Comment #8
drunken monkeyWow, excellent!
Committed.
Thanks for testing!