magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.55k stars 9.32k forks source link

Magento\TestFramework\Annotation\ConfigFixture Error #39182

Closed SergeLavrentyev closed 2 weeks ago

SergeLavrentyev commented 1 month ago

Preconditions and environment

Steps to reproduce

  1. create core_config _data with value = 0.
  2. add magentoConfigFixture to integration test @magentoConfigFixture example/path/test 1

Expected result

test passes

Actual result

Magento\TestFramework\App\ApiMutableScopeConfig::persistConfig(): Argument #2 ($value) must be of type string, null given, called in /repo/magento/dev/tests/api-functional/framework/Magento/TestFramework/App/ApiMutableScopeConfig.php on line 79

Additional information

After getting value from db, '0' converts to NULL here magento/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiConfigFixture.php:158

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 month ago

Hi @SergeLavrentyev. 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. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 1 month ago

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: :point_down:

engcom-Hotel commented 1 month ago

Hello @SergeLavrentyev,

Thanks for the report and collaboration!

We have tried to reproduce the issue in the latest development branch i.e. 2.4-develop, but for us, the issue is not reproducible.

As per the main description, first, we tried to create a custom integration test with @magentoConfigFixture example/path/test 1, but the issue is not reproducible for us. Please refer to the below screenshot for reference:

image

But then we checked the error you mentioned in the main description, and according to the error, it seems you are facing an issue is in api- functional test. So then we tried to reproduce it api-functional test following the below steps:

  1. Edit file https://github.com/magento/magento2/blob/a4cf5e62468770fdb9f7b48938f6644ae354a51b/dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetManagementTest.php#L35
  2. Add @magentoConfigFixture example/path/test 1 for testCreate method
  3. Ran the test via the below command: ../../../vendor/bin/phpunit -c ../../../dev/tests/api-functional/phpunit_rest.xml --filter 'testCreate' ../../../dev/tests/api-functional/testsuite/Magento/Catalog/Api/AttributeSetManagementTest.php

The test was completed successfully. Please refer to the below screenshot: image

Please let us know if we have missed anything.

Thanks

engcom-Hotel commented 2 weeks ago

Dear @SergeLavrentyev,

We've observed that there haven't been any updates on this issue for quite some time. Therefore, we're assuming it's been resolved and will be closing it. Feel free to open a new ticket or reopen this one if you require further assistance.

Regards