Skip to content

Commit c69c6b3

Browse files
committed
AC-3005::Resolve the conflicts
2 parents e10a7ec + 7087dc5 commit c69c6b3

File tree

9 files changed

+154
-48
lines changed

9 files changed

+154
-48
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
php-versions: ['7.3', '7.4', '8.0', '8.1']
15+
php-versions: ['7.4', '8.0', '8.1']
1616
steps:
1717
- uses: actions/checkout@v2
1818

@@ -54,7 +54,7 @@ jobs:
5454
strategy:
5555
fail-fast: false
5656
matrix:
57-
php-versions: ['7.3', '7.4', '8.0', '8.1']
57+
php-versions: ['7.4', '8.0', '8.1']
5858
steps:
5959
- uses: actions/checkout@v2
6060

@@ -86,7 +86,7 @@ jobs:
8686
strategy:
8787
fail-fast: false
8888
matrix:
89-
php-versions: ['7.3', '7.4', '8.0', '8.1']
89+
php-versions: ['7.4', '8.0', '8.1']
9090
steps:
9191
- uses: actions/checkout@v2
9292

@@ -118,7 +118,7 @@ jobs:
118118
strategy:
119119
fail-fast: false
120120
matrix:
121-
php-versions: ['7.3', '7.4', '8.0', '8.1']
121+
php-versions: ['7.4', '8.0', '8.1']
122122

123123
services:
124124
chrome:

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
Magento Functional Testing Framework Changelog
22
================================================
33

4+
3.11.0
5+
---------
6+
### Enhancements
7+
* Composer updated to 2.4.2 version
8+
* Static check for duplicate step keys in action group
9+
10+
11+
### Fixes
12+
13+
* Fixed incorrect MFTF test dependencies path
14+
* Removed PHP 7.3 build check from MFTF PR build as PHP 7.3 is no longer supported
15+
16+
17+
3.10.3
18+
---------
19+
20+
### Fixes
21+
22+
* Chrome settings for potential cost reductions
23+
424
3.10.2
525
---------
626

@@ -10,7 +30,6 @@ Magento Functional Testing Framework Changelog
1030
* Fixed links in docs
1131

1232

13-
1433
3.10.1
1534
---------
1635

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"name": "magento/magento2-functional-testing-framework",
33
"description": "Magento2 Functional Testing Framework",
44
"type": "library",
5-
"version": "3.10.2",
5+
"version": "3.11.0",
66
"license": "AGPL-3.0",
77
"keywords": ["magento", "automation", "functional", "testing"],
88
"config": {
99
"sort-packages": true
1010
},
1111
"require": {
12-
"php": ">7.3",
12+
"php": ">7.4",
1313
"ext-curl": "*",
1414
"ext-dom": "*",
1515
"ext-iconv": "*",

composer.lock

Lines changed: 35 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,48 @@ public function testTestsAndSuitesSplitByMinGroupNumber(): void
378378
}
379379
}
380380

381+
/**
382+
* Test splitting tests and suites when none of the suites has test.
383+
* For example, this can happen when --filter option is used.
384+
*
385+
* @return void
386+
* @throws FastFailException
387+
*/
388+
public function testTestsAndSuitesSplitByGroupNumberSuiteNoTest(): void
389+
{
390+
// mock tests for test object handler.
391+
$this->createMockForTest(0);
392+
393+
// create test to size array
394+
$sampleTestArray = [
395+
'test1' => 1,
396+
'test2' => 125,
397+
'test3' => 35
398+
];
399+
400+
// create mock suite references
401+
$sampleSuiteArray = [
402+
'mockSuite1' => [],
403+
'mockSuite2' => [],
404+
];
405+
406+
// perform sort
407+
$testSorter = new ParallelGroupSorter();
408+
$actualResult = $testSorter->getTestsGroupedByFixedGroupCount($sampleSuiteArray, $sampleTestArray, 3);
409+
// verify the resulting groups
410+
$this->assertCount(3, $actualResult);
411+
412+
$expectedResults = [
413+
1 => ['test2'],
414+
2 => ['test3'],
415+
3 => ['test1']
416+
];
417+
418+
foreach ($actualResult as $groupNum => $group) {
419+
$this->assertEquals($expectedResults[$groupNum], array_keys($group));
420+
}
421+
}
422+
381423
/**
382424
* Test splitting tests and suites with invalid group number.
383425
*

src/Magento/FunctionalTestingFramework/Console/GenerateTestsCommand.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ class GenerateTestsCommand extends BaseGenerateCommand
3737
const PARALLEL_DEFAULT_TIME = 10;
3838
const EXTENDS_REGEX_PATTERN = '/extends=["\']([^\'"]*)/';
3939
const ACTIONGROUP_REGEX_PATTERN = '/ref=["\']([^\'"]*)/';
40-
const TEST_DEPENDENCY_FILE_LOCATION = 'dev/tests/_output/test-dependencies.json';
40+
const TEST_DEPENDENCY_FILE_LOCATION_STANDALONE = 'dev/tests/_output/test-dependencies.json';
41+
const TEST_DEPENDENCY_FILE_LOCATION_EMBEDDED = 'dev/tests/acceptance/tests/_output/test-dependencies.json';
4142

4243
/**
4344
* @var ScriptUtil
@@ -250,8 +251,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
250251
if (!empty($log)) {
251252
if ($log === "testEntityJson") {
252253
$this->getTestEntityJson($tests);
254+
$testDependencyFileLocation = self::TEST_DEPENDENCY_FILE_LOCATION_EMBEDDED;
255+
if (isset($_ENV['MAGENTO_BP'])) {
256+
$testDependencyFileLocation = self::TEST_DEPENDENCY_FILE_LOCATION_STANDALONE;
257+
}
253258
$output->writeln(
254-
"Test dependencies file created, Located in: " . self::TEST_DEPENDENCY_FILE_LOCATION
259+
"Test dependencies file created, Located in: " . $testDependencyFileLocation
255260
);
256261
} else {
257262
$output->writeln(
@@ -555,7 +560,15 @@ private function getExtendedTestDependencies(array $extendedTests): array
555560
*/
556561
private function array2Json(array $array)
557562
{
558-
$file = fopen(self::TEST_DEPENDENCY_FILE_LOCATION, 'w');
563+
$testDependencyFileLocation = self::TEST_DEPENDENCY_FILE_LOCATION_EMBEDDED;
564+
if (isset($_ENV['MAGENTO_BP'])) {
565+
$testDependencyFileLocation = self::TEST_DEPENDENCY_FILE_LOCATION_STANDALONE;
566+
}
567+
$testDependencyFileLocationDir = dirname($testDependencyFileLocation);
568+
if (!is_dir($testDependencyFileLocationDir)) {
569+
mkdir($testDependencyFileLocationDir, 0777, true);
570+
}
571+
$file = fopen($testDependencyFileLocation, 'w');
559572
$json = json_encode($array, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
560573
fwrite($file, $json);
561574
fclose($file);

0 commit comments

Comments
 (0)