-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Impossible to run graphql functional tests #32252
Comments
Hi @delyriand. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues 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 |
Can confirm in magento 2.4.2 |
✅ Confirmed by @bgorski Issue Available: @bgorski, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
@magento I'm working on this |
I'm unassigning myself from this after all as it requires a bit more effort to fix it the right way than I can currently commit to. The part of the functionality that's failing here - the custom test suite loader PHPUnit functionality is actually deprecated (sebastianbergmann/phpunit#4039) and marked with a From what I see in Magento it's used to provide wrappers for tests to make it possible to skip them, so a right approach here would be to provide the same functionality in a different way. I don't think a simple workaround fixing the directory issue is enough. Maybe @mykhailomatiola would have some ideas on how to deal with this as from what I see in the commits history he's the author of this feature that later on got deprecated on the PHPUnit side. Mykhailo, any hints? :) And if someone does require a simple workaround - the initial comment in the task is correct, that piece of code changing the directory makes API Functional tests fail to find the test suite loader file. Workaround 1:
to
and introduce the getExecutionDir() method:
Then modify the
Workaround 2:
use something like:
Of course replace with the actual path on your system, the one above is just an example. |
Hello there. |
The workaround suggested by @andrewbess also works for me. Another option is to run the tests with an absolute path to the configuration file:
|
I think this option works fine and we can document it in devdocs. Since I am using PHPStorm I did not even have this problem as it uses full URLs all the time |
Thank you @keharper for adding this to the docs! |
Thank you @sprankhub, @andrewbess, @bgorski @delyriand for exposing your workarounds If you experienced things that have a workaround that we need to document, please open a PR to the docs. |
Thanks for caring @cpartica! I agree that having a documented workaround is better than having nothing. However, we probably agree that this should still be fixed in the core as it is awful developer experience. Please mind that this also affects integration tests. |
Verified the issue on Magento 2.4-develop branch and the issue is still reproducible. |
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Once all required labels are present, please add |
❌ Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-831 |
@engcom-November, @sdzhepa, @sidolov: any idea why this got closed? There is no explanation telling us why it got closed? (please stop doing that...) |
Hello @hostep, We have gone through with its related JIRA and as per the comment there, the issue is not reproducible for them. As per their conclusion on this issue, they have commented below in the JIRA:
So due to a change in the status of its JIRA, the status of this issue is also been changed to We apologize for not making a proper communication here, we will definitely take care of the same in future. Thanks |
Summary (*)
When we follow the documentation to run GraphQL functional tests, we get an error: Could not use "Magento\TestFramework\ApiSuiteLoader" as loader
Examples (*)
vendor/bin/phpunit -c dev/tests/api-functional/phpunit_graphql.xml dev/tests/api-functional/testsuite/Magento/GraphQl/Customer/GenerateCustomerTokenTest.php
We get the error:
![image](https://user-images.githubusercontent.com/465524/108825997-0ef66280-75c4-11eb-9593-7df2d171eee2.png)
Proposed solution
For me, it fails with the error because the bootstrap instantiates a WebApiApplication, by inheritance, it executes the following code and we are in the wrong folder:
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
The text was updated successfully, but these errors were encountered: