Skip to content

Filtering ignored config values in test framework causes error #22370

@bcerban

Description

@bcerban

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 44f174b). 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());

Metadata

Metadata

Assignees

Labels

Component: TestFixed in 2.2.xThe issue has been fixed in 2.2 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releasehelp wanted

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions