Open
Description
Preconditions and environment
- 2.4.6 and 2.4.7
- Allure 2.30.0
Steps to reproduce
- Run the integration tests when a test contains a magentoDataFixture or other custom magento annotation.
- View the resulting json file of the test in dev/tests/integration/var/allure-results
Expected result
The name should be filled in the json file
Actual result
The name is empty in the json file
Additional information
This seems to have been an issue brought in with version 2.4.6 and the move from a listener to an extension for the allure config.
Old version: https://github.com/magento/magento2/blob/2.4.5/dev/tests/integration/phpunit.xml.dist#L95
To fix this we have added a new custom extension.
<extension class="Fix\IntegrationTests\Extension\IgnoreMagentoAnnotations">
<arguments>
<array>
<element key="codingStandardsIgnoreStart">
<string>codingStandardsIgnoreStart</string>
</element>
<element key="codingStandardsIgnoreEnd">
<string>codingStandardsIgnoreEnd</string>
</element>
<element key="expectedExceptionMessageRegExp">
<string>expectedExceptionMessageRegExp</string>
</element>
<element key="magentoAdminConfigFixture">
<string>magentoAdminConfigFixture</string>
</element>
<element key="magentoAppArea">
<string>magentoAppArea</string>
</element>
<element key="magentoAppIsolation">
<string>magentoAppIsolation</string>
</element>
<element key="magentoCache">
<string>magentoCache</string>
</element>
<element key="magentoComponentsDir">
<string>magentoComponentsDir</string>
</element>
<element key="magentoConfigFixture">
<string>magentoConfigFixture</string>
</element>
<element key="magentoDataFixture">
<string>magentoDataFixture</string>
</element>
<element key="magentoDataFixtureBeforeTransaction">
<string>magentoDataFixtureBeforeTransaction</string>
</element>
<element key="magentoDbIsolation">
<string>magentoDbIsolation</string>
</element>
<element key="magentoIndexerDimensionMode">
<string>magentoIndexerDimensionMode</string>
</element>
</array>
</arguments>
</extension>
And the class looks as follows:
<?php
declare(strict_types=1);
namespace Fix\IntegrationTests\Extension;
use PHPUnit\Runner\BeforeFirstTestHook;
use Doctrine\Common\Annotations\AnnotationReader;
class IgnoreMagentoAnnotations implements BeforeFirstTestHook
{
/**
* @param array $configOptions
*/
public function __construct(
private readonly array $configOptions = []
) {
}
/**
* Setup all the given names to be ignored by the annotation reader
*
* @return void
*/
public function executeBeforeFirstTest(): void
{
foreach ($this->configOptions as $annotationNameToIgnore) {
AnnotationReader::addGlobalIgnoredName($annotationNameToIgnore);
}
}
}
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchIssue related to Developer Experience and needs help with Triage to Confirm or Reject it