-
Notifications
You must be signed in to change notification settings - Fork 50
Fix integration tests for Magento_Backend and Magento_Bundle #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.4-develop
Are you sure you want to change the base?
Fix integration tests for Magento_Backend and Magento_Bundle #134
Conversation
dev/tests/integration/testsuite/Magento/Bundle/_files/issaleable_product.php
Show resolved
Hide resolved
dev/tests/integration/testsuite/Magento/Bundle/_files/issaleable_product.php
Outdated
Show resolved
Hide resolved
dev/tests/integration/testsuite/Magento/Bundle/_files/issaleable_product.php
Outdated
Show resolved
Hide resolved
Hi! Just wondering, should we have this be a draft PR for now, while you work on more fixes? Or do you want to split your work into multiple PRs, and have us process this one now as-is? It might be good to do multiple PRs, so that each individual PR is smaller for review. That way we could get things merged faster and more often for you, too. |
Hi @rhoerr , yes of course you're right. Plus i should rewrite the description of the PR since it now contains a few more things. |
We can keep the same Taiga task for tracking. 🙂 You can add subtasks to it if you would like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed work to date, some mostly small feedback
* @var ChangeParentStockStatus | ||
*/ | ||
private $changeParentStockStatus; | ||
|
||
/** | ||
* @param Configurable $configurableType | ||
* @param StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory | ||
* @param StockItemRepositoryInterface $stockItemRepository | ||
* @param StockConfigurationInterface $stockConfiguration | ||
* @param ChangeParentStockStatus|null $changeParentStockStatus | ||
* @SuppressWarnings(PHPMD.UnusedFormalParameter) Deprecated dependencies | ||
* @param ChangeParentStockStatus $changeParentStockStatus | ||
*/ | ||
public function __construct( | ||
Configurable $configurableType, | ||
StockItemCriteriaInterfaceFactory $criteriaInterfaceFactory, | ||
StockItemRepositoryInterface $stockItemRepository, | ||
StockConfigurationInterface $stockConfiguration, | ||
?ChangeParentStockStatus $changeParentStockStatus = null | ||
private readonly ChangeParentStockStatus $changeParentStockStatus | ||
) { | ||
$this->changeParentStockStatus = $changeParentStockStatus | ||
?? ObjectManager::getInstance()->get(ChangeParentStockStatus::class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this part should be reverted for upstream/backwards compatibility. It looks functionally equivalent. Upstream will update the parameters eventually.
$this->assertSame('test street test city Armed Forces Middle East 01001', $item->getBillingFull()); | ||
$this->assertSame('test street' . PHP_EOL . ' test city Armed Forces Middle East 01001', $item->getBillingFull()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this case (and possibly others here) should be fixed to the test, rather than matching the test to the result. I'm pretty sure this was broken by a previous Mage-OS PR, #117 . It shouldn't output a newline for empty address lines. Probably need to add a trim or array filter somewhere in there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @rhoerr , ok noted. Actually in France this newline would be quite normal.
But i'll have a look at it another time and check with the PR you linked. Thanks
->setShippingAddress($shippingAddress) | ||
->addProduct( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->setShippingAddress($shippingAddress) | |
->addProduct( | |
->setShippingAddress($shippingAddress) | |
->addProduct( |
@@ -25,7 +25,7 @@ class ProductMetadata implements ProductMetadataInterface, DistributionMetadataI | |||
/** | |||
* Magento product name | |||
*/ | |||
public const PRODUCT_NAME = 'Magento'; | |||
public const PRODUCT_NAME = 'Mage-OS'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is intentionally left as Magento
for compatibility reasons. Product Name = Magento; Distribution Name = Mage-OS. This way any code that checks if it's Magento(-compatible) gets a yes.
If any tests fail as a result of this being Magento rather than Mage-OS, we'll need to fix those instead.
@rhoerr , i just made the changes required. Can you please check ? Thank you |
Description (*)
I have fixed all integration tests on Magento_Backend and Magento_Bundle. For the first one it was about rewriting the test to adapt it to the class's new dependencies.
For the second one it was about fixing Magento.
I added fixes for the Magento_CatalogInventory module. It was about fixing the integration with the new ParentItemProcessInterface
Fixed Issues (if relevant)
I cannot access github issues on the mage-os repo. So here is the taiga ticket :
Fix all broken integration tests
But the PR for now does not fix all integration tests. it will be a long way to go.
Manual testing scenarios (*)
First make sure you're in the dev/tests/integration folder. then :
You should have 0 broken test
Contribution checklist (*)