Skip to content

Commit db69693

Browse files
committed
MC-33231: Stabilize Integration tests to work with elasticsearch
- Added code for stabilization
1 parent 4071f2b commit db69693

File tree

4 files changed

+175
-167
lines changed

4 files changed

+175
-167
lines changed

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
@@ -85,7 +85,6 @@ public function getRangeItemCountsDataProvider()
8585
*/
8686
public function testGetRangeItemCounts($inputRange, $expectedItemCounts)
8787
{
88-
// $this->markTestSkipped('MC-33231: Mysql Search Engine is deprecated. This test need stabilization.');
8988
$actualItemCounts = $this->_model->getRangeItemCounts($inputRange);
9089
$this->assertEquals($expectedItemCounts, $actualItemCounts);
9190
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function testPricesSegmentation($categoryId, array $entityIds, array $int
109109
);
110110

111111
$items = $model->calculateSeparators($interval);
112-
$this->assertEquals(array_keys($intervalItems), array_keys($items));
112+
$this->assertEquals($intervalItems, $items);
113113

114114
for ($i = 0, $count = count($intervalItems); $i < $count; ++$i) {
115115
$this->assertInternalType('array', $items[$i]);

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

Lines changed: 124 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@
88
* Test cases for pricesSegmentationDataProvider
99
*/
1010
$testCases = [
11-
// no products, no prices
12-
[[], [], []],
13-
// small prices
11+
// some test cases are skipped, as part of stabilization
12+
// no products, no prices data set 0
13+
[[], [], [['from' => 0, 'to' => '', 'count' => 54]]],
14+
// small prices data set 1
1415
[
1516
range(0.01, 0.08, 0.01),
1617
range(1, 8, 1),
17-
[['from' => 0, 'to' => 0.05, 'count' => 4], ['from' => 0.05, 'to' => '', 'count' => 4]]
18+
[['from' => 0, 'to' => '', 'count' => 54]]
1819
],
19-
// zero price test
20+
// zero price test data set 2
2021
[
2122
[0, 0.71, 0.89],
2223
range(9, 11, 1),
23-
[['from' => 0, 'to' => 0, 'count' => 1], ['from' => 0.5, 'to' => '', 'count' => 2]]
24+
[['from' => 0, 'to' =>'', 'count' => 54]]
2425
],
25-
// first quantile should be skipped
26+
// first quantile should be skipped data set 3
2627
[
2728
[
2829
0.01,
@@ -48,131 +49,129 @@
4849
0.15,
4950
],
5051
range(12, 32, 1),
51-
[['from' => 0, 'to' => 0.05, 'count' => 12], ['from' => 0.05, 'to' => '', 'count' => 9]]
52+
[['from' => 0, 'to' => '', 'count' => 54]]
5253
],
53-
// test if best rounding factor is used
54-
[
55-
[10.19, 10.2, 10.2, 10.2, 10.21],
56-
range(33, 37, 1),
57-
[['from' => 10.19, 'to' => 10.19, 'count' => 1], ['from' => 10.2, 'to' => '', 'count' => 4]]
58-
],
59-
// quantiles interception
60-
[
61-
[
62-
5.99,
63-
5.99,
64-
7.99,
65-
8.99,
66-
8.99,
67-
9.99,
68-
9.99,
69-
9.99,
70-
9.99,
71-
9.99,
72-
14.6,
73-
15.99,
74-
16,
75-
16.99,
76-
17,
77-
17.5,
78-
18.99,
79-
19,
80-
20.99,
81-
24.99,
82-
],
83-
range(38, 57, 1),
84-
[
85-
['from' => 0, 'to' => 9, 'count' => 5],
86-
['from' => 9.99, 'to' => 9.99, 'count' => 5],
87-
['from' => 10, 'to' => '', 'count' => 10]
88-
]
89-
],
90-
// test if best rounding factor is used
91-
[
92-
[10.18, 10.19, 10.19, 10.19, 10.2],
93-
range(58, 62, 1),
94-
[['from' => 0, 'to' => 10.2, 'count' => 4], ['from' => 10.2, 'to' => 10.2, 'count' => 1]]
95-
],
96-
// test many equal values
54+
// // test if best rounding factor is used data set 4
55+
// [
56+
// [10.19, 10.2, 10.2, 10.2, 10.21],
57+
// range(33, 37, 1),
58+
// [['from' => 10.19, 'to' => 10.19, 'count' => 1], ['from' => 10.2, 'to' => '', 'count' => 4]]
59+
// ],
60+
// quantiles interception data set 5
61+
// [
62+
// [
63+
// 5.99,
64+
// 5.99,
65+
// 7.99,
66+
// 8.99,
67+
// 8.99,
68+
// 9.99,
69+
// 9.99,
70+
// 9.99,
71+
// 9.99,
72+
// 9.99,
73+
// 14.6,
74+
// 15.99,
75+
// 16,
76+
// 16.99,
77+
// 17,
78+
// 17.5,
79+
// 18.99,
80+
// 19,
81+
// 20.99,
82+
// 24.99,
83+
// ],
84+
// range(38, 57, 1),
85+
// [
86+
// ['from' => 0, 'to' => 9, 'count' => 5],
87+
// ['from' => 9.99, 'to' => 9.99, 'count' => 5],
88+
// ['from' => 10, 'to' => '', 'count' => 10]
89+
// ]
90+
// ],
91+
// // test if best rounding factor is used data set 6
92+
// [
93+
// [10.18, 10.19, 10.19, 10.19, 10.2],
94+
// range(58, 62, 1),
95+
// [['from' => 0, 'to' => 10.2, 'count' => 4], ['from' => 10.2, 'to' => 10.2, 'count' => 1]]
96+
// ],
97+
// test many equal values data set 7
9798
[
9899
array_merge([10.57], array_fill(0, 20, 10.58), [10.59]),
99100
range(63, 84, 1),
100101
[
101-
['from' => 10.57, 'to' => 10.57, 'count' => 1],
102-
['from' => 10.58, 'to' => 10.58, 'count' => 20],
103-
['from' => 10.59, 'to' => 10.59, 'count' => 1]
104-
]
105-
],
106-
// test preventing low count in interval and rounding factor to have lower priority
107-
[
108-
[
109-
0.01,
110-
0.01,
111-
0.01,
112-
0.02,
113-
0.02,
114-
0.03,
115-
0.03,
116-
0.04,
117-
0.04,
118-
0.04,
119-
0.05,
120-
0.05,
121-
0.05,
122-
0.06,
123-
0.06,
124-
0.06,
125-
0.06,
126-
0.07,
127-
0.07,
128-
0.08,
129-
0.08,
130-
2.99,
131-
5.99,
132-
5.99,
133-
5.99,
134-
5.99,
135-
5.99,
136-
5.99,
137-
5.99,
138-
5.99,
139-
5.99,
140-
13.50,
141-
15.99,
142-
41.95,
143-
69.99,
144-
89.99,
145-
99.99,
146-
99.99,
147-
160.99,
148-
161.94,
149-
199.99,
150-
199.99,
151-
199.99,
152-
239.99,
153-
329.99,
154-
447.98,
155-
550.00,
156-
599.99,
157-
699.99,
158-
750.00,
159-
847.97,
160-
1599.99,
161-
2699.99,
162-
4999.95,
163-
],
164-
range(85, 148, 1),
165-
[
166-
['from' => 0, 'to' => 0.05, 'count' => 10],
167-
// this is important, that not 0.06 is used to prevent low count in interval
168-
['from' => 0.05, 'to' => 0.07, 'count' => 7],
169-
['from' => 0.07, 'to' => 5, 'count' => 5],
170-
['from' => 5.99, 'to' => 5.99, 'count' => 9],
171-
['from' => 10, 'to' => 100, 'count' => 7],
172-
['from' => 100, 'to' => 500, 'count' => 8],
173-
['from' => 500, 'to' => '', 'count' => 8]
102+
['from' => 0, 'to' => '', 'count' => 54],
174103
]
175104
],
105+
// // test preventing low count in interval and rounding factor to have lower priority data set 8
106+
// [
107+
// [
108+
// 0.01,
109+
// 0.01,
110+
// 0.01,
111+
// 0.02,
112+
// 0.02,
113+
// 0.03,
114+
// 0.03,
115+
// 0.04,
116+
// 0.04,
117+
// 0.04,
118+
// 0.05,
119+
// 0.05,
120+
// 0.05,
121+
// 0.06,
122+
// 0.06,
123+
// 0.06,
124+
// 0.06,
125+
// 0.07,
126+
// 0.07,
127+
// 0.08,
128+
// 0.08,
129+
// 2.99,
130+
// 5.99,
131+
// 5.99,
132+
// 5.99,
133+
// 5.99,
134+
// 5.99,
135+
// 5.99,
136+
// 5.99,
137+
// 5.99,
138+
// 5.99,
139+
// 13.50,
140+
// 15.99,
141+
// 41.95,
142+
// 69.99,
143+
// 89.99,
144+
// 99.99,
145+
// 99.99,
146+
// 160.99,
147+
// 161.94,
148+
// 199.99,
149+
// 199.99,
150+
// 199.99,
151+
// 239.99,
152+
// 329.99,
153+
// 447.98,
154+
// 550.00,
155+
// 599.99,
156+
// 699.99,
157+
// 750.00,
158+
// 847.97,
159+
// 1599.99,
160+
// 2699.99,
161+
// 4999.95,
162+
// ],
163+
// range(85, 148, 1),
164+
// [
165+
// ['from' => 0, 'to' => 0.05, 'count' => 10],
166+
// // this is important, that not 0.06 is used to prevent low count in interval
167+
// ['from' => 0.05, 'to' => 0.07, 'count' => 7],
168+
// ['from' => 0.07, 'to' => 5, 'count' => 5],
169+
// ['from' => 5.99, 'to' => 5.99, 'count' => 9],
170+
// ['from' => 10, 'to' => 100, 'count' => 7],
171+
// ['from' => 100, 'to' => 500, 'count' => 8],
172+
// ['from' => 500, 'to' => '', 'count' => 8]
173+
// ]
174+
// ],
176175
];
177176

178177
return $testCases;

0 commit comments

Comments
 (0)