Skip to content
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

[TestFramework] Usages of TestCase::getTestResultObject are invalid since phpunit v10 #39463

Open
1 of 5 tasks
stollr opened this issue Dec 10, 2024 · 6 comments
Open
1 of 5 tasks
Labels
Area: Test framework Component: Framework/TestFramework Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: ready for dev Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@stollr
Copy link
Contributor

stollr commented Dec 10, 2024

Preconditions and environment

  • 2.4-develop branch

Steps to reproduce

Please look at #39427 (comment). The same code can be used to trigger a call to \PHPUnit\Framework\TestCase::getTestResultObject() (see here) which is invalid since phpunit v10.0.

@engcom-Hotel already reproduced this issue in the above mentioned issue (see this comment).

Expected result

I am expecting the output of the real reason of the issue, which is the usage of the non-existing scope key invalid_scope_key. The error message should look like this:

1) Exception in third-party event subscriber: Unable to apply fixture: Magento\Store\Test\Fixture\Store (store)
#0 /srv/htdocs/stollr/magento2/dev/tests/integration/testsuite/Magento/Ui/Component/Listing/Column/Store/OptionsTest.php(55): Magento\Ui\Component\Listing\Column\Store\OptionsTest->testStoreLabeleWithSingleQuote()

Caused By: Scope "ffoooooooo" does not exist.
# ...backtrace...

Actual result

But as this catch block calls an non-existing method, this error is triggered:

There was 1 PHPUnit test runner warning:

1) Exception in third-party event subscriber: Call to undefined method Magento\Ui\Component\Listing\Column\Store\OptionsTest::getTestResultObject()
#\0 /srv/htdocs/stollr/magento2/dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php(81): Magento\TestFramework\Event\Transaction->_startTransaction()
#\1 /srv/htdocs/stollr/magento2/dev/tests/integration/framework/Magento/TestFramework/Event/Transaction.php(46): Magento\TestFramework\Event\Transaction->_processTransactionRequests()
#\2 [internal function]: Magento\TestFramework\Event\Transaction->startTest()
#\3 /srv/htdocs/stollr/magento2/dev/tests/integration/framework/Magento/TestFramework/EventManager.php(49): call_user_func_array()
#\4 /srv/htdocs/stollr/magento2/dev/tests/integration/framework/Magento/TestFramework/Event/PhpUnit.php(127): Magento\TestFramework\EventManager->fireEvent()
#\5 /srv/htdocs/stollr/magento2/dev/tests/integration/framework/Magento/TestFramework/Event/TestPreprationStartedSubscriber.php(34): Magento\TestFramework\Event\PhpUnit->startTest()
#\6 /srv/htdocs/stollr/magento2/vendor/phpunit/phpunit/src/Event/Dispatcher/DirectDispatcher.php(105): Magento\TestFramework\Event\TestPreprationStartedSubscriber->notify()
#\7 /srv/htdocs/stollr/magento2/vendor/phpunit/phpunit/src/Event/Dispatcher/DeferringDispatcher.php(47): PHPUnit\Event\DirectDispatcher->dispatch()
#\8 /srv/htdocs/stollr/magento2/vendor/phpunit/phpunit/src/Event/Emitter/DispatchingEmitter.php(313): PHPUnit\Event\DeferringDispatcher->dispatch()
#\9 /srv/htdocs/stollr/magento2/vendor/phpunit/phpunit/src/Framework/TestCase.php(651): PHPUnit\Event\DispatchingEmitter->testPreparationStarted()
#\10 /srv/htdocs/stollr/magento2/vendor/phpunit/phpunit/src/Framework/TestRunner.php(106): PHPUnit\Framework\TestCase->runBare()
#\11 /srv/htdocs/stollr/magento2/vendor/phpunit/phpunit/src/Framework/TestCase.php(517): PHPUnit\Framework\TestRunner->run()
#\12 /srv/htdocs/stollr/magento2/vendor/phpunit/phpunit/src/Framework/TestSuite.php(374): PHPUnit\Framework\TestCase->run()
#\13 /srv/htdocs/stollr/magento2/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(64): PHPUnit\Framework\TestSuite->run()
#\14 /srv/htdocs/stollr/magento2/vendor/phpunit/phpunit/src/TextUI/Application.php(203): PHPUnit\TextUI\TestRunner->run()
#\15 /srv/htdocs/stollr/magento2/vendor/phpunit/phpunit/phpunit(104): PHPUnit\TextUI\Application->run()
#\16 /srv/htdocs/stollr/magento2/vendor/bin/phpunit(122): include('...')
#\17 {main}

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Copy link

m2-assistant bot commented Dec 10, 2024

Hi @stollr. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 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, join the Community Contributions Triage session to discuss the appropriate ticket.

@stollr
Copy link
Contributor Author

stollr commented Dec 10, 2024

This is a blocker for #36804

@engcom-Bravo engcom-Bravo added Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it Reported on 2.4.x Indicates original Magento version for the Issue report. labels Dec 11, 2024
@engcom-Hotel engcom-Hotel self-assigned this Dec 11, 2024
Copy link

m2-assistant bot commented Dec 11, 2024

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Hotel
Copy link
Contributor

Hello @stollr,

Thanks for the report and collaboration!

Yes, you are correct, that I can reproduce the issue. Please refer to this #39427 (comment) for more information.

Hence confirming the issue.

Thanks

@engcom-Hotel engcom-Hotel added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Component: Framework/TestFramework Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Area: Test framework and removed Issue: ready for confirmation labels Dec 11, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-13502 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented Dec 11, 2024

✅ Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Test framework Component: Framework/TestFramework Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: ready for dev Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
None yet
Development

No branches or pull requests

4 participants