Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

GraphQl-167: Add support for '@magentoConfigFixture' annotation on API-functional tests #351

Merged
merged 6 commits into from
Jul 30, 2019

Conversation

VitaliyBoyko
Copy link
Contributor

Description

Added support for '@magentoConfigFixture' annotation on GraphQL API-functional tests

Fixed Issues (if relevant)

  1. Add support for '@magentoConfigFixture' annotation on API-functional tests #167: Add support for '@magentoConfigFixture' annotation on GraphQL API-functional tests

@naydav
Copy link
Contributor

naydav commented Feb 6, 2019

@VitaliyBoyko
Please, check next tests

Magento\Test\Php\LiveCodeTest::testCodeStyle
PHP Code Sniffer detected 2 violation(s): 

FILE: ...nal/framework/Magento/TestFramework/Bootstrap/WebapiDocBlock.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 10 | ERROR | [x] Class is missing annotation block
 14 | ERROR | [x] Short description should not be in multi lines
----------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

WebAPI

Magento.Quote.Api.GuestShipmentEstimationTest.testEstimateByExtendedAddress
Magento.Quote.Api.GuestShipmentEstimationTest.testEstimateByExtendedAddress
Magento.Quote.Api.ShippingMethodManagementTest.testGetListForMyCart

Thanks

@VitaliyBoyko VitaliyBoyko changed the title 167 magento config fixture [WIP]167 magento config fixture Feb 7, 2019
@VitaliyBoyko VitaliyBoyko self-assigned this Feb 7, 2019
@naydav
Copy link
Contributor

naydav commented Feb 13, 2019

@VitaliyBoyko
Have got Jenkins tests failure:

Magento\Quote\Api\GuestShipmentEstimationTest::testEstimateByExtendedAddress
Failed asserting that 2 matches expected 1.

/var/www/html/dev/tests/api-functional/testsuite/Magento/Quote/Api/GuestShipmentEstimationTest.php:103
Magento\Quote\Api\ShippingMethodManagementTest::testGetListForMyCart
Failed asserting that actual size 2 matches expected size 1.

@VitaliyBoyko
Copy link
Contributor Author

VitaliyBoyko commented Feb 16, 2019

Hey @naydav
Can't reproduce this locally.
Is it possible to dump 'core_config_data' table, or get values from this table when the test on Jenkins being executed? I mean that certain moment when the test has started and all fixtures have been loaded.

@naydav
Copy link
Contributor

naydav commented Feb 21, 2019

@VitaliyBoyko
Please, looks at fatal error from logs. It should be helpfull
thanks

PHP Fatal error:  Uncaught Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@magentoApiConfigFixture" in method Magento\GraphQl\CatalogInventory\ProductOnlyXLeftInStockTest::testQueryProductOnlyXLeftInStockEnabled() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54
12:06:03 [WebAPI GRAPHQL-Tests-CE] Stack trace:
12:06:03 [WebAPI GRAPHQL-Tests-CE] #0 /var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(727): Doctrine\Common\Annotations\AnnotationException::semanticalError('The annotation ...')
12:06:03 [WebAPI GRAPHQL-Tests-CE] #1 /var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(663): Doctrine\Common\Annotations\DocParser->Annotation()
12:06:03 [WebAPI GRAPHQL-Tests-CE] #2 /var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(354): Doctrine\Common\Annotations\DocParser->Annotations()
12:06:03 [WebAPI GRAPHQL-Tests-CE] #3 /var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(286):  in /var/www/html/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php on line 54

@naydav
Copy link
Contributor

naydav commented Feb 22, 2019

@VitaliyBoyko
Need to reuse $subscribers[] = new \Magento\TestFramework\Annotation\ConfigFixture(); in \Magento\TestFramework\Bootstrap\WebapiDocBlock
The other changes should be reverted

@VitaliyBoyko VitaliyBoyko changed the title [WIP]167 magento config fixture 167 magento config fixture Mar 14, 2019
@naydav naydav modified the milestone: Release: 2.3.3 May 2, 2019
@naydav naydav changed the title 167 magento config fixture GraphQl-167: Add support for '@magentoConfigFixture' annotation on API-functional tests May 2, 2019
@naydav naydav force-pushed the 167-magento-config-fixture branch from c9b34b4 to 001c4ea Compare June 14, 2019 21:37
@naydav naydav force-pushed the 167-magento-config-fixture branch from 001c4ea to 4778bbb Compare June 14, 2019 21:48
@naydav
Copy link
Contributor

naydav commented Jun 21, 2019

@VitaliyBoyko I merged mainline and re-run build
Looks like we don't have problem with API-functional tests

But in the scope of this ticket need to remove all mentions and TODOs related to this issue
Would you like to do this in current PR?
Thanks

@lenaorobei
Copy link
Contributor

@VitaliyBoyko thank you. I tested config values and they are removed after the test execution.
Could you please address static build issues and we will be able to proceed with this PR.

@magento-engcom-team
Copy link
Contributor

Hi @lenaorobei, thank you for the review.
ENGCOM-4151 has been created to process this Pull Request
✳️ @lenaorobei, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@ghost
Copy link

ghost commented Jul 30, 2019

Hi @VitaliyBoyko, 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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants