Magento2: Fatal error on integration tests execution

Created on 12 Feb 2020  路  13Comments  路  Source: magento/magento2

Preconditions (*)

  • Magento 2.3.3 | 2.3.4
  • PHP 7.3>=
  • PHPUnit 8.5.2

Steps to reproduce (*)

Execute vendor/bin/phpunit /app/dev/tests/integration/phpunit.xml.dist

Expected result (*)

Integration tests runs like expected

Actual result (*)

Fatal error: Declaration of Magento\TestFramework\Event\PhpUnit::addError(PHPUnit\Framework\Test $test, Exception $e, $time) must be compatible with PHPUnit\Framework\TestListener::addError(PHPUnit\Framework\Test $test, Throwable $t, float $time): void in /app/dev/tests/integration/framework/Magento/TestFramework/Event/PhpUnit.php on line 12
Fixed in 2.4.x Format is valid done Reported on 2.3.3 feature request

All 13 comments

Hi @ridesoft. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

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:

@magento give me 2.4-develop instance - upcoming 2.4.x release

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

@ridesoft do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

Hi @engcom-Alfa. 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: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - 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.

Hi, @ridesoft. Thank you for your report!

As we see from your description, you are using PHPUnit version 8.5.2.
In Magento 2.3 technology stack requirements states that Magento(v. 2.3) recommends using PHPUnit version 6.2.
There should be no such error in this version.
So, we have to close it.

Please feel free to comment, reopen or create new ticket according to the Issue reporting guidelines
if you are still facing this issue on the latest 2.4-develop branch.
Thank you for collaboration.

Ok... so basically is not possible to run integration tests with php73+ because phpunit 6.2.0 supports only php72.

HI @ridesoft how you run in vendor/bin/phpunit PHPUnit 8.5.2 ? as far i remember there always 6.5.14 version.

I think it would be better to open issue on devdoc and update PHPUnit requirements https://devdocs.magento.com/guides/v2.3/test/unit/unit_test_execution_cli.html

@ridesoft here an example of running unit tests on php7.3

DeepinScreenshot_select-area_20200225153906

I'm speaking about integration tests...

Hello @ridesoft
Thank you for contribution and collaboration!

Sorry for the inconvenience.
You were right that PHPUnit 6.x does not support PHP v 7.3. To run tests on PHP 7.3, you must have at least PHPUnit 7.x version. For now, Magento is using PHPUnit. 6.5.14. But in the future, Magento needs an updated PHPUnit.

Thank you!

Marked as Feature Request

cc @sdzhepa

@engcom-Alfa we already migrated to phpunit 9, so issue should be fixed. Could you confirm that?

Hi @ihor-sviziev. 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: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - 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.

Hi, @ihor-sviziev @mbrioski .
We are not able to reproduce this issue on a fresh 2.4-develop after migrated to PHPUnit 9.

Preconditions:
Php 7.3
PHPUnit 9.1.5

Run in console: vendor/bin/phpunit -c /var/www/html/magento24/dev/tests/integration/phpunit.xml.dist

Actual Result: :heavy_check_mark: Integration tests runs like expected

Screenshot from 2020-05-29 14-27-51

Cool. thx for confirming. I'm closing this issue.

Was this page helpful?
0 / 5 - 0 ratings