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:

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.

Comments

drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new21.02 KB

Patch attached.

Status: Needs review » Needs work

The last submitted patch, 2013609-1--test_overhaul.patch, failed testing.

drunken monkey’s picture

Status: Needs work » Needs review
StatusFileSize
new22.7 KB

Added 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 = orange etc.) to something more realistic, which still fails in the same cases.

drunken monkey’s picture

(There's still a debug line in there, but since I'll probably change something else anyways, I didn't re-roll for now.)

drunken monkey’s picture

StatusFileSize
new22.73 KB

Moved 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.

bago’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed, it makes sense and work.

drunken monkey’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new22.73 KB

Identical patch, but without the "do-not-test" prefix in the name.
Dear test bot, please test (and be gentle)!

drunken monkey’s picture

Status: Needs review » Fixed

Wow, excellent!
Committed.
Thanks for testing!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.