Due to latest changes in Search API

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mkalkbrenner created an issue. See original summary.

mkalkbrenner’s picture

Project: Search API Solr » Facets
Component: Code » Search API integration

caused by

$search_results_cache = $container->get('search_api.results_static_cache');

in SearchApiBaseFacetSource::create()

mkalkbrenner’s picture

mkalkbrenner’s picture

Status: Active » Needs work
FileSize
2.96 KB

Without deeper knowledge of facets code, this patch got the Solr tests to pass again.

mkalkbrenner’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: 2776711.patch, failed testing.

The last submitted patch, 4: 2776711.patch, failed testing.

borisson_’s picture

FileSize
5.93 KB
8.9 KB

There also seemed to be a bunch of errors like: Class 'Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid' not found, looks like we needed to also depend on taxonomy in our tests. I also updated the view. This should reduce the number of failures by a bunch. There will still be a number of failures because the testbot checks out search api alpha-16.

borisson_’s picture

Status: Needs work » Needs review

NR for #8.

Status: Needs review » Needs work

The last submitted patch, 8: non_existent_service-2776711-8.patch, failed testing.

The last submitted patch, 8: non_existent_service-2776711-8.patch, failed testing.

mkalkbrenner’s picture

Related issues: +#2777483: Unmet dependencies

There also seemed to be a bunch of errors like: Class 'Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid' not found, looks like we needed to also depend on taxonomy in our tests.

Have a look at #2777483: Unmet dependencies.

mkalkbrenner’s picture

#2777483: Unmet dependencies got committed. Does it fix the tests here?

borisson_’s picture

@mkalkbrenner: I haven't had the time to look at it yet, the testbot is using an old version of search api and I haven't had the time to run tests locally with the latest search_api + facets yet. I'm trying to make time in the evening.

borisson_’s picture

@mkalkbrenner: we might need to ask @drunken monkey to release a new alpha to make tests pass on testsbots again.

The last submitted patch, 8: non_existent_service-2776711-8.patch, failed testing.

mkalkbrenner’s picture

Status: Needs work » Reviewed & tested by the community

I can confirm that the Solr integration tests pass again with the patch from #8 applied. Without that patch they still fail.
To get travis to turn green for solr I suggest a commit here ;-)

Test results without facets patch:

Drupal test run
---------------

Tests to be run:
  - Drupal\search_api_solr\Tests\IntegrationTest
  - Drupal\search_api_solr\Tests\ViewsTest

Test run started:
  Tuesday, August 23, 2016 - 17:27

Test summary
------------

Drupal\search_api_solr\Tests\IntegrationTest                 249 passes  14 fails                 71 messages
Drupal\search_api_solr\Tests\ViewsTest                       281 passes                           62 messages

Test run duration: 1 min 2 sec

Test results including facets patch:

Drupal test run
---------------

Tests to be run:
  - Drupal\search_api_solr\Tests\IntegrationTest
  - Drupal\search_api_solr\Tests\ViewsTest

Test run started:
  Tuesday, August 23, 2016 - 18:02

Test summary
------------

Drupal\search_api_solr\Tests\IntegrationTest                 259 passes                           74 messages
Drupal\search_api_solr\Tests\ViewsTest                       281 passes                           62 messages

Test run duration: 56 sec

Are the facet tests passing at your local machine?

borisson_’s picture

Status: Reviewed & tested by the community » Needs work

I applied the patch and ran the tests, this is the outcome. I think that #2775963: FacetsSerializer views style plugin depends on optional rest module is the reason for the rest test failures, not yet an idea about why the other tests are failing.


Drupal\core_search_facets\Tests\HooksTest                     19 passes                            5 messages
Drupal\facets\Tests\LanguageIntegrationTest                   32 passes                            7 messages
Drupal\facets\Tests\FacetSourceTest                           64 passes                           12 messages
Drupal\core_search_facets\Tests\IntegrationTest              234 passes                           68 messages
Drupal\facets\Tests\RestIntegrationTest                       39 passes  15 fails  10 exceptions  13 messages
Drupal\facets\Tests\UrlIntegrationTest                       102 passes  10 fails                 22 messages
Drupal\facets\Tests\ProcessorIntegrationTest                 239 passes 270 fails                 77 messages
Drupal\Tests\facets\Unit\FacetSource\FacetSourcePluginManage   2 passes
Drupal\Tests\facets\Unit\Plugin\Condition\OtherFacetTest       5 passes
Drupal\Tests\facets\Unit\Plugin\processor\ActiveWidgetOrderP   2 passes
Drupal\Tests\facets\Unit\Plugin\processor\CountLimitProcesso   9 passes
Drupal\Tests\facets\Unit\Plugin\processor\CountWidgetOrderPr   2 passes
Drupal\Tests\facets\Unit\Plugin\processor\DisplayValueWidget   3 passes
Drupal\Tests\facets\Unit\Plugin\processor\ExcludeSpecifiedIt  15 passes
Drupal\Tests\facets\Unit\Plugin\processor\HideActiveItemsPro   6 passes
Drupal\Tests\facets\Unit\Plugin\processor\HideNonNarrowingRe   6 passes
Drupal\Tests\facets\Unit\Plugin\processor\ListItemProcessorT   7 passes
Drupal\Tests\facets\Unit\Plugin\processor\RawValueWidgetOrde   2 passes
Drupal\Tests\facets\Unit\Plugin\processor\TranslateEntityPro   2 passes
Drupal\Tests\facets\Unit\Plugin\processor\UidToUserNameCallb   2 passes
Drupal\Tests\facets\Unit\Plugin\processor\UrlProcessorHandle   7 passes
Drupal\Tests\facets\Unit\Plugin\query_type\SearchApiStringTe   4 passes
Drupal\Tests\facets\Unit\Plugin\url_processor\QueryStringTes   8 passes
Drupal\Tests\facets\Unit\Plugin\widget\ArrayWidgetTest         1 passes
Drupal\Tests\facets\Unit\Plugin\widget\CheckboxWidgetTest      2 passes
Drupal\Tests\facets\Unit\Plugin\widget\DropdownWidgetTest      1 passes
Drupal\Tests\facets\Unit\Plugin\widget\LinksWidgetTest         5 passes
Drupal\Tests\facets\FunctionalJavascript\WidgetJSTest          2 passes
Drupal\Tests\facets\Unit\Processor\ProcessorPluginManagerTes   3 passes
Drupal\Tests\facets\Unit\QueryType\QueryTypePluginManagerTes   2 passes
Drupal\Tests\facets\Unit\UrlProcessor\UrlProcessorPluginMana   2 passes
Drupal\Tests\facets\Unit\Utility\FacetsDateHandlerTest        18 passes
Drupal\Tests\facets\Unit\Widget\WidgetPluginManagerTest        2 passes
Drupal\facets\Tests\WidgetIntegrationTest                    148 passes                           42 messages
Drupal\facets\Tests\IntegrationTest                          829 passes  50 fails                230 messages
borisson_’s picture

I also ran the tests without the patch applied, so it does seem to resolve some failures. I can commit this and the rest test and open a followup to fix the rest of the tests if that sounds like a good idea.

Drupal\core_search_facets\Tests\HooksTest                     19 passes                            5 messages
Drupal\facets\Tests\IntegrationTest                            0 passes             1 exceptions
Drupal\facets\Tests\FacetSourceTest                            0 passes             1 exceptions
Drupal\facets\Tests\LanguageIntegrationTest                    0 passes             1 exceptions
Drupal\facets\Tests\ProcessorIntegrationTest                   0 passes             1 exceptions
Drupal\facets\Tests\RestIntegrationTest                        0 passes             1 exceptions
Drupal\facets\Tests\UrlIntegrationTest                         0 passes             1 exceptions
Drupal\Tests\facets\Unit\FacetSource\FacetSourcePluginManage   2 passes
Drupal\Tests\facets\Unit\Plugin\Condition\OtherFacetTest       5 passes
Drupal\Tests\facets\Unit\Plugin\processor\ActiveWidgetOrderP   2 passes
Drupal\facets\Tests\WidgetIntegrationTest                      0 passes             1 exceptions
Drupal\Tests\facets\Unit\Plugin\processor\CountLimitProcesso   9 passes
Drupal\Tests\facets\Unit\Plugin\processor\CountWidgetOrderPr   2 passes
Drupal\Tests\facets\Unit\Plugin\processor\DisplayValueWidget   3 passes
Drupal\Tests\facets\Unit\Plugin\processor\ExcludeSpecifiedIt  15 passes
Drupal\Tests\facets\Unit\Plugin\processor\HideActiveItemsPro   6 passes
Drupal\Tests\facets\Unit\Plugin\processor\HideNonNarrowingRe   6 passes
Drupal\Tests\facets\Unit\Plugin\processor\ListItemProcessorT   7 passes
Drupal\Tests\facets\Unit\Plugin\processor\RawValueWidgetOrde   2 passes
Drupal\Tests\facets\Unit\Plugin\processor\TranslateEntityPro   2 passes
Drupal\Tests\facets\Unit\Plugin\processor\UidToUserNameCallb   2 passes
Drupal\Tests\facets\Unit\Plugin\processor\UrlProcessorHandle   7 passes
Drupal\Tests\facets\Unit\Plugin\query_type\SearchApiStringTe   4 passes
Drupal\Tests\facets\Unit\Plugin\url_processor\QueryStringTes   8 passes
Drupal\Tests\facets\Unit\Plugin\widget\ArrayWidgetTest         1 passes
Drupal\Tests\facets\Unit\Plugin\widget\CheckboxWidgetTest      2 passes
Drupal\Tests\facets\Unit\Plugin\widget\DropdownWidgetTest      1 passes
Drupal\Tests\facets\Unit\Plugin\widget\LinksWidgetTest         5 passes
Drupal\Tests\facets\Unit\Processor\ProcessorPluginManagerTes   3 passes
Drupal\Tests\facets\Unit\QueryType\QueryTypePluginManagerTes   2 passes
Drupal\Tests\facets\Unit\UrlProcessor\UrlProcessorPluginMana   2 passes
Drupal\Tests\facets\Unit\Utility\FacetsDateHandlerTest        18 passes
Drupal\Tests\facets\Unit\Widget\WidgetPluginManagerTest        2 passes
Drupal\core_search_facets\Tests\IntegrationTest              234 passes                           68 messages
Drupal\Tests\facets\FunctionalJavascript\WidgetJSTest          0 passes   3 fails
FATAL Drupal\Tests\facets\FunctionalJavascript\WidgetJSTest: test runner returned a non-zero error code (2).
Drupal\Tests\facets\FunctionalJavascript\WidgetJSTest          0 passes   1 fails
borisson_’s picture

Status: Needs work » Fixed

Committed this, hopefully this will help w/ the tests. Keep in mind that the test will fail on d.o until @drunk monkey releases a new alpha, so the infrastructure can use that one.

  • borisson_ committed 964c6ba on 8.x-1.x
    Issue #2776711 by borisson_, mkalkbrenner: non-existent service "...
acidaniel’s picture

I also have issues using facets dev version and search api 1.0-alpha16 on installation I get:

You are about to DROP all tables in your 'd8' database. Do you want to continue? (y/n): y
Starting Drupal installation. This takes a while. Consider using the --notify global option.                                                                                [ok]
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "search_api.query_helper". in /srv/core/lib/Drupal/Component/DependencyInjection/Container.php:157

Any clue?

borisson_’s picture

@acidaniel, this patch was to keep up with the -dev version of search api. so facets dev + alpha16 will not work.

Status: Fixed » Closed (fixed)

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

Rishi Kulshreshtha’s picture

I'm getting the similar message just after enabling the facets module. I tried both 8.x-1.0-alpha9 and 8.x-1.x-dev but its same on both.

The website encountered an unexpected error. Please try again later.

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "search_api.query_helper". in Drupal\Component\DependencyInjection\Container->get() (line 157 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Drupal\facets\Plugin\facets\facet_source\SearchApiDisplay::create(Object, Array, 'search_api', Array) (Line: 21)
Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('search_api', Array) (Line: 84)
Drupal\Component\Plugin\PluginManagerBase->createInstance('search_api') (Line: 245)
facets_system_breadcrumb_alter(Object, Object, Array) (Line: 501)
Drupal\Core\Extension\ModuleHandler->alter('system_breadcrumb', Object, Object, Array) (Line: 94)
Drupal\Core\Breadcrumb\BreadcrumbManager->build(Object) (Line: 72)
Drupal\system\Plugin\Block\SystemBreadcrumbBlock->build() (Line: 203)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func('Drupal\block\BlockViewBuilder::preRender', Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 448)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 59)
__TwigTemplate_398eb4a8c9a7a2ae7c359c44495d9beb5fce8d82e36a5be241559c7e4195772e->doDisplay(Array, Array) (Line: 379)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 347)
Twig_Template->display(Array) (Line: 358)
Twig_Template->render(Array) (Line: 64)
twig_render_template('core/themes/seven/templates/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 490)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 90)
__TwigTemplate_0cdbe15e644e8b98cc588513a0601d14e513ec71104c421e2fa88e6ebc5a1b07->doDisplay(Array, Array) (Line: 379)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 347)
Twig_Template->display(Array) (Line: 358)
Twig_Template->render(Array) (Line: 64)
twig_render_template('core/themes/classy/templates/layout/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 148)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 149)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
borisson_’s picture

Rishi Kulshreshtha’s picture

Thanks @borisson_, I just came across a similar thread where you've mentioned the same. But the reason why I posted it here, is I want to use the Facets with Drupal Core Search, as mentioned in the description of the module page and also by Neograph734 at drupal.stackexchange.com as well.

Facet API works with Drupal Core Search

.

borisson_’s picture

@Rishi Kulshreshtha, yes, we support core search as a provider for facets, please try the patch in #2877989: Module depends on a search api service and it shouldn't, that should resolve your issue. That issue adds a defence against that problem.

If that patch doesn't work for you, please report back in that issue, we will fix it there. That's the same thing I said in the other issue you linked to.
I updated the other issue's title to clarify.

Rishi Kulshreshtha’s picture

Thanks once again Joris, I've got another issue now, hence updating the same on the actual thread.