We currently have a few tests commented out in the database backend since they weren't working (if I recall correctly). We should look into that and correct it – especially now that Facet API is under active development.
(Just uncommenting the tests to see what goes wrong would be a good start, I guess.)

Comments

rosinegrean’s picture

StatusFileSize
new89.95 KB

Hello,

First part is done: I've uncommented the code in the facet test and there are 2 failed tests.

rosinegrean’s picture

Status: Active » Needs review
StatusFileSize
new6.7 KB

Actually, there were another 2 tests failing in regressionTests().

I'm not sure what i did is ok, but the tests pass now.

drunken monkey’s picture

Title: Fix facets in the database backend » Fix commented-out database backend tests
Component: Database backend » Tests
Status: Needs review » Needs work

Thanks a lot for your work on this!
Looking over this now, I see there are two separate issues that made the tests fail:

  1. Though the filter tags added in #1390598: Add a way to easily identify facet filters inside the query are generally included in the D8 branch, it somehow seems to have slipped past us regarding the query's createFilter() method (in class and interface). That means, while everything else would (probably) be working fine, creating a filter with tags just fails silently, resulting in wrong OR facets (first batch of commented-out tests).
  2. Then, the entity_test entity type has type now defined as a real bundle, not just any property. This, however, means that it can never be NULL – however, that's exactly what we need for the regression tests (second commented-out batch). It also influences the facets in the first batch, and would also be needed for a third commented-out batch (unrelated to facets) further down the page (around line 652).

So, the correct way to deal with this would be to fix the createFilter() oversight, add an additional property/field that can be NULL and then change the tests as little as possible.

rosinegrean’s picture

Status: Needs work » Needs review
StatusFileSize
new12.82 KB

Thanks for your feedback.

I think i managed to fix it, no more errors for this tests.

drunken monkey’s picture

Great job, thanks a lot! Looks very good and also passes both locally and here with the test bot.
Just one detail:

+++ b/tests/search_api_test_db/config/install/field.storage.entity_test.category.yml
@@ -0,0 +1,16 @@
+cardinality: -1

I'd say cardinality -1 would make more sense here, also to stay in line with the original.
For multi-valued fields, we already have keywords, after all.

The attached patch should fix this, just waiting for test bot confirmation.

  • drunken monkey committed 4e5a608 on 8.x-1.x authored by prics
    Issue #2482693 by prics, drunken monkey: Fixed and completed database...
drunken monkey’s picture

Status: Needs review » Fixed

OK, great.
Committed.
Thanks a lot again, really nice work!

Status: Fixed » Closed (fixed)

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

BRB000’s picture

I am new to FACETS application. Can someone explain what is the FACETS Backend table? I tried to find answers, but couldn't get useful information that would satisfy my need.
Any explanations highly appreciated.
Thanks.