Skip to content

Fix quote fixture. #23762

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

Merged
merged 1 commit into from
Aug 16, 2019
Merged

Conversation

swnsma
Copy link
Contributor

@swnsma swnsma commented Jul 18, 2019

Description (*)

Create new instance of the quote repository can lead to unexpected behavior of functional tests.
See test scenario for more details

Manual testing scenarios (*)

Steps to reproduce.

  1. Create plugin with 'afterAfterSave' for Quote Address Model.
  2. Try to load Quote from Quote Repository in the Plugin.
  3. Run integration tests where fixture 'Magento/Sales/_files/quote.php' is used (e.g. \Magento\Quote\Model\ShippingMethodManagementTest::testTableRateFreeShipping)

Expected result

  1. Test is successful. We have not changed anything in Quote.

Actual result

  1. Test failed. Quote is invalid.

Description

The problem is related that if we during the Quote save load Quote with Quote Repository in 'afterAfterSave' plugin of Quote address, the Quote will be cached in Quote Repository. In this moment Quote is not fully saved and may be in invalid state.
Expected that Quote will be flushed from Quote Repository after save, but if we use different instances of Quote Repository it will lead to unexpected behavior.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jul 18, 2019

Hi @swnsma. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-engcom-team magento-engcom-team added Release Line: 2.3 Partner: ISM eCompany Pull Request is created by partner ISM eCompany partners-contribution Pull Request is created by Magento Partner labels Jul 18, 2019
@XxXgeoXxX XxXgeoXxX self-requested a review July 18, 2019 09:26
@XxXgeoXxX
Copy link
Member

XxXgeoXxX commented Jul 18, 2019

Hi
@swnsma
PR was approved after the discussion

@magento-engcom-team
Copy link
Contributor

Hi @XxXgeoXxX, thank you for the review.
ENGCOM-5463 has been created to process this Pull Request
✳️ @XxXgeoXxX, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

magento-engcom-team pushed a commit that referenced this pull request Aug 16, 2019
@magento-engcom-team magento-engcom-team merged commit f1a6264 into magento:2.3-develop Aug 16, 2019
@m2-assistant
Copy link

m2-assistant bot commented Aug 16, 2019

Hi @swnsma, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.4 milestone Aug 16, 2019
@VladimirZaets VladimirZaets added the Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests label Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Partner: ISM eCompany Pull Request is created by partner ISM eCompany partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants