Skip to content

Commit a9723cc

Browse files
Merge pull request #404 from magento-cia/develop-pre-release-sync-08252023
Develop pre release sync 08252023
2 parents b543c58 + b02e7e1 commit a9723cc

File tree

494 files changed

+5327
-1047
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

494 files changed

+5327
-1047
lines changed

Inventory/Model/Source/Command/GetSourcesAssignedToStockOrderedByPriorityCache.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77

88
namespace Magento\Inventory\Model\Source\Command;
99

10+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1011
use Magento\InventoryApi\Api\GetSourcesAssignedToStockOrderedByPriorityInterface;
1112

1213
/**
1314
* @inheritdoc
1415
*/
15-
class GetSourcesAssignedToStockOrderedByPriorityCache implements GetSourcesAssignedToStockOrderedByPriorityInterface
16+
class GetSourcesAssignedToStockOrderedByPriorityCache implements
17+
GetSourcesAssignedToStockOrderedByPriorityInterface,
18+
ResetAfterRequestInterface
1619
{
1720
/**
1821
* @var GetSourcesAssignedToStockOrderedByPriority
@@ -33,6 +36,14 @@ public function __construct(
3336
$this->getSourcesAssignedToStock = $getSourcesAssignedToStockOrderedByPriority;
3437
}
3538

39+
/**
40+
* @inheritDoc
41+
*/
42+
public function _resetState(): void
43+
{
44+
$this->sourcesAssignedToStock = [];
45+
}
46+
3647
/**
3748
* @inheritdoc
3849
*/
@@ -41,7 +52,6 @@ public function execute(int $stockId): array
4152
if (!isset($this->sourcesAssignedToStock[$stockId])) {
4253
$this->sourcesAssignedToStock[$stockId] = $this->getSourcesAssignedToStock->execute($stockId);
4354
}
44-
4555
return $this->sourcesAssignedToStock[$stockId];
4656
}
4757
}

Inventory/Model/SourceItem/Command/GetSourceItemsBySkuCache.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77

88
namespace Magento\Inventory\Model\SourceItem\Command;
99

10+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1011
use Magento\InventoryApi\Api\GetSourceItemsBySkuInterface;
1112

1213
/**
1314
* @inheritdoc
1415
*/
15-
class GetSourceItemsBySkuCache implements GetSourceItemsBySkuInterface
16+
class GetSourceItemsBySkuCache implements GetSourceItemsBySkuInterface, ResetAfterRequestInterface
1617
{
1718
/**
1819
* @var GetSourceItemsBySku
@@ -32,6 +33,14 @@ public function __construct(GetSourceItemsBySku $getSourceItemsBySku)
3233
$this->getSourceItemsBySku = $getSourceItemsBySku;
3334
}
3435

36+
/**
37+
* @inheritDoc
38+
*/
39+
public function _resetState(): void
40+
{
41+
$this->sourceItemsBySku = [];
42+
}
43+
3544
/**
3645
* @inheritdoc
3746
*/

Inventory/Model/Stock/Command/GetCache.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77

88
namespace Magento\Inventory\Model\Stock\Command;
99

10+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1011
use Magento\InventoryApi\Api\Data\StockInterface;
1112

1213
/**
1314
* @inheritdoc
1415
*/
15-
class GetCache implements GetInterface
16+
class GetCache implements GetInterface, ResetAfterRequestInterface
1617
{
1718
/**
1819
* @var Get
@@ -33,6 +34,14 @@ public function __construct(
3334
$this->getStock = $getStock;
3435
}
3536

37+
/**
38+
* @inheritDoc
39+
*/
40+
public function _resetState(): void
41+
{
42+
$this->stocks = [];
43+
}
44+
3645
/**
3746
* @inheritdoc
3847
*/
@@ -41,7 +50,6 @@ public function execute(int $stockId): StockInterface
4150
if (!isset($this->stocks[$stockId])) {
4251
$this->stocks[$stockId] = $this->getStock->execute($stockId);
4352
}
44-
4553
return $this->stocks[$stockId];
4654
}
4755
}

Inventory/Plugin/Inventory/Model/ResourceModel/IsProductAssignedToStockCache.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,27 @@
77

88
namespace Magento\Inventory\Plugin\Inventory\Model\ResourceModel;
99

10+
use Magento\Framework\ObjectManager\ResetAfterRequestInterface;
1011
use Magento\Inventory\Model\ResourceModel\IsProductAssignedToStock;
1112

1213
/**
1314
* Caching plugin for IsProductAssignedToStock service.
1415
*/
15-
class IsProductAssignedToStockCache
16+
class IsProductAssignedToStockCache implements ResetAfterRequestInterface
1617
{
1718
/**
1819
* @var array
1920
*/
2021
private $skuToStockIdAssignment = [];
2122

23+
/**
24+
* @inheritDoc
25+
*/
26+
public function _resetState(): void
27+
{
28+
$this->skuToStockIdAssignment = [];
29+
}
30+
2231
/**
2332
* Cache service result to avoid multiple database calls for same item
2433
*

Inventory/Test/Mftf/Test/AdminCanSetOnlyXLeftThresholdForVirtualProductWithTestSourceTest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@
7878
<see userInput="$$virtualProduct1.product[sku]$$" selector="{{StorefrontProductInfoMainSection.productSku}}" stepKey="assertProductSku1"/>
7979

8080
<magentoCLI command="config:set cataloginventory/options/stock_threshold_qty 99" stepKey="setMinQtyToDefaultValue1"/>
81-
<magentoCLI command="indexer:reindex" stepKey="reindex1"/>
82-
<magentoCLI command="cache:flush" stepKey="flushCache1"/>
81+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex1">
82+
<argument name="indices" value=""/>
83+
</actionGroup>
84+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache1">
85+
<argument name="tags" value=""/>
86+
</actionGroup>
8387

8488
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefront">
8589
<argument name="Customer" value="$$customer$$"/>

Inventory/Test/Mftf/Test/AdminCanSetOnlyXLeftTresholdForVirtualProductWithDefaultSourceTest.xml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@
3535
</createData>
3636

3737
<magentoCLI command="config:set cataloginventory/options/stock_threshold_qty 0" stepKey="setMinQtyToDefaultValue1"/>
38-
<magentoCLI command="indexer:reindex" stepKey="reindex1"/>
39-
<magentoCLI command="cache:flush" stepKey="flushCache1"/>
38+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex1">
39+
<argument name="indices" value=""/>
40+
</actionGroup>
41+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache1">
42+
<argument name="tags" value=""/>
43+
</actionGroup>
4044

4145
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>
4246

@@ -52,8 +56,12 @@
5256
<click selector="{{AdminGridMainControls.saveAndContinue}}" stepKey="saveDefaultStock"/>
5357

5458
<comment userInput="Perform reindex and cache flush after assign default stock to main website." stepKey="reindexCacheFlushAfterAssignDefaultStockToMainWebsite"/>
55-
<magentoCLI command="indexer:reindex" stepKey="performReindex"/>
56-
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
59+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="performReindex">
60+
<argument name="indices" value=""/>
61+
</actionGroup>
62+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="cleanCache">
63+
<argument name="tags" value=""/>
64+
</actionGroup>
5765
</before>
5866
<after>
5967
<!--Assign Default Stock to Default Website.-->
@@ -80,8 +88,12 @@
8088
<actionGroup ref="AdminFormSaveAndCloseActionGroup" stepKey="saveAndClose1"/>
8189

8290
<magentoCLI command="config:set cataloginventory/options/stock_threshold_qty 5" stepKey="setMinQtyToDefaultValue1"/>
83-
<magentoCLI command="indexer:reindex" stepKey="reindex1"/>
84-
<magentoCLI command="cache:flush" stepKey="flushCache1"/>
91+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex1">
92+
<argument name="indices" value=""/>
93+
</actionGroup>
94+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache1">
95+
<argument name="tags" value=""/>
96+
</actionGroup>
8597

8698
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefront">
8799
<argument name="Customer" value="$$customer$$"/>
@@ -108,7 +120,9 @@
108120
<click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder"/>
109121
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPage"/>
110122

111-
<magentoCLI command="cache:flush" stepKey="flushCache2"/>
123+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache2">
124+
<argument name="tags" value=""/>
125+
</actionGroup>
112126

113127
<amOnPage url="/$$virtualProduct1.product[sku]$$.html" stepKey="amOnProductPage2"/>
114128
<waitForPageLoad time="30" stepKey="waitForPageLoad4"/>

Inventory/Test/Mftf/Test/AdminCreateVirtualProductWithDefaultSourceTest.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,22 @@
2828
<actionGroup ref="AdminAssignCategoryToProductAndSaveActionGroup" stepKey="assignCategoryToProduct">
2929
<argument name="categoryName" value="$category.name$"/>
3030
</actionGroup>
31-
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
32-
<magentoCLI command="cache:flush" stepKey="flushCache"/>
31+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex1">
32+
<argument name="indices" value=""/>
33+
</actionGroup>
34+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
35+
<argument name="tags" value=""/>
36+
</actionGroup>
3337
</before>
3438
<after>
3539
<!--Clean up test data.-->
3640
<deleteData createDataKey="category" stepKey="deleteCategory"/>
3741
<deleteData createDataKey="product" stepKey="deleteProduct"/>
3842
<actionGroup ref="DisableAllSourcesActionGroup" stepKey="disableAllSources"/>
3943
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
40-
<magentoCron groups="index" stepKey="reindex"/>
44+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
45+
<argument name="indices" value=""/>
46+
</actionGroup>
4147
</after>
4248

4349
<!--Verify product on category page.-->

Inventory/Test/Mftf/Test/AdminOutOfStockThresholdOnVirtualProductPageTest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@
7070
<seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPage"/>
7171
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage"/>
7272

73-
<magentoCLI command="indexer:reindex" stepKey="runIndexerReindex2"/>
74-
<magentoCLI command="cache:flush" stepKey="cleanCacheAfterDisableManageStock2"/>
73+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="runIndexerReindex2">
74+
<argument name="indices" value=""/>
75+
</actionGroup>
76+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="cleanCacheAfterDisableManageStock2">
77+
<argument name="tags" value=""/>
78+
</actionGroup>
7579

7680
<amOnPage url="/$$createProduct1.product[sku]$$.html" stepKey="amOnProductPage2"/>
7781
<waitForPageLoad time="30" stepKey="waitForPageLoad2"/>

Inventory/Test/Mftf/Test/AdminVirtualProductDisabledManageStockOnCustomStockTest.xml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@
3636
<requiredEntity createDataKey="customStock"/>
3737
<requiredEntity createDataKey="customSource1"/>
3838
</createData>
39-
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
40-
<magentoCLI command="cache:flush" stepKey="flushCache"/>
39+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
40+
<argument name="indices" value=""/>
41+
</actionGroup>
42+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
43+
<argument name="tags" value=""/>
44+
</actionGroup>
4145
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>
4246
</before>
4347
<after>
@@ -96,8 +100,12 @@
96100
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveVirtualProduct2"/>
97101

98102
<magentoCLI command="config:set {{TurnOffManageStockConfig.path}} {{TurnOffManageStockConfig.value}}" stepKey="magentoCLI1"/>
99-
<magentoCLI command="indexer:reindex" stepKey="performReindexAfterDisableManageStock"/>
100-
<magentoCLI command="cache:flush" stepKey="cleanCacheAfterDisableManageStock"/>
103+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="performReindexAfterDisableManageStock">
104+
<argument name="indices" value=""/>
105+
</actionGroup>
106+
<actionGroup ref="CliCacheFlushActionGroup" stepKey="cleanCacheAfterDisableManageStock">
107+
<argument name="tags" value=""/>
108+
</actionGroup>
101109

102110
<actionGroup ref="AssertProductInStorefrontCategoryPage" stepKey="checkConfigurableIsPresentOnCategoryPage2">
103111
<argument name="category" value="$$createCategory$$"/>

InventoryAdminUi/Test/Mftf/ActionGroup/DisableSourceActionGroup.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}"
1818
dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true"
1919
stepKey="clearSourcesFilter"/>
20+
<conditionalClick selector="{{AdminGridColumnsControls.cancel}}" dependentSelector="{{AdminGridColumnsControls.cancel}}" visible="true" stepKey="closeGridColumnsPopupIfPresent"/>
2021
<conditionalClick selector="{{AdminGridFilterControls.clearAll}}" dependentSelector=".admin__data-grid-header[data-bind='afterRender: \$data.setToolbarNode'] .admin__data-grid-filters-current._show" visible="true" stepKey="clearTheFiltersIfPresent"/>
2122
<waitForPageLoad stepKey="waitForPageLoad" time="5"/>
2223
<click selector="{{AdminGridFilterControls.filters}}" stepKey="clickOnFilters"/>

0 commit comments

Comments
 (0)