Skip to content

Commit e3ca0a7

Browse files
committed
MAGETWO-92402: Write tests for price indexer parallelization
1 parent dee024b commit e3ca0a7

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

dev/tests/integration/framework/Magento/TestFramework/Annotation/IndexerDimensionMode.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,23 @@ class IndexerDimensionMode
4646
private function restoreDb()
4747
{
4848
$this->db = Bootstrap::getInstance()->getBootstrap()->getApplication()->getDbInstance();
49+
$this->objectManager = Bootstrap::getObjectManager();
4950
$this->db->restoreFromDbDump();
51+
$this->cacheTypeList = $this->objectManager->get(TypeListInterface::class);
5052
$this->cacheTypeList->cleanType('config');
5153
$this->objectManager->get(Config::class)->clean();
5254
}
5355

54-
private function initSwicher()
55-
{
56-
if (!$this->modeSwitcher) {
57-
$this->objectManager = Bootstrap::getObjectManager();
58-
$this->modeSwitcher = $this->objectManager->get(ModeSwitcher::class);
59-
$this->configWriter = $this->objectManager->get(ConfigInterface::class);
60-
$this->configReader = $this->objectManager->get(ScopeConfigInterface::class);
61-
$this->cacheTypeList = $this->objectManager->get(TypeListInterface::class);
62-
}
63-
}
64-
6556
/**
6657
* @param string $mode
6758
*/
6859
private function setDimensionMode($mode, $test)
6960
{
70-
$this->initSwicher();
61+
$this->objectManager = Bootstrap::getObjectManager();
62+
$this->modeSwitcher = $this->objectManager->get(ModeSwitcher::class);
63+
$this->configWriter = $this->objectManager->get(ConfigInterface::class);
64+
$this->configReader = $this->objectManager->get(ScopeConfigInterface::class);
65+
$this->cacheTypeList = $this->objectManager->get(TypeListInterface::class);
7166

7267
$this->configReader->clean();
7368
$previousMode = $this->configReader->getValue(ModeSwitcher::XML_PATH_PRICE_DIMENSIONS_MODE) ?:

dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceWithDimensionTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* Tests product model:
1515
* - pricing behaviour is tested
1616
* @group indexer_dimension
17+
* @magentoDbIsolation disabled
18+
* @magentoIndexerDimensionMode catalog_product_price website_and_customer_group
1719
* @see \Magento\Catalog\Model\ProductTest
1820
* @see \Magento\Catalog\Model\ProductExternalTest
1921
*/
@@ -82,8 +84,6 @@ public function testSetGetFinalPrice()
8284
}
8385

8486
/**
85-
* @magentoDbIsolation disabled
86-
* @magentoIndexerDimensionMode catalog_product_price website_and_customer_group
8787
* @magentoDataFixture Magento/Catalog/_files/product_with_options.php
8888
*/
8989
public function testGetMinPrice()
@@ -99,8 +99,6 @@ public function testGetMinPrice()
9999
}
100100

101101
/**
102-
* @magentoDbIsolation disabled
103-
* @magentoIndexerDimensionMode catalog_product_price website_and_customer_group
104102
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable_sku.php
105103
*/
106104
public function testGetMinPriceForComposite()

dev/tests/integration/testsuite/Magento/ConfigurableProduct/Pricing/Price/SpecialPriceIndexerWithDimensionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ protected function setUp()
4848
*
4949
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
5050
* @magentoDataFixture Magento/Catalog/_files/enable_price_index_schedule.php
51-
* @magentoDbIsolation disabled
5251
*/
5352
public function testFullReindexIfChildHasSpecialPrice()
5453
{

0 commit comments

Comments
 (0)