Skip to content

Commit

Permalink
Merge pull request #5746 from magento-tsg/MC-34482-24
Browse files Browse the repository at this point in the history
[TSG][2.4] MC-34482: MFTF tests causing high load on Jenkins agents in MTSv1 platform
  • Loading branch information
fascinosum authored Jun 2, 2020
2 parents 97f9b00 + 54433a7 commit 6b3b90b
Show file tree
Hide file tree
Showing 29 changed files with 254 additions and 78 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="CliCacheCleanActionGroup">
<annotations>
<description>Run cache:clean by CLI with specified cache tags (space separated).</description>
</annotations>
<arguments>
<argument name="tags" type="string"/>
</arguments>

<magentoCLI command="cache:clean" arguments="{{tags}}" stepKey="cleanSpecifiedCache"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="CliCacheFlushActionGroup">
<annotations>
<description>Run cache:flush by CLI with specified cache tags (space separated).</description>
</annotations>
<arguments>
<argument name="tags" type="string"/>
</arguments>

<magentoCLI command="cache:flush" arguments="{{tags}}" stepKey="flushSpecifiedCache"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<requiredEntity createDataKey="createBundleOption"/>
<requiredEntity createDataKey="createSimpleProduct"/>
</createData>
<magentoCron stepKey="runCronIndex" groups="index"/>
<magentoCLI stepKey="runCronIndex" command="cron:run --group=index"/>
</before>
<after>
<!-- Delete Simple Product -->
Expand All @@ -56,9 +56,11 @@
<actionGroup ref="AdminUpdateProductNameAndDescriptionAttributes" stepKey="updateProductAttribute">
<argument name="product" value="UpdateAttributeNameAndDescription"/>
</actionGroup>
<!--Run cron twice-->
<magentoCLI command="cron:run" stepKey="cronRun"/>
<magentoCLI command="cron:run" stepKey="cronRunTwice"/>
<!-- Start message queue for product attribute consumer -->
<actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue">
<argument name="consumerName" value="{{AdminProductAttributeUpdateMessageConsumerData.consumerName}}"/>
<argument name="maxMessages" value="{{AdminProductAttributeUpdateMessageConsumerData.messageLimit}}"/>
</actionGroup>
<!-- Search for a product with a new name and Open Product -->
<actionGroup ref="FilterProductGridByNameActionGroup" stepKey="searchWithNewProductName">
<argument name="product" value="UpdateAttributeNameAndDescription"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<waitForPageLoad stepKey="waitForCatalogSubmenu" time="5"/>
<click stepKey="clickOnProducts" selector="{{CatalogSubmenuSection.products}}"/>
<waitForPageLoad stepKey="waitForProductsPage" time="10"/>
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
<click stepKey="TickCheckbox" selector="{{ProductsPageSection.checkboxForProduct(productName)}}"/>
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
<click stepKey="OpenActions" selector="{{ProductsPageSection.actions}}"/>
<waitForAjaxLoad stepKey="waitForDelete" time="5"/>
<click stepKey="ChooseDelete" selector="{{ProductsPageSection.delete}}"/>
Expand Down
19 changes: 19 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/QueueConsumerData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="AdminProductAttributeUpdateConsumerData">
<data key="consumerName">product_action_attribute.update</data>
<data key="messageLimit">100</data>
</entity>
<entity name="AdminProductAttributeWebsiteUpdateConsumerData">
<data key="consumerName">product_action_attribute.website.update</data>
<data key="messageLimit">100</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<!--Open Index Management Page and Select Index mode "Update by Schedule" -->
<magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="schedule" />
<!-- Run cron twice -->
<magentoCLI command="cron:run" stepKey="runCron1"/>
<magentoCLI command="cron:run" stepKey="runCron2"/>
<magentoCLI command="cron:run" arguments="--group=index" stepKey="runCron1"/>
<magentoCLI command="cron:run" arguments="--group=index" stepKey="runCron2"/>
</before>
<after>
<magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<!--Open Index Management Page and Select Index mode "Update by Schedule" -->
<magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="schedule" />
<!-- Run cron twice -->
<magentoCLI command="cron:run" stepKey="runCron1"/>
<magentoCLI command="cron:run" stepKey="runCron2"/>
<magentoCLI command="cron:run" arguments="--group=index" stepKey="runCron1"/>
<magentoCLI command="cron:run" arguments="--group=index" stepKey="runCron2"/>
</before>
<after>
<magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<!--Open Index Management Page and Select Index mode "Update by Schedule" -->
<magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="schedule" />
<!-- Run cron twice -->
<magentoCLI command="cron:run" stepKey="runCron1"/>
<magentoCLI command="cron:run" stepKey="runCron2"/>
<magentoCLI command="cron:run" arguments="--group=index" stepKey="runCron1"/>
<magentoCLI command="cron:run" arguments="--group=index" stepKey="runCron2"/>
</before>
<after>
<magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@
<waitForPageLoad stepKey="waitForUpdatedProductToSave" />
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="Message is added to queue" stepKey="seeAttributeUpateSuccessMsg"/>

<!-- Run cron twice -->
<magentoCLI command="cron:run" stepKey="runCron1"/>
<magentoCLI command="cron:run" stepKey="runCron2"/>
<reloadPage stepKey="refreshPage"/>
<waitForPageLoad stepKey="waitFormToReload1"/>
<!-- Start message queue -->
<actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueueConsumer">
<argument name="consumerName" value="{{AdminProductAttributeUpdateConsumerData.consumerName}}"/>
<argument name="maxMessages" value="{{AdminProductAttributeUpdateConsumerData.messageLimit}}"/>
</actionGroup>
<!-- Run cron -->
<magentoCLI command="cron:run --group=index" stepKey="runCron"/>

<!--Verify product name, sku and updated price-->
<click stepKey="openFirstProduct" selector="{{AdminProductGridSection.productRowBySku($$simpleProduct1.sku$$)}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<createData entity="ApiSimpleProduct" stepKey="createProductTwo">
<requiredEntity createDataKey="createCategory"/>
</createData>
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
</before>
<after>
<deleteData createDataKey="createProductOne" stepKey="deleteProductOne"/>
Expand All @@ -39,6 +40,7 @@
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="resetSearchFilter"/>
<actionGroup ref="ClearProductsFilterActionGroup" stepKey="clearProductFilter"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
<magentoCron groups="index" stepKey="reindexInvalidatedIndicesAfterDelete"/>
</after>

<!-- Search and select products -->
Expand All @@ -59,22 +61,23 @@
<actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="AdminSwitchStoreViewActionGroup"/>
<!-- Update attribute -->
<checkOption selector="{{AdminEditProductAttributesSection.ChangeAttributePriceToggle}}" stepKey="toggleToChangePrice"/>
<fillField selector="{{AdminEditProductAttributesSection.AttributePrice}}" userInput="$$createProductOne.price$$0" stepKey="fillAttributeNameField"/>
<fillField selector="{{AdminEditProductAttributesSection.AttributePrice}}" userInput="$createProductOne.price$0" stepKey="fillAttributeNameField"/>
<click selector="{{AdminEditProductAttributesSection.Save}}" stepKey="save"/>
<waitForElementVisible selector="{{AdminMessagesSection.success}}" time="60" stepKey="waitForSuccessMessage"/>
<see selector="{{AdminMessagesSection.success}}" userInput="Message is added to queue" stepKey="seeAttributeUpdateSuccessMsg"/>

<!-- Run cron twice -->
<magentoCLI command="cron:run" arguments="--group=consumers" stepKey="runCron1"/>
<magentoCLI command="cron:run" arguments="--group=consumers" stepKey="runCron2"/>
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
<!-- Start message queue for product attribute consumer -->
<actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue">
<argument name="consumerName" value="{{AdminProductAttributeUpdateMessageConsumerData.consumerName}}"/>
<argument name="maxMessages" value="{{AdminProductAttributeUpdateMessageConsumerData.messageLimit}}"/>
</actionGroup>

<!-- Assert on storefront default view -->
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupDefault"/>
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup" stepKey="searchByNameDefault">
<argument name="name" value="&quot;$$createProductOne.name$$&quot;"/>
<argument name="priceFrom" value="$$createProductOne.price$$0"/>
<argument name="priceTo" value="$$createProductOne.price$$0"/>
<argument name="name" value="&quot;$createProductOne.name$&quot;"/>
<argument name="priceFrom" value="$createProductOne.price$0"/>
<argument name="priceTo" value="$createProductOne.price$0"/>
</actionGroup>
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultDefault"/>
<waitForElementVisible selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="waitForSearchResultInDefaultView"/>
Expand All @@ -84,9 +87,9 @@
<actionGroup ref="GoToStoreViewAdvancedCatalogSearchActionGroup" stepKey="GoToStoreViewAdvancedCatalogSearchActionGroupCustom"/>
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="StorefrontSwitchStoreViewActionGroup"/>
<actionGroup ref="StorefrontAdvancedCatalogSearchByProductNameAndPriceActionGroup" stepKey="searchByNameCustom">
<argument name="name" value="&quot;$$createProductOne.name$$&quot;"/>
<argument name="priceFrom" value="$$createProductOne.price$$0"/>
<argument name="priceTo" value="$$createProductOne.price$$0"/>
<argument name="name" value="&quot;$createProductOne.name$&quot;"/>
<argument name="priceFrom" value="$createProductOne.price$0"/>
<argument name="priceTo" value="$createProductOne.price$0"/>
</actionGroup>
<actionGroup ref="StorefrontCheckAdvancedSearchResultActionGroup" stepKey="StorefrontCheckAdvancedSearchResultCustom"/>
<waitForElementVisible selector="{{StorefrontCatalogSearchAdvancedResultMainSection.itemFound}}" stepKey="waitForSearchResultInCustomView"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<see userInput="You saved the product." selector="{{CatalogProductsSection.messageSuccessSavedProduct}}" stepKey="seeSuccessMessage"/>

<!-- Run cron -->
<magentoCLI command="cron:run" stepKey="runCron"/>
<magentoCLI command="cron:run --group=index" stepKey="runCron"/>

<!-- Clear invalidated cache on System>Tools>Cache Management page -->
<amOnPage url="{{AdminCacheManagementPage.url}}" stepKey="onCachePage"/>
Expand Down Expand Up @@ -188,7 +188,7 @@
<see userInput="You saved the product." selector="{{CatalogProductsSection.messageSuccessSavedProduct}}" stepKey="seeSaveMessage"/>

<!-- Run cron -->
<magentoCLI command="cron:run" stepKey="runCron2"/>
<magentoCLI command="cron:run --group=index" stepKey="runCron2"/>

<!-- Open frontend -->
<actionGroup ref="StorefrontOpenHomePageActionGroup" stepKey="onFrontendPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,17 @@
<actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr">
<argument name="storeView" value="customStoreFR"/>
</actionGroup>
<!--Run full reindex and clear caches -->
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
<magentoCLI command="cache:flush" stepKey="flushCache"/>
<!--Enable Flat Catalog Category -->
<magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/>
<!--Open Index Management Page and Select Index mode "Update by Schedule" -->
<magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="schedule" />
<!-- Run cron twice -->
<magentoCLI command="cron:run" stepKey="runCron1"/>
<magentoCLI command="cron:run" stepKey="runCron2"/>
<!-- Reindex invalidated indices and clear caches -->
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>
</before>
<after>
<magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/>
<magentoCLI stepKey="setIndexersMode" command="indexer:set-mode" arguments="realtime" />
<magentoCLI stepKey="indexerReindex" command="indexer:reindex" />
<deleteData stepKey="deleteCategory" createDataKey="createCategory"/>
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn">
<argument name="customStore" value="customStoreEN"/>
Expand All @@ -52,6 +48,9 @@
<argument name="customStore" value="customStoreFR"/>
</actionGroup>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
<magentoCLI command="config:set catalog/frontend/flat_catalog_category 0 " stepKey="setFlatCatalogCategory"/>
<magentoCLI command="indexer:set-mode" arguments="realtime" stepKey="setIndexersMode"/>
<magentoCron groups="index" stepKey="reindexInvalidatedIndicesAgain"/>
</after>
<!--Verify Category is not listed in navigation menu-->
<amOnPage url="/{{CatNotIncludeInMenu.name_lwr}}.html" stepKey="openCategoryPage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@
<actionGroup ref="CreateStoreViewActionGroup" stepKey="createCustomStoreViewFr">
<argument name="storeView" value="customStoreFR"/>
</actionGroup>
<!--Run full reindex and clear caches -->
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
<magentoCLI command="cache:flush" stepKey="flushCache"/>
<!--Enable Flat Catalog Category -->
<magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 1"/>
<!--Open Index Management Page and Select Index mode "Update by Schedule" -->
<magentoCLI stepKey="setIndexerMode" command="indexer:set-mode" arguments="schedule" />
<!-- Run cron twice -->
<magentoCLI command="cron:run" stepKey="runCron1"/>
<magentoCLI command="cron:run" stepKey="runCron2"/>
<!--Run full reindex and clear caches -->
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
<argument name="indices" value=""/>
</actionGroup>
<actionGroup ref="CliCacheFlushActionGroup" stepKey="flushCache">
<argument name="tags" value=""/>
</actionGroup>
</before>
<after>
<magentoCLI stepKey="setFlatCatalogCategory" command="config:set catalog/frontend/flat_catalog_category 0 "/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@
<requiredEntity createDataKey="secondSimpleProductForFixedWithAttribute"/>
</createData>

<magentoCron stepKey="runCron"/>
<!-- Start message queue for export consumer -->
<actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue">
<argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/>
<argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/>
</actionGroup>
<reloadPage stepKey="refreshPage"/>
<waitForPageLoad stepKey="waitForPageLoaded"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
Expand All @@ -96,7 +102,7 @@
<deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/>

<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
<magentoCLI command="cron:run --group=index" stepKey="reindexInvalidatedIndices"/>
</after>

<!-- Go to export page -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
<requiredEntity createDataKey="createSecondSimpleProduct"/>
</updateData>

<magentoCron stepKey="runCron"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
Expand All @@ -68,7 +67,13 @@
<!-- Export created below products -->
<actionGroup ref="ExportAllProductsActionGroup" stepKey="exportCreatedProducts"/>

<magentoCron stepKey="runCronIndex" groups="index"/>
<!-- Start message queue for export consumer -->
<actionGroup ref="CliConsumerStartActionGroup" stepKey="startMessageQueue">
<argument name="consumerName" value="{{AdminExportMessageConsumerData.consumerName}}"/>
<argument name="maxMessages" value="{{AdminExportMessageConsumerData.messageLimit}}"/>
</actionGroup>
<reloadPage stepKey="refreshPage"/>
<waitForPageLoad stepKey="waitForPageLoaded"/>

<grabTextFrom selector="{{AdminExportAttributeSection.exportFileNameByPosition('0')}}" stepKey="grabNameFile"/>

Expand Down
Loading

0 comments on commit 6b3b90b

Please sign in to comment.