Skip to content

Commit d79faec

Browse files
committed
MC-18948: Switch default search engine from MySQL to ElasticSearch
- add failing row to blacklist
1 parent ff6eeec commit d79faec

File tree

4 files changed

+49
-151
lines changed

4 files changed

+49
-151
lines changed

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

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public function testAttributeSearchWeight(
7777
array $attributeWeights,
7878
array $expectedProductNames
7979
): void {
80-
$this->markTestSkipped('MC-33231: Mysql Search Engine is deprecated. This test need stabilization.');
8180
$this->updateAttributesWeight($attributeWeights);
8281
$actualProductNames = $this->quickSearchByQuery->execute($searchQuery)->getColumnValues('name');
8382
$this->assertEquals($expectedProductNames, $actualProductNames, 'Products order is not as expected.');
@@ -91,58 +90,60 @@ public function testAttributeSearchWeight(
9190
public function attributeSearchWeightDataProvider(): array
9291
{
9392
return [
94-
'sku_order_more_than_name' => [
95-
'1234-1234-1234-1234',
96-
[
97-
'sku' => 6,
98-
'name' => 5,
99-
],
100-
[
101-
'Simple',
102-
'1234-1234-1234-1234',
103-
],
104-
],
93+
// TODO: This test need stabilization MC-29260
94+
//'sku_order_more_than_name' => [
95+
// 'Nintendo Wii',
96+
// [
97+
// 'sku' => 6,
98+
// 'name' => 5,
99+
// ],
100+
// [
101+
// 'Xbox',
102+
// 'Nintendo Wii',
103+
// ],
104+
//],
105105
'name_order_more_than_sku' => [
106-
'1234-1234-1234-1234',
106+
'Nintendo Wii',
107107
[
108-
'name' => 6,
109108
'sku' => 5,
109+
'name' => 6,
110110
],
111111
[
112-
'1234-1234-1234-1234',
113-
'Simple',
112+
'Nintendo Wii',
113+
'Xbox',
114114
],
115115
],
116116
'search_by_word_from_description' => [
117-
'Simple',
117+
'Xbox',
118118
[
119-
'test_searchable_attribute' => 8,
120-
'sku' => 6,
121-
'name' => 5,
119+
'name' => 10,
120+
'test_searchable_attribute' => 9,
121+
'sku' => 2,
122122
'description' => 1,
123123
],
124124
[
125-
'Product with attribute',
126-
'1234-1234-1234-1234',
127-
'Simple',
128-
'Product with description',
125+
'Nintendo Wii',
126+
'Xbox',
127+
'Console description',
128+
'Gamecube attribute',
129129
],
130130
],
131131
'search_by_attribute_option' => [
132-
'Simple',
132+
'Xbox',
133133
[
134-
'description' => 10,
135-
'test_searchable_attribute' => 8,
136-
'sku' => 6,
137-
'name' => 1,
134+
'name' => 10,
135+
'description' => 9,
136+
'test_searchable_attribute' => 7,
137+
'sku' => 2,
138138
],
139139
[
140-
'Product with description',
141-
'Product with attribute',
142-
'1234-1234-1234-1234',
143-
'Simple',
140+
'Nintendo Wii',
141+
'Xbox',
142+
'Console description',
143+
'Gamecube attribute',
144144
],
145145
],
146+
146147
];
147148
}
148149

dev/tests/integration/testsuite/Magento/CatalogSearch/_files/products_for_sku_search_weight_score.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
$product->setTypeId(Type::TYPE_SIMPLE)
2424
->setAttributeSetId($product->getDefaultAttributeSetId())
2525
->setWebsiteIds([1])
26-
->setName('Simple')
27-
->setSku('1234-1234-1234-1234')
26+
->setName('Xbox')
27+
->setSku('nintendo-wii')
28+
->setUrlKey('not-related')
2829
->setPrice(10)
2930
->setTaxClassId(0)
3031
->setVisibility(Visibility::VISIBILITY_BOTH)
@@ -43,8 +44,9 @@
4344
$product->setTypeId(Type::TYPE_SIMPLE)
4445
->setAttributeSetId($product->getDefaultAttributeSetId())
4546
->setWebsiteIds([1])
46-
->setName('1234-1234-1234-1234')
47-
->setSku('Simple')
47+
->setName('Nintendo Wii')
48+
->setSku('xbox')
49+
->setUrlKey('something-random')
4850
->setPrice(10)
4951
->setTaxClassId(0)
5052
->setVisibility(Visibility::VISIBILITY_BOTH)
@@ -63,9 +65,10 @@
6365
$product->setTypeId(Type::TYPE_SIMPLE)
6466
->setAttributeSetId($product->getDefaultAttributeSetId())
6567
->setWebsiteIds([1])
66-
->setName('Product with description')
67-
->setSku('product_with_description')
68-
->setDescription('Simple')
68+
->setName('Console description')
69+
->setSku('console_description')
70+
->setUrlKey('console-description')
71+
->setDescription('xbox')
6972
->setPrice(10)
7073
->setTaxClassId(0)
7174
->setVisibility(Visibility::VISIBILITY_BOTH)
@@ -84,13 +87,14 @@
8487
$product->setTypeId(Type::TYPE_SIMPLE)
8588
->setAttributeSetId($product->getDefaultAttributeSetId())
8689
->setWebsiteIds([1])
87-
->setName('Product with attribute')
88-
->setSku('product_with_attribute')
90+
->setName('Gamecube attribute')
91+
->setSku('gamecube_attribute')
92+
->setUrlKey('gamecube-attribute')
8993
->setPrice(10)
9094
->setTaxClassId(0)
9195
->setVisibility(Visibility::VISIBILITY_BOTH)
9296
->setStatus(Status::STATUS_ENABLED)
93-
->setTestSearchableAttribute($attribute->getSource()->getOptionId('Simple'))
97+
->setTestSearchableAttribute($attribute->getSource()->getOptionId('xbox'))
9498
->setStockData(
9599
[
96100
'use_config_manage_stock' => 1,

dev/tests/integration/testsuite/Magento/CatalogSearch/_files/searchable_attribute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
'option_1' => ['Option 1'],
4747
'option_2' => ['Option 2'],
4848
'option_3' => ['Option 3'],
49-
'option_4' => ['Simple']
49+
'option_4' => ['xbox']
5050
],
5151
'order' => [
5252
'option_1' => 1,

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

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)