diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9b8585cc..bef64004 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -129,7 +129,7 @@ jobs: SOLR_CORES: ${{ matrix.solr_cores }} if: matrix.solr_version - run: | - sed -i.bak s/EzSystems\\\\EzPlatformSolrSearchEngine\\\\Tests\\\\SetupFactory\\\\LegacySetupFactory/Netgen\\\\EzPlatformSearchExtra\\\\Tests\\\\Integration\\\\SetupFactory\\\\Solr/g ${{ matrix.config }} + sed -i.bak s/EzSystems\\\\EzPlatformSolrSearchEngine\\\\Tests\\\\SetupFactory\\\\LegacySetupFactory/Netgen\\\\EzPlatformSearchExtra\\\\Tests\\\\Integration\\\\SetupFactory\\\\RegressionSolr/g ${{ matrix.config }} sed -i.bak "s/eZ\/Publish\/API\/Repository\/Tests\/SearchServiceTest.php/..\/..\/..\/tests\/lib\/Kernel\/SearchServiceTest.php/g" ${{ matrix.config }} sed -i.bak "s/eZ\/Publish\/API\/Repository\/Tests\/SearchServiceLocationTest.php/..\/..\/..\/tests\/lib\/Kernel\/SearchServiceLocationTest.php/g" ${{ matrix.config }} if: matrix.regression diff --git a/tests/lib/Integration/Resources/config/regression_services.yml b/tests/lib/Integration/Resources/config/regression_services.yml new file mode 100644 index 00000000..61a26b55 --- /dev/null +++ b/tests/lib/Integration/Resources/config/regression_services.yml @@ -0,0 +1,52 @@ +services: + netgen_test.search.solr.subdocument_mapper.content: + class: Netgen\EzPlatformSearchExtra\Tests\Integration\Implementation\Solr\SubdocumentMapper\TestContentSubdocumentMapper + tags: + - {name: netgen.search.solr.subdocument_mapper.content} + + netgen_test.search.solr.subdocument_mapper.content_translation: + class: Netgen\EzPlatformSearchExtra\Tests\Integration\Implementation\Solr\SubdocumentMapper\TestContentTranslationSubdocumentMapper + tags: + - {name: netgen.search.solr.subdocument_mapper.content_translation} + + netgen_test.search.solr.subdocument_mapper.content.sort: + class: Netgen\EzPlatformSearchExtra\Tests\Integration\Implementation\Solr\SubdocumentMapper\TestSortContentSubdocumentMapper + tags: + - {name: netgen.search.solr.subdocument_mapper.content} + + # netgen_test.search.solr.slot.subdocument_publish_version: + # parent: ezpublish.search.solr.slot + # class: '%ezpublish.search.solr.slot.publish_version.class%' + # tags: + # - {name: ezpublish.search.solr.slot, signal: ContentService\PublishVersionSignal} + + netgen_test.search.solr.event_subscriber.child_updates_parent: + class: Netgen\EzPlatformSearchExtra\Tests\Integration\Implementation\Common\EventSubscriber\TestChildUpdatesParent + arguments: + - '@ezpublish.spi.search' + - '@ezpublish.api.persistence_handler' + tags: + - { name: kernel.event_subscriber } + + # Disabled for regression tests + # Symfony\Component\EventDispatcher\EventDispatcher: + # calls: + # - ['addSubscriber', ['@netgen_test.search.solr.event_subscriber.child_updates_parent']] + + netgen_test.search.solr.field_mapper.content: + class: Netgen\EzPlatformSearchExtra\Tests\Integration\Implementation\Solr\FieldMapper\TestContentFieldMapper + arguments: + - '@ezpublish.spi.persistence.content_handler' + - '@ezpublish.spi.persistence.content_type_handler' + - '@ezpublish.spi.search.legacy' + tags: + - { name: ezpublish.search.solr.field_mapper.content } + + netgen_test.search.solr.field_mapper.location: + class: Netgen\EzPlatformSearchExtra\Tests\Integration\Implementation\Solr\FieldMapper\TestLocationFieldMapper + arguments: + - '@ezpublish.spi.persistence.content_handler' + - '@ezpublish.spi.persistence.content_type_handler' + - '@ezpublish.spi.search.legacy' + tags: + - { name: ezpublish.search.solr.field_mapper.location } diff --git a/tests/lib/Integration/SetupFactory/RegressionSolr.php b/tests/lib/Integration/SetupFactory/RegressionSolr.php new file mode 100644 index 00000000..cedec8fe --- /dev/null +++ b/tests/lib/Integration/SetupFactory/RegressionSolr.php @@ -0,0 +1,39 @@ +load('search/common.yml'); + $loader->load('search/solr.yml'); + + $testConfigPath = __DIR__ . '/../Resources/config/'; + $loader = new YamlFileLoader($containerBuilder, new FileLocator($testConfigPath)); + $loader->load('regression_services.yml'); + + // Needs to be added first because other passes depend on it + $containerBuilder->addCompilerPass(new Compiler\TagSubdocumentCriterionVisitorsPass()); + $containerBuilder->addCompilerPass(new Compiler\AggregateContentSubdocumentMapperPass()); + $containerBuilder->addCompilerPass(new Compiler\AggregateContentTranslationSubdocumentMapperPass()); + $containerBuilder->addCompilerPass(new Compiler\AggregateSubdocumentQueryCriterionVisitorPass()); + $containerBuilder->addCompilerPass(new Compiler\RawFacetBuilderDomainVisitorPass()); + $containerBuilder->addCompilerPass(new Compiler\FieldTypeRegistryPass()); + } +}