From 6e254521b98d95ca68c4ac3b7bae87fa19861b9e Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Sun, 28 Oct 2018 12:09:43 +0100 Subject: [PATCH 1/3] Split suite and default tests to different groups --- .../Util/Sorter/ParallelGroupSorter.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/Sorter/ParallelGroupSorter.php b/src/Magento/FunctionalTestingFramework/Util/Sorter/ParallelGroupSorter.php index 8654d64a7..8f4cac8a2 100644 --- a/src/Magento/FunctionalTestingFramework/Util/Sorter/ParallelGroupSorter.php +++ b/src/Magento/FunctionalTestingFramework/Util/Sorter/ParallelGroupSorter.php @@ -47,12 +47,18 @@ public function getTestsGroupedBySize($suiteConfiguration, $testNameToSize, $tim $testGroups = []; $splitSuiteNamesToTests = $this->createGroupsWithinSuites($suiteConfiguration, $time); $splitSuiteNamesToSize = $this->getSuiteToSize($splitSuiteNamesToTests); - $entriesForGeneration = array_merge($testNameToSize, $splitSuiteNamesToSize); - arsort($entriesForGeneration); + arsort($testNameToSize); + arsort($splitSuiteNamesToSize); - $testNameToSizeForUse = $entriesForGeneration; + $testNameToSizeForUse = $testNameToSize; $nodeNumber = 1; - foreach ($entriesForGeneration as $testName => $testSize) { + + foreach ($splitSuiteNamesToSize as $testName => $testSize) { + $testGroups[$nodeNumber] = [$testName => $testSize]; + $nodeNumber++; + } + + foreach ($testNameToSize as $testName => $testSize) { if (!array_key_exists($testName, $testNameToSizeForUse)) { // skip tests which have already been added to a group continue; From 9885925ea741d0b0eede35be09a45b62d9ef7c84 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Sun, 28 Oct 2018 12:19:53 +0100 Subject: [PATCH 2/3] Split suite and default tests to different groups - update composer.json hash, CHANGELOG.md - Unit test fix --- CHANGELOG.md | 4 ++++ composer.json | 2 +- composer.lock | 2 +- .../Util/Sorter/ParallelGroupSorterTest.php | 9 +++++---- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6b01f8aa..df22459ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ Magento Functional Testing Framework Changelog ================================================ +2.3.9 +----- +### Fixes +* Logic for parallel execution were updated to split default tests and suites from running in one group. 2.3.8 ----- diff --git a/composer.json b/composer.json index c59fd3279..b0935716c 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento2-functional-testing-framework", "description": "Magento2 Functional Testing Framework", "type": "library", - "version": "2.3.8", + "version": "2.3.9", "license": "AGPL-3.0", "keywords": ["magento", "automation", "functional", "testing"], "config": { diff --git a/composer.lock b/composer.lock index ae923f943..69ec89337 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d733d1bb277b1397e891340fed0877a2", + "content-hash": "852839b6476b1617ca7e2ed5ae46c12d", "packages": [ { "name": "allure-framework/allure-codeception", diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Util/Sorter/ParallelGroupSorterTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Util/Sorter/ParallelGroupSorterTest.php index c4a04d361..c03d0bbd8 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Util/Sorter/ParallelGroupSorterTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Util/Sorter/ParallelGroupSorterTest.php @@ -101,10 +101,11 @@ public function testSortWithSuites() $this->assertCount(4, $actualResult); $expectedResults = [ - 1 => ['test3'], - 2 => ['test2','test5', 'test4'], - 3 => ['mockSuite1_0', 'test1'], - 4 => ['mockSuite1_1'] + 1 => ['mockSuite1_0'], + 2 => ['mockSuite1_1'], + 3 => ['test3'], + 4 => ['test2','test5', 'test4'], + 5 => ['test1'], ]; foreach ($actualResult as $groupNum => $group) { From 96842ba013436c1113b51e3125a272df4b5d19fc Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Mon, 29 Oct 2018 10:18:08 -0500 Subject: [PATCH 3/3] Split suite and default tests to different groups - Unit test fix --- .../Util/Sorter/ParallelGroupSorterTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Util/Sorter/ParallelGroupSorterTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Util/Sorter/ParallelGroupSorterTest.php index c03d0bbd8..997bf0c3e 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Util/Sorter/ParallelGroupSorterTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Util/Sorter/ParallelGroupSorterTest.php @@ -98,7 +98,7 @@ public function testSortWithSuites() $actualResult = $testSorter->getTestsGroupedBySize($sampleSuiteArray, $sampleTestArray, 500); // verify the resulting groups - $this->assertCount(4, $actualResult); + $this->assertCount(5, $actualResult); $expectedResults = [ 1 => ['mockSuite1_0'],