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

#27500 Prepare Catalog module Tests for PHPUnit 8 #27823

Merged
merged 16 commits into from
Apr 24, 2020

Conversation

lbajsarowicz
Copy link
Contributor

@lbajsarowicz lbajsarowicz commented Apr 12, 2020

Description (*)

Preparing PHPUnit Tests to run with PHPUnit 8.
PRs for each module is separated to make tests easier to merge.

Related Pull Requests

https://github.com/magento/partners-magento2ee/pull/233

Fixed Issues (if relevant)

  1. Unit Tests incompatible with PHPUnit 8 #27500

Manual testing scenarios (*)

N/A

Questions or comments

PR #27701 needs to be merged first (otherwise PHPUnit tests fail)

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 Apr 12, 2020

Hi @lbajsarowicz. 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.4-develop instance - deploy vanilla Magento instance

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

@dmytro-ch dmytro-ch self-assigned this Apr 15, 2020
@slavvka
Copy link
Member

slavvka commented Apr 16, 2020

Unit tests failure is caused by:

18:16:55 PHP Fatal error:  Declaration of Magento\CatalogInventory\Test\Unit\Ui\DataProvider\Product\Form\Modifier\AdvancedInventoryTest::setUp() must be compatible with Magento\Catalog\Test\Unit\Ui\DataProvider\Product\Form\Modifier\AbstractModifierTest::setUp(): void in /var/www/html/app/code/Magento/CatalogInventory/Test/Unit/Ui/DataProvider/Product/Form/Modifier/AdvancedInventoryTest.php on line 163

@ihor-sviziev ihor-sviziev self-assigned this Apr 16, 2020
@ihor-sviziev ihor-sviziev changed the base branch from 2.4-develop to phpunit8 April 16, 2020 09:04
@ihor-sviziev ihor-sviziev changed the base branch from phpunit8 to 2.4-develop April 16, 2020 09:04
Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍Thank you for contribution!

@@ -58,7 +56,7 @@ protected function setUp(): void
/**
* @return MockObject
*/
protected function getVisibleImagesSelectMock(): MockObject
protected function getVisibleImagesSelectMock(): \PHPUnit\Framework\MockObject\MockObject
Copy link
Contributor

@ihor-sviziev ihor-sviziev Apr 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to import this class, but that's too small thing compared to whole PR, so we can leave it

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-7446 has been created to process this Pull Request

@ihor-sviziev ihor-sviziev changed the base branch from 2.4-develop to phpunit8 April 16, 2020 12:21
@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Apr 16, 2020

@slavvka
I merged some conflicting changes with 2.4-develop branch, that are missing in phpunit8 branch, please merge them and changes not related to phpunit will just disappear from the list of changes in this PR.
Also that fatal error seems to me related to PR with CatalogInventory, that was already merged to phpunit8 branch, so it shouldn't cause this issue anymore.

@ihor-sviziev
Copy link
Contributor

@magento run all tests

@slavvka
Copy link
Member

slavvka commented Apr 23, 2020

And

12:32:00 PHP Fatal error:  Declaration of Magento\Banner\Test\Unit\Block\Adminhtml\Widget\Instance\Edit\Chooser\ContainerTest::setUp() must be compatible with Magento\Widget\Test\Unit\Block\Adminhtml\Widget\Instance\Edit\Chooser\AbstractContainerTest::setUp(): void in /var/www/html/app/code/Magento/Banner/Test/Unit/Block/Adminhtml/Widget/Instance/Edit/Chooser/ContainerTest.php on line 15

@slavvka
Copy link
Member

slavvka commented Apr 23, 2020

@magento run all tests

@slavvka
Copy link
Member

slavvka commented Apr 23, 2020

Looks like GiftWrapping module was never processed:

17:32:35 PHP Fatal error:  Declaration of Magento\GiftWrapping\Test\Unit\Ui\DataProvider\Product\Form\Modifier\GiftWrappingTest::setUp() must be compatible with Magento\Catalog\Test\Unit\Ui\DataProvider\Product\Form\Modifier\AbstractModifierTest::setUp(): void in /var/www/html/app/code/Magento/GiftWrapping/Test/Unit/Ui/DataProvider/Product/Form/Modifier/GiftWrappingTest.php on line 106

@slavvka
Copy link
Member

slavvka commented Apr 23, 2020

And I don't knwo why MediGallery tests are failing here

@slavvka
Copy link
Member

slavvka commented Apr 23, 2020

@magento run all tests

1 similar comment
@slavvka
Copy link
Member

slavvka commented Apr 23, 2020

@magento run all tests

@slavvka
Copy link
Member

slavvka commented Apr 24, 2020

@lbajsarowicz No more Unit test fatals, only MediaGallery. And normal Static test failures

@lbajsarowicz
Copy link
Contributor Author

@magento run all tests

@slavvka
Copy link
Member

slavvka commented Apr 24, 2020

Failed unit tests aren't related to the changes

@m2-assistant
Copy link

m2-assistant bot commented Apr 24, 2020

Hi @lbajsarowicz, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants