Magento2: Filtering ignored config values in test framework causes error

Created on 16 Apr 2019  路  8Comments  路  Source: magento/magento2

Summary (*)

When running integration and functional tests, were are encountering an error due to the following configuration check.

In dev/tests/integration/framework/Magento/TestFramework/Isolation/DeploymentConfig.php, configuration values are filtered to exclude some configs (introduced in 44f174b8d24c5b130515e2da1745d4f5ce20cd53). This check compares filtered config to the original store config, and causes a failure if there are differences:

ERROR: deployment configuration is corrupted. The application state is no longer valid.
Further tests may fail. This test failure may be misleading, if you are re-running it on a corrupted application.

Currently only compiled_config is excluded. This filter is run only on endTest, and not on startTestSuite, when the original store configuration is loaded. Therefore, if compiled_config is present in the original store configuration, the whole test suite fails to run.

Examples (*)

Run the integration test suite with the following app/etc/env.php configuration:

<?php
return [
    'backend' => [
        'frontName' => 'admin'
    ],
    'db' => [
        'connection' => [
            'indexer' => [
                'host' => 'localhost',
                'dbname' => 'm228',
                'username' => 'root',
                'password' => 'root',
                'model' => 'mysql4',
                'engine' => 'innodb',
                'initStatements' => 'SET NAMES utf8;',
                'active' => '1',
                'persistent' => NULL
            ],
            'default' => [
                'host' => 'localhost',
                'dbname' => 'm228',
                'username' => 'root',
                'password' => 'root',
                'model' => 'mysql4',
                'engine' => 'innodb',
                'initStatements' => 'SET NAMES utf8;',
                'active' => '1'
            ]
        ],
        'table_prefix' => ''
    ],
    'crypt' => [
        'key' => '0b72247938120757f3ba1f491ef102e2'
    ],
    'resource' => [
        'default_setup' => [
            'connection' => 'default'
        ]
    ],
    'x-frame-options' => 'SAMEORIGIN',
    'MAGE_MODE' => 'default',
    'session' => [
        'save' => 'files'
    ],
    'cache_types' => [
        'config' => 1,
        'layout' => 1,
        'block_html' => 1,
        'collections' => 1,
        'reflection' => 1,
        'db_ddl' => 1,
        'eav' => 1,
        'customer_notification' => 1,
        'config_integration' => 1,
        'config_integration_api' => 1,
        'target_rule' => 1,
        'full_page' => 1,
        'config_webservice' => 1,
        'translate' => 1,
        'vertex' => 1,
        'compiled_config' => 1
    ],
    'install' => [
        'date' => 'Mon, 15 Apr 2019 20:24:44 +0000'
    ]
];

Proposed solution


Filter config values when loading configuration by changing line 54 in dev/tests/integration/framework/Magento/TestFramework/Isolation/DeploymentConfig.php from

$this->config = $this->reader->load();

to

$this->config = $this->filterIgnoredConfigValues($this->reader->load());
Test Fixed in 2.2.x Clear Description Confirmed Format is valid Reproduced on 2.2.x help wanted

Most helpful comment

Hi @bcerban. Thank you for your report.
The issue has been fixed in magento/magento2#22415 by @bcerban in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.9 release.

All 8 comments

Hi @bcerban. 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-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

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

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

  • [x] yes
  • [ ] no

Hi @engcom-backlog-nazar. 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.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.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. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 6. Add label Issue: Confirmed once verification is complete.

  • [ ] 7. Make sure that automatic system confirms that report has been added to the backlog.

:white_check_mark: Confirmed by @engcom-backlog-nazar
Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-99235 were created

Issue Available: @engcom-backlog-nazar, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

Hi @bcerban. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@engcom-backlog-nazar @bcerban this issue can be reproduced on 2.2.x only, is that correct?

@engcom-backlog-nazar @bcerban this issue can be reproduced on 2.2.x only, is that correct?

Yes @sivaschenko, only 2.2 (we detected this running our test suite on 2.2.8).

@sivaschenko yes labels reproduce on 2.3 added by mistake

Hi @bcerban. Thank you for your report.
The issue has been fixed in magento/magento2#22415 by @bcerban in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.9 release.

Was this page helpful?
0 / 5 - 0 ratings