Skip to content

Commit 32710af

Browse files
committed
MC-33231: Stabilize Integration tests to work with elasticsearch
- skip tests
1 parent 2363636 commit 32710af

File tree

2 files changed

+119
-45
lines changed

2 files changed

+119
-45
lines changed

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

Lines changed: 100 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,18 @@ protected function setUp()
8989
* @param string $sortBy
9090
* @param string $direction
9191
* @param array $expectation
92+
* @param string|null $incompleteReason
9293
* @return void
9394
*/
94-
public function testProductListSortOrder(string $sortBy, string $direction, array $expectation): void
95-
{
95+
public function testProductListSortOrder(
96+
string $sortBy,
97+
string $direction,
98+
array $expectation,
99+
string $incompleteReason = null
100+
): void {
101+
if ($incompleteReason) {
102+
$this->markTestIncomplete($incompleteReason);
103+
}
96104
$category = $this->updateCategorySortBy('Category 1', Store::DEFAULT_STORE_ID, $sortBy);
97105
$this->renderBlock($category, $direction);
98106
$this->assertBlockSorting($sortBy, $expectation);
@@ -104,10 +112,18 @@ public function testProductListSortOrder(string $sortBy, string $direction, arra
104112
* @param string $sortBy
105113
* @param string $direction
106114
* @param array $expectation
115+
* @param string|null $incompleteReason
107116
* @return void
108117
*/
109-
public function testProductListSortOrderWithConfig(string $sortBy, string $direction, array $expectation): void
110-
{
118+
public function testProductListSortOrderWithConfig(
119+
string $sortBy,
120+
string $direction,
121+
array $expectation,
122+
string $incompleteReason = null
123+
): void {
124+
if ($incompleteReason) {
125+
$this->markTestIncomplete($incompleteReason);
126+
}
111127
$this->assertProductListSortOrderWithConfig($sortBy, $direction, $expectation);
112128
}
113129

@@ -147,17 +163,20 @@ public function productListSortOrderDataProvider(): array
147163
'direction' => 'desc',
148164
'expectation' => ['simple3', 'simple2', 'simple1'],
149165
],
150-
// TODO: Skipped MC-33231
151-
//'default_order_custom_attribute_asc' => [
152-
// 'sort' => 'test_configurable',
153-
// 'direction' => 'asc',
154-
// 'expectation' => ['simple1', 'simple3', 'simple2'],
155-
//],
156-
//'default_order_custom_attribute_desc' => [
157-
// 'sort' => 'test_configurable',
158-
// 'direction' => 'desc',
159-
// 'expectation' => ['simple3', 'simple2', 'simple1'],
160-
//],
166+
'default_order_custom_attribute_asc' => [
167+
'sort' => 'test_configurable',
168+
'direction' => 'asc',
169+
'expectation' => ['simple1', 'simple3', 'simple2'],
170+
'incomplete_reason' => 'MC-33825:'
171+
. 'Stabilize skipped test cases for Integration SortingTest with elasticsearch',
172+
],
173+
'default_order_custom_attribute_desc' => [
174+
'sort' => 'test_configurable',
175+
'direction' => 'desc',
176+
'expectation' => ['simple3', 'simple2', 'simple1'],
177+
'incomplete_reason' => 'MC-33825:'
178+
. 'Stabilize skipped test cases for Integration SortingTest with elasticsearch',
179+
],
161180
];
162181
}
163182

@@ -169,14 +188,19 @@ public function productListSortOrderDataProvider(): array
169188
* @param string $direction
170189
* @param array $expectation
171190
* @param string $defaultSortBy
191+
* @param string|null $incompleteReason
172192
* @return void
173193
*/
174194
public function testProductListSortOrderOnStoreView(
175195
string $sortBy,
176196
string $direction,
177197
array $expectation,
178-
string $defaultSortBy
198+
string $defaultSortBy,
199+
string $incompleteReason = null
179200
): void {
201+
if ($incompleteReason) {
202+
$this->markTestIncomplete($incompleteReason);
203+
}
180204
$secondStoreId = (int)$this->storeManager->getStore('fixture_second_store')->getId();
181205
$this->updateCategorySortBy('Category 1', Store::DEFAULT_STORE_ID, $defaultSortBy);
182206
$category = $this->updateCategorySortBy('Category 1', $secondStoreId, $sortBy);
@@ -192,14 +216,19 @@ public function testProductListSortOrderOnStoreView(
192216
* @param string $direction
193217
* @param array $expectation
194218
* @param string $defaultSortBy
219+
* @param string|null $incompleteReason,
195220
* @return void
196221
*/
197222
public function testProductListSortOrderWithConfigOnStoreView(
198223
string $sortBy,
199224
string $direction,
200225
array $expectation,
201-
string $defaultSortBy
226+
string $defaultSortBy,
227+
string $incompleteReason = null
202228
): void {
229+
if ($incompleteReason) {
230+
$this->markTestIncomplete($incompleteReason);
231+
}
203232
$this->objectManager->removeSharedInstance(Config::class);
204233
$secondStoreId = (int)$this->storeManager->getStore('fixture_second_store')->getId();
205234
$this->scopeConfig->setValue(
@@ -225,20 +254,60 @@ public function testProductListSortOrderWithConfigOnStoreView(
225254
*/
226255
public function productListSortOrderDataProviderOnStoreView(): array
227256
{
228-
return array_merge_recursive(
229-
$this->productListSortOrderDataProvider(),
230-
[
231-
'default_order_price_asc' => ['default_sort' => 'position'],
232-
'default_order_price_desc' => ['default_sort' => 'position'],
233-
'default_order_position_asc' => ['default_sort' => 'price'],
234-
'default_order_position_desc' => ['default_sort' => 'price'],
235-
'default_order_name_asc' => ['default_sort' => 'price'],
236-
'default_order_name_desc' => ['default_sort' => 'price'],
237-
// TODO: Skipped MC-33231
238-
//'default_order_custom_attribute_asc' => ['default_sort' => 'price'],
239-
//'default_order_custom_attribute_desc' => ['default_sort' => 'price'],
240-
]
241-
);
257+
return [
258+
'default_order_price_asc' => [
259+
'sort' => 'price',
260+
'direction' => 'asc',
261+
'expectation' => ['simple1', 'simple2', 'simple3'],
262+
'default_sort' => 'position'
263+
],
264+
'default_order_price_desc' => [
265+
'sort' => 'price',
266+
'direction' => 'desc',
267+
'expectation' => ['simple3', 'simple2', 'simple1'],
268+
'default_sort' => 'position'
269+
],
270+
'default_order_position_asc' => [
271+
'sort' => 'position',
272+
'direction' => 'asc',
273+
'expectation' => ['simple1', 'simple2', 'simple3'],
274+
'default_sort' => 'price'
275+
],
276+
'default_order_position_desc' => [
277+
'sort' => 'position',
278+
'direction' => 'desc',
279+
'expectation' => ['simple3', 'simple2', 'simple1'],
280+
'default_sort' => 'price'
281+
],
282+
'default_order_name_asc' => [
283+
'sort' => 'name',
284+
'direction' => 'asc',
285+
'expectation' => ['simple1', 'simple2', 'simple3'],
286+
'default_sort' => 'price'
287+
],
288+
'default_order_name_desc' => [
289+
'sort' => 'name',
290+
'direction' => 'desc',
291+
'expectation' => ['simple3', 'simple2', 'simple1'],
292+
'default_sort' => 'price'
293+
],
294+
'default_order_custom_attribute_asc' => [
295+
'sort' => 'test_configurable',
296+
'direction' => 'asc',
297+
'expectation' => ['simple1', 'simple3', 'simple2'],
298+
'default_sort' => 'price',
299+
'incomplete_reason' => 'MC-33825:'
300+
. 'Stabilize skipped test cases for Integration SortingTest with elasticsearch',
301+
],
302+
'default_order_custom_attribute_desc' => [
303+
'sort' => 'test_configurable',
304+
'direction' => 'desc',
305+
'expectation' => ['simple3', 'simple2', 'simple1'],
306+
'default_sort' => 'price',
307+
'incomplete_reason' => 'MC-33825:'
308+
. 'Stabilize skipped test cases for Integration SortingTest with elasticsearch',
309+
],
310+
];
242311
}
243312

244313
/**

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

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,18 @@ protected function tearDown()
7070
* @param string $searchQuery
7171
* @param array $attributeWeights
7272
* @param array $expectedProductNames
73+
* @param string|null $incompleteReason
7374
* @return void
7475
*/
7576
public function testAttributeSearchWeight(
7677
string $searchQuery,
7778
array $attributeWeights,
78-
array $expectedProductNames
79+
array $expectedProductNames,
80+
string $incompleteReason = null
7981
): void {
82+
if ($incompleteReason) {
83+
$this->markTestIncomplete($incompleteReason);
84+
}
8085
$this->updateAttributesWeight($attributeWeights);
8186
$actualProductNames = $this->quickSearchByQuery->execute($searchQuery)->getColumnValues('name');
8287
$this->assertEquals($expectedProductNames, $actualProductNames, 'Products order is not as expected.');
@@ -90,18 +95,6 @@ public function testAttributeSearchWeight(
9095
public function attributeSearchWeightDataProvider(): array
9196
{
9297
return [
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-
//],
10598
'name_order_more_than_sku' => [
10699
'Nintendo Wii',
107100
[
@@ -143,7 +136,19 @@ public function attributeSearchWeightDataProvider(): array
143136
'Gamecube attribute',
144137
],
145138
],
146-
139+
'sku_order_more_than_name' => [
140+
'Nintendo Wii',
141+
[
142+
'sku' => 6,
143+
'name' => 5,
144+
],
145+
[
146+
'Xbox',
147+
'Nintendo Wii',
148+
],
149+
'incomplete_reason' => 'MC-33824:'
150+
. 'Stabilize skipped test cases for Integration AttributeSearchWeightTest with elasticsearch',
151+
],
147152
];
148153
}
149154

0 commit comments

Comments
 (0)