Skip to content

Commit e9b96a3

Browse files
authored
MQE-2080: [PHPUnit 9] Suite failures on builds w/ extns (PageBuilder,… (#680)
* MQE-2080: [PHPUnit 9] Suite failures on builds w/ extns (PageBuilder, MSI) * MQE-2080: [PHPUnit 9] Suite failures on builds w/ extns (PageBuilder, MSI) fixing unit tests * MQE-2080: [PHPUnit 9] Suite failures on builds w/ extns (PageBuilder, MSI) Updated comment block * MQE-2080: [PHPUnit 9] Suite failures on builds w/ extns (PageBuilder, MSI)
1 parent b79ec06 commit e9b96a3

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

dev/tests/phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<phpunit
99
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
10+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.1/phpunit.xsd"
1111
convertNoticesToExceptions="false"
1212
bootstrap="_bootstrap.php"
1313
backupGlobals="false">

dev/tests/unit/Magento/FunctionalTestFramework/Util/Sorter/ParallelGroupSorterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ public function testSortWithSuites()
101101
$this->assertCount(5, $actualResult);
102102

103103
$expectedResults = [
104-
1 => ['mockSuite1_0'],
105-
2 => ['mockSuite1_1'],
104+
1 => ['mockSuite1_0_G'],
105+
2 => ['mockSuite1_1_G'],
106106
3 => ['test3'],
107107
4 => ['test2','test5', 'test4'],
108108
5 => ['test1'],

dev/tests/verification/Tests/SuiteGenerationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ public function testSuiteGenerationParallel()
118118
$groupName = 'functionalSuite1';
119119

120120
$expectedGroups = [
121-
'functionalSuite1_0',
122-
'functionalSuite1_1',
123-
'functionalSuite1_2',
124-
'functionalSuite1_3'
121+
'functionalSuite1_0_G',
122+
'functionalSuite1_1_G',
123+
'functionalSuite1_2_G',
124+
'functionalSuite1_3_G'
125125
];
126126

127127
$expectedContents = [

src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ private function sanitizeGroupName($group)
121121
// if we can't find this group in the generated suites we have to assume that the group was split for generation
122122
$groupNameSplit = explode("_", $group);
123123
array_pop($groupNameSplit);
124+
array_pop($groupNameSplit);
124125
$originalName = implode("_", $groupNameSplit);
125126

126127
// confirm our original name is one of the existing suite names otherwise just return the original group name

src/Magento/FunctionalTestingFramework/Util/Sorter/ParallelGroupSorter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private function getSuiteToSize($suiteNamesToTests)
232232
*
233233
* E.g.
234234
* Input {suitename = 'sample', tests = ['test1' => 100,'test2' => 150, 'test3' => 300], linelimit = 275}
235-
* Result { ['sample_01' => ['test3' => 300], 'sample_02' => ['test2' => 150, 'test1' => 100]] }
235+
* Result { ['sample_01_G' => ['test3' => 300], 'sample_02_G' => ['test2' => 150, 'test1' => 100]] }
236236
*
237237
* @param string $suiteName
238238
* @param array $tests
@@ -252,8 +252,8 @@ private function splitTestSuite($suiteName, $tests, $maxTime)
252252
}
253253

254254
$group = $this->createTestGroup($maxTime, $test, $size, $availableTests);
255-
$splitSuites["{$suiteName}_${splitCount}"] = $group;
256-
$this->addSuiteToConfig($suiteName, "{$suiteName}_${splitCount}", $group);
255+
$splitSuites["{$suiteName}_${splitCount}_G"] = $group;
256+
$this->addSuiteToConfig($suiteName, "{$suiteName}_${splitCount}_G", $group);
257257

258258
$availableTests = array_diff_key($availableTests, $group);
259259
$splitCount++;

0 commit comments

Comments
 (0)