Skip to content

Commit

Permalink
Github #99: Sync "develop-storefront" with master branches
Browse files Browse the repository at this point in the history
  • Loading branch information
le0n4ik committed Aug 3, 2020
1 parent 5c3c2f5 commit b00d9e6
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,3 @@
$attributeRepository->save($attribute);

CacheCleaner::cleanAll();

// Run from CLI due to some classes involved in reindex process have state which do not allow to reindex
$appDir = dirname(Bootstrap::getInstance()->getAppTempDir());
$out = '';
// phpcs:ignore Magento2.Security.InsecureFunction
exec("php -f {$appDir}/bin/magento indexer:reindex catalogsearch_fulltext", $out);
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,3 @@
$product->getSku(),
[2]
);

/**
* We need to remember that automatic reindexation is not working properly in integration tests
* Reindexation is sitting on top of afterCommit callbacks:
* \Magento\Catalog\Model\Product::priceReindexCallback
*
* However, callbacks are applied only when transaction_level = 0 (when transaction is commited), however
* integration tests are not committing transactions, so we need to reindex data manually in order to reuse it in tests
*/
/** @var \Magento\Indexer\Model\Indexer $indexer */
$indexer = $objectManager->create(\Magento\Indexer\Model\Indexer::class);
$indexer->load('catalog_product_price');
$indexer->reindexRow($product->getId());
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,3 @@
$product->getSku(),
[2]
);

/**
* We need to remember that automatic reindexation is not working properly in integration tests
* Reindexation is sitting on top of afterCommit callbacks:
* \Magento\Catalog\Model\Product::priceReindexCallback
*
* However, callbacks are applied only when transaction_level = 0 (when transaction is commited), however
* integration tests are not committing transactions, so we need to reindex data manually in order to reuse it in tests
*/
/** @var \Magento\Indexer\Model\Indexer $indexer */
$indexer = $objectManager->create(\Magento\Indexer\Model\Indexer::class);
$indexer->load('catalog_product_price');
$indexer->reindexRow($product->getId());
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,3 @@
}
}
CacheCleaner::cleanAll();

// Run from CLI due to some classes involved in reindex process have state which do not allow to reindex
$appDir = dirname(Bootstrap::getInstance()->getAppTempDir());
$out = '';
// phpcs:ignore Magento2.Security.InsecureFunction
exec("php -f {$appDir}/bin/magento indexer:reindex catalogsearch_fulltext", $out);
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,3 @@
$productRepository->save($product);

CacheCleaner::cleanAll();

// Run from CLI due to some classes involved in reindex process have state which do not allow to reindex
$appDir = dirname(Bootstrap::getInstance()->getAppTempDir());
$out = '';
// phpcs:ignore Magento2.Security.InsecureFunction
exec("php -f {$appDir}/bin/magento indexer:reindex catalogsearch_fulltext", $out);
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,3 @@
$product->getSku(),
[2]
);

/**
* We need to remember that automatic reindexation is not working properly in integration tests
* Reindexation is sitting on top of afterCommit callbacks:
* \Magento\Catalog\Model\Product::priceReindexCallback
*
* However, callbacks are applied only when transaction_level = 0 (when transaction is commited), however
* integration tests are not committing transactions, so we need to reindex data manually in order to reuse it in tests
*/
/** @var \Magento\Indexer\Model\Indexer $indexer */
$indexer = Bootstrap::getObjectManager()->create(\Magento\Indexer\Model\Indexer::class);
$indexer->load('catalog_product_price');
$indexer->reindexRow($product->getId());
$indexer->reindexList($idsToReindex);
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
$attributeValues = [];
$attributeSetId = $installer->getAttributeSetId('catalog_product', 'Default');
$associatedProductIds = [];
$idsToReindex = $productIds = [10, 20];
array_shift($options); //remove the first option which is empty

foreach ($options as $option) {
Expand Down Expand Up @@ -142,16 +141,3 @@
$product->getSku(),
[2]
);

/**
* We need to remember that automatic reindexation is not working properly in integration tests
* Reindexation is sitting on top of afterCommit callbacks:
* \Magento\Catalog\Model\Product::priceReindexCallback
*
* However, callbacks are applied only when transaction_level = 0 (when transaction is commited), however
* integration tests are not committing transactions, so we need to reindex data manually in order to reuse it in tests
*/
/** @var \Magento\Indexer\Model\Indexer $indexer */
$indexer = Bootstrap::getObjectManager()->create(\Magento\Indexer\Model\Indexer::class);
$indexer->load('catalog_product_price');
$indexer->reindexList($idsToReindex);
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,3 @@
$wishlistForSecondCustomer->loadByCustomerId($secondCustomerIdFromFixture, true);
$item = $wishlistForSecondCustomer->addNewItem($product, new \Magento\Framework\DataObject([]));
$wishlistForSecondCustomer->save();

/**
* We need to remember that automatic reindexation is not working properly in integration tests
* Reindexation is sitting on top of afterCommit callbacks:
* \Magento\Catalog\Model\Product::priceReindexCallback
*
* However, callbacks are applied only when transaction_level = 0 (when transaction is commited), however
* integration tests are not committing transactions, so we need to reindex data manually in order to reuse it in tests
*/
/** @var \Magento\Indexer\Model\Indexer $indexer */
$indexer = Bootstrap::getObjectManager()->create(\Magento\Indexer\Model\Indexer::class);
$indexer->load('catalog_product_price');
$indexer->reindexList([$product->getId()]);
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,3 @@
$wishlist->loadByCustomerId($customer->getId(), true);
$item = $wishlist->addNewItem($product, new DataObject([]));
$wishlist->setSharingCode('fixture_unique_code')->save();

/**
* We need to remember that automatic reindexation is not working properly in integration tests
* Reindexation is sitting on top of afterCommit callbacks:
* \Magento\Catalog\Model\Product::priceReindexCallback
*
* However, callbacks are applied only when transaction_level = 0 (when transaction is commited), however
* integration tests are not committing transactions, so we need to reindex data manually in order to reuse it in tests
*/
/** @var \Magento\Indexer\Model\Indexer $indexer */
$indexer = Bootstrap::getObjectManager()->create(\Magento\Indexer\Model\Indexer::class);
$indexer->load('catalog_product_price');
$indexer->reindexList([$product->getId()]);
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,3 @@
$product = $productRepository->get($productSku);
$product->setStatus(ProductStatus::STATUS_DISABLED);
$productRepository->save($product);

/**
* We need to remember that automatic reindexation is not working properly in integration tests
* Reindexation is sitting on top of afterCommit callbacks:
* \Magento\Catalog\Model\Product::priceReindexCallback
*
* However, callbacks are applied only when transaction_level = 0 (when transaction is commited), however
* integration tests are not committing transactions, so we need to reindex data manually in order to reuse it in tests
*/
/** @var \Magento\Indexer\Model\Indexer $indexer */
$indexer = \Magento\TestFramework\Helper\Bootstrap
::getObjectManager()->create(\Magento\Indexer\Model\Indexer::class);
$indexer->load('catalog_product_price');
$indexer->reindexList([$product->getId()]);

0 comments on commit b00d9e6

Please sign in to comment.