Skip to content

MQE-2080: [PHPUnit 9] Suite failures on builds w/ extns (PageBuilder,… #680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev/tests/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.1/phpunit.xsd"
convertNoticesToExceptions="false"
bootstrap="_bootstrap.php"
backupGlobals="false">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public function testSortWithSuites()
$this->assertCount(5, $actualResult);

$expectedResults = [
1 => ['mockSuite1_0'],
2 => ['mockSuite1_1'],
1 => ['mockSuite1_0_G'],
2 => ['mockSuite1_1_G'],
3 => ['test3'],
4 => ['test2','test5', 'test4'],
5 => ['test1'],
Expand Down
8 changes: 4 additions & 4 deletions dev/tests/verification/Tests/SuiteGenerationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ public function testSuiteGenerationParallel()
$groupName = 'functionalSuite1';

$expectedGroups = [
'functionalSuite1_0',
'functionalSuite1_1',
'functionalSuite1_2',
'functionalSuite1_3'
'functionalSuite1_0_G',
'functionalSuite1_1_G',
'functionalSuite1_2_G',
'functionalSuite1_3_G'
];

$expectedContents = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ private function sanitizeGroupName($group)
// if we can't find this group in the generated suites we have to assume that the group was split for generation
$groupNameSplit = explode("_", $group);
array_pop($groupNameSplit);
array_pop($groupNameSplit);
$originalName = implode("_", $groupNameSplit);

// confirm our original name is one of the existing suite names otherwise just return the original group name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private function getSuiteToSize($suiteNamesToTests)
*
* E.g.
* Input {suitename = 'sample', tests = ['test1' => 100,'test2' => 150, 'test3' => 300], linelimit = 275}
* Result { ['sample_01' => ['test3' => 300], 'sample_02' => ['test2' => 150, 'test1' => 100]] }
* Result { ['sample_01_G' => ['test3' => 300], 'sample_02_G' => ['test2' => 150, 'test1' => 100]] }
*
* @param string $suiteName
* @param array $tests
Expand All @@ -252,8 +252,8 @@ private function splitTestSuite($suiteName, $tests, $maxTime)
}

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

$availableTests = array_diff_key($availableTests, $group);
$splitCount++;
Expand Down