-
Notifications
You must be signed in to change notification settings - Fork 9.4k
#18668: Fixed store reinitialization for integration tests on projects with plugins on \Magento\TestFramework\App\Config #34372
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?
Conversation
…on \Magento\TestFramework\App\Config
Hi @bgorski. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
…\TestFramework\Store\StoreManager
…\Config should be requested in the constructor of \Magento\TestFramework\Store\StoreManager
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
I need to deal with this issue reported by static tests:
Then I guess I can remove the WIP mark. |
quick update on this - the error is there due to the magento coding standard having a bug that prevents it from working with classes with typed properties. I reported the bug here: magento/magento-coding-standard#315. |
@magento run Static Tests, Functional Tests B2B, Functional Tests CE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Static Tests, Functional Tests CE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Static Tests, Functional Tests CE |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Static Tests, Functional Tests EE, Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Static Tests, Functional Tests B2B |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Static Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento give me 2.4.1 instance |
Hi @bgorski. Thank you for your request. I'm working on Magento instance for you. |
Hi @bgorski, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later. |
@magento give me 2.4.6-p2 instance |
Hi @bgorski. Thank you for your request. I'm working on Magento instance for you. |
Hi @bgorski, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later. |
@magento run all tests |
Description (*)
This PR fixes store reinitialization for integration tests done on projects with plugins on
\Magento\Framework\App\Config\ScopeConfigInterface
which effectively makes the system use that plugin on all preferences for that interface.When you have such a plugin, it forces the system to generate an Interceptor class for the
\Magento\TestFramework\App\Config
class (the implementation ofScopeConfigInterface
in the integration tests framework). When a reflection is created for that Interceptor class, it doesn't have the 'data' property which its parents has, which results in a\ReflectionException
being thrown on$reflection->getProperty('data')
. In this case, the property has to be fetched from the parent class (the actual Config class).Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Create a module with two things:
di.xml:
reinitStores()
function. Actual asserts inside the test don't matter, so you can just create an assert that true is true:$this->assertTrue(true)
Then run your test. The expected result is that it doesn't fail with "Error in fixture: [path here]. Property data does not exist
Questions or comments
IMPORTANT: Although the issue this PR fixes concerns only projects with customization, not a clean Magento instance, this is exactly the purpose of integration tests framework - to let people test their custom modules (with the only two use cases when it's not testing custom code being the core team and contributors using it to test new code introduced to the core). Because of this I believe it's justified to process this PR with a high priority (higher than P3). Once you hit the issue, there's no workaround for it and you have to patch the integration tests framework to be able to keep using it on your project.
Contribution checklist (*)