Skip to content

Commit d4c7304

Browse files
committed
MC-18948: Switch default search engine from MySQL to ElasticSearch
- fixing integration tests
1 parent 0ef5163 commit d4c7304

File tree

11 files changed

+40
-14
lines changed

11 files changed

+40
-14
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListProduct/SortingTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ protected function setUp()
8585

8686
/**
8787
* @magentoDataFixture Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php
88-
* @magentoConfigFixture default/catalog/search/engine mysql
8988
* @dataProvider productListSortOrderDataProvider
9089
* @param string $sortBy
9190
* @param string $direction
@@ -101,7 +100,6 @@ public function testProductListSortOrder(string $sortBy, string $direction, arra
101100

102101
/**
103102
* @magentoDataFixture Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php
104-
* @magentoConfigFixture default/catalog/search/engine mysql
105103
* @dataProvider productListSortOrderDataProvider
106104
* @param string $sortBy
107105
* @param string $direction
@@ -174,7 +172,6 @@ public function productListSortOrderDataProvider(): array
174172
/**
175173
* @magentoDataFixture Magento/Store/_files/second_store.php
176174
* @magentoDataFixture Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php
177-
* @magentoConfigFixture default/catalog/search/engine mysql
178175
* @dataProvider productListSortOrderDataProviderOnStoreView
179176
* @param string $sortBy
180177
* @param string $direction
@@ -198,7 +195,6 @@ public function testProductListSortOrderOnStoreView(
198195
/**
199196
* @magentoDataFixture Magento/Store/_files/second_store.php
200197
* @magentoDataFixture Magento/Catalog/_files/products_with_not_empty_layered_navigation_attribute.php
201-
* @magentoConfigFixture default/catalog/search/engine mysql
202198
* @dataProvider productListSortOrderDataProviderOnStoreView
203199
* @param string $sortBy
204200
* @param string $direction

dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DataProvider/PriceTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ public function getRangeItemCountsDataProvider()
8181
/**
8282
* @magentoDataFixture Magento/Catalog/_files/categories.php
8383
* @magentoDbIsolation disabled
84-
* @magentoConfigFixture default/catalog/search/engine mysql
8584
* @dataProvider getRangeItemCountsDataProvider
8685
*/
8786
public function testGetRangeItemCounts($inputRange, $expectedItemCounts)

dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmAdvancedTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class AlgorithmAdvancedTest extends \PHPUnit\Framework\TestCase
1717
* @magentoDataFixture Magento/Catalog/Model/Layer/Filter/Price/_files/products_advanced.php
1818
* @magentoDbIsolation disabled
1919
* @magentoAppIsolation enabled
20-
* @magentoConfigFixture default/catalog/search/engine mysql
2120
* @covers \Magento\Framework\Search\Dynamic\Algorithm::calculateSeparators
2221
*/
2322
public function testWithoutLimits()
@@ -90,7 +89,6 @@ protected function _prepareFilter($layer, $priceResource, $request = null)
9089
* @magentoDataFixture Magento/Catalog/Model/Layer/Filter/Price/_files/products_advanced.php
9190
* @magentoDbIsolation disabled
9291
* @magentoAppIsolation enabled
93-
* @magentoConfigFixture default/catalog/search/engine mysql
9492
* @covers \Magento\Framework\Search\Dynamic\Algorithm::calculateSeparators
9593
*/
9694
public function testWithLimits()

dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmBaseTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class AlgorithmBaseTest extends \PHPUnit\Framework\TestCase
3838
/**
3939
* @magentoDbIsolation disabled
4040
* @magentoAppIsolation enabled
41-
* @magentoConfigFixture default/catalog/search/engine mysql
4241
* @dataProvider pricesSegmentationDataProvider
4342
* @covers \Magento\Framework\Search\Dynamic\Algorithm::calculateSeparators
4443
*/

dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Result/IndexTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class IndexTest extends AbstractController
2020
/**
2121
* Quick search test by difference product attributes.
2222
*
23-
* @magentoConfigFixture default/catalog/search/engine mysql
2423
* @magentoAppArea frontend
2524
* @magentoDataFixture Magento/CatalogSearch/_files/product_for_search.php
2625
* @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php

dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/FullTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
*/
2121
class FullTest extends \PHPUnit\Framework\TestCase
2222
{
23+
protected function setUp()
24+
{
25+
$this->markTestSkipped("MC-18948: Mysql Search Engine is deprecated");
26+
}
2327
/**
2428
* Testing fulltext index rebuild
2529
*

dev/tests/integration/testsuite/Magento/CatalogSearch/Model/ResourceModel/Fulltext/CollectionTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
*/
1212
class CollectionTest extends \PHPUnit\Framework\TestCase
1313
{
14+
protected function setUp()
15+
{
16+
$this->markTestSkipped("MC-18948: Mysql Search Engine is deprecated");
17+
}
18+
1419
/**
1520
* @dataProvider filtersDataProviderSearch
1621
* @magentoDataFixture Magento/Framework/Search/_files/products.php

dev/tests/integration/testsuite/Magento/CatalogSearch/Model/Search/AttributeSearchWeightTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ protected function tearDown()
6262
/**
6363
* Perform search by word and check founded product order in different cases.
6464
*
65-
* @magentoConfigFixture default/catalog/search/engine mysql
6665
* @magentoDataFixture Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php
6766
* @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php
6867
* @dataProvider attributeSearchWeightDataProvider

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/QuickSearchTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ protected function setUp()
5555
/**
5656
* Assert that configurable child products has not found by query using mysql search engine.
5757
*
58-
* @magentoConfigFixture default/catalog/search/engine mysql
59-
*
6058
* @return void
6159
*/
6260
public function testChildProductsHasNotFoundedByQuery(): void

dev/tests/integration/testsuite/Magento/Elasticsearch/SearchAdapter/AdapterTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Elasticsearch\SearchAdapter;
77

88
use Magento\Framework\Search\EngineResolverInterface;
9+
use Magento\TestFramework\Helper\Bootstrap;
910
use Magento\TestModuleCatalogSearch\Model\ElasticsearchVersionChecker;
1011

1112
/**
@@ -30,6 +31,33 @@ class AdapterTest extends \Magento\Framework\Search\Adapter\Mysql\AdapterTest
3031
*/
3132
protected $searchEngine;
3233

34+
protected function setUp()
35+
{
36+
$this->objectManager = Bootstrap::getObjectManager();
37+
38+
/** @var \Magento\Framework\Search\Request\Config\Converter $converter */
39+
$converter = $this->objectManager->create(\Magento\Framework\Search\Request\Config\Converter::class);
40+
41+
$document = new \DOMDocument();
42+
$document->load($this->getRequestConfigPath());
43+
$requestConfig = $converter->convert($document);
44+
45+
/** @var \Magento\Framework\Search\Request\Config $config */
46+
$config = $this->objectManager->create(\Magento\Framework\Search\Request\Config::class);
47+
$config->merge($requestConfig);
48+
49+
$this->requestBuilder = $this->objectManager->create(
50+
\Magento\Framework\Search\Request\Builder::class,
51+
['config' => $config]
52+
);
53+
54+
$this->adapter = $this->createAdapter();
55+
56+
$indexer = $this->objectManager->create(\Magento\Indexer\Model\Indexer::class);
57+
$indexer->load('catalogsearch_fulltext');
58+
$indexer->reindexAll();
59+
}
60+
3361
/**
3462
* Get request config path
3563
*

0 commit comments

Comments
 (0)