Skip to content

Commit 2503527

Browse files
authored
Merge pull request magento#16 from magento-commerce/3.2.1-RC
3.2.1 rc
2 parents 0ec0c87 + 2df65d0 commit 2503527

File tree

9 files changed

+116
-24
lines changed

9 files changed

+116
-24
lines changed

CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Magento Functional Testing Framework Changelog
22
================================================
33

4+
3.2.1
5+
---------
6+
7+
### Fixes
8+
9+
* Fixed issue that causes Magento bin/magento to fail when xdebug 3 is used. [GitHub Issue #808](https://github.com/magento/magento2-functional-testing-framework/issues/808)
10+
11+
### GitHub Pull Requests:
12+
13+
* [#806](https://github.com/magento/magento2-functional-testing-framework/pull/806) -- Enable an extending entity to overwrite a requiredEntity binding
14+
* [#809](https://github.com/magento/magento2-functional-testing-framework/pull/809) -- Add MFTF documentation for AWS S3
15+
416
3.2.0
517
---------
618

@@ -53,7 +65,7 @@ Fixed issue with XPath locators for waits in MagentoPwaWebDriver.
5365

5466
* Fixed issue with suite precondition failure for `createData` with required entity.
5567

56-
### GitHub Issues/Pull requests:
68+
### GitHub Issues/Pull Requests:
5769

5870
* [#547](https://github.com/magento/magento2-functional-testing-framework/pull/547) -- Fix invalid behavior of MAGENTO_BACKEND_BASE_URL
5971
* [#742](https://github.com/magento/magento2-functional-testing-framework/pull/742) -- Fix Waits In MagentoPwaWebDriver

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento2-functional-testing-framework",
33
"description": "Magento2 Functional Testing Framework",
44
"type": "library",
5-
"version": "3.2.0",
5+
"version": "3.2.1",
66
"license": "AGPL-3.0",
77
"keywords": ["magento", "automation", "functional", "testing"],
88
"config": {

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/functional/standalone_bootstrap.php

-7
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,3 @@
7070

7171
$RELATIVE_TESTS_MODULE_PATH = '/tests/functional/tests/MFTF';
7272
defined('TESTS_MODULE_PATH') || define('TESTS_MODULE_PATH', realpath(TESTS_BP . $RELATIVE_TESTS_MODULE_PATH));
73-
74-
75-
// add the debug flag here
76-
$debug_mode = $_ENV['MFTF_DEBUG'] ?? false;
77-
if (!(bool)$debug_mode && extension_loaded('xdebug')) {
78-
xdebug_disable();
79-
}

dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Persist/OperationDataArrayResolverTest.php

+54
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,60 @@ public function testNestedMetadataArrayOfDiverseObjects()
477477
$this->assertEquals($expectedResult, $result);
478478
}
479479

480+
public function testExtendedWithRequiredEntity()
481+
{
482+
$entityDataObjectBuilder = new EntityDataObjectBuilder();
483+
$extEntityDataObject = $entityDataObjectBuilder
484+
->withName("extEntity")
485+
->withType("entity")
486+
->withLinkedEntities(["baseSubentity" => "subentity","extSubentity" => "subentity"])
487+
->build();
488+
489+
$mockDOHInstance = AspectMock::double(DataObjectHandler::class, ["getObject" => function ($name) {
490+
$entityDataObjectBuilder = new EntityDataObjectBuilder();
491+
492+
if ($name == "baseSubentity") {
493+
return $entityDataObjectBuilder
494+
->withName("baseSubentity")
495+
->withType("subentity")
496+
->withDataFields(["subtest" => "BaseSubtest"])
497+
->build();
498+
}
499+
500+
if ($name == "extSubentity") {
501+
return $entityDataObjectBuilder
502+
->withName("extSubentity")
503+
->withType("subentity")
504+
->withDataFields(["subtest" => "ExtSubtest"])
505+
->build();
506+
}
507+
}])->make();
508+
AspectMock::double(DataObjectHandler::class, ['getInstance' => $mockDOHInstance]);
509+
510+
$subentityOpElementBuilder = new OperationElementBuilder();
511+
$subentityOpElement = $subentityOpElementBuilder
512+
->withKey("sub")
513+
->withType("subentity")
514+
->withElementType("object")
515+
->withFields(["subtest" => "string"])
516+
->build();
517+
518+
$operationResolver = new OperationDataArrayResolver();
519+
$result = $operationResolver->resolveOperationDataArray(
520+
$extEntityDataObject,
521+
[$subentityOpElement],
522+
"create",
523+
false
524+
);
525+
526+
$expected = [
527+
"sub" => [
528+
"subtest" => "ExtSubtest"
529+
]
530+
];
531+
532+
$this->assertEquals($expected, $result);
533+
}
480534
/**
481535
* After class functionality
482536
* @return void

docs/configuration.md

+40
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,46 @@ When pause is enabled, MFTF will generate pause() command in _failed() hook so t
368368
ENABLE_PAUSE=true
369369
```
370370

371+
### REMOTE_STORAGE_AWSS3_DRIVER
372+
373+
The remote storage driver. To enable AWS S3, use `aws-s3`.
374+
375+
Example:
376+
377+
```conf
378+
REMOTE_STORAGE_AWSS3_DRIVER=aws-s3
379+
```
380+
381+
### REMOTE_STORAGE_AWSS3_REGION
382+
383+
The region of S3 bucket.
384+
385+
Example:
386+
387+
```conf
388+
REMOTE_STORAGE_AWSS3_REGION=us-west-2
389+
```
390+
391+
### REMOTE_STORAGE_AWSS3_BUCKET
392+
393+
The name of S3 bucket.
394+
395+
Example:
396+
397+
```conf
398+
REMOTE_STORAGE_AWSS3_BUCKET=my-test-bucket
399+
```
400+
401+
### REMOTE_STORAGE_AWSS3_PREFIX
402+
403+
The optional prefix inside S3 bucket.
404+
405+
Example:
406+
407+
```conf
408+
REMOTE_STORAGE_AWSS3_PREFIX=local
409+
```
410+
371411
<!-- Link definitions -->
372412

373413
[`MAGENTO_CLI_COMMAND_PATH`]: #magento_cli_command_path

src/Magento/FunctionalTestingFramework/Config/MftfApplicationConfig.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,15 @@ private function __construct(
100100

101101
$this->phase = $phase;
102102
$this->verboseEnabled = $verboseEnabled;
103-
if (isset($debugLevel) && !in_array(strtolower($debugLevel), self::MFTF_DEBUG_LEVEL)) {
103+
if (!in_array(strtolower($debugLevel), self::MFTF_DEBUG_LEVEL)) {
104104
throw new TestFrameworkException("{$debugLevel} is not a debug level. Use 'DEFAULT' or 'DEVELOPER'");
105105
}
106106
switch (strtolower($debugLevel)) {
107-
case self::LEVEL_DEVELOPER:
108107
case self::LEVEL_DEFAULT:
109-
$this->debugLevel = $debugLevel;
108+
$this->debugLevel = self::LEVEL_DEFAULT;
110109
break;
111-
case null:
110+
default:
112111
$this->debugLevel = self::LEVEL_DEVELOPER;
113-
break;
114112
}
115113
$this->allowSkipped = $allowSkipped;
116114
$this->filterList = new FilterList($filters);
@@ -196,7 +194,7 @@ public function verboseEnabled()
196194
*/
197195
public function getDebugLevel()
198196
{
199-
return $this->debugLevel ?? getenv('MFTF_DEBUG');
197+
return $this->debugLevel;
200198
}
201199

202200
/**

src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,11 @@ private function getDependentEntitiesOfType($type)
245245
private function resolveOperationObjectAndEntityData($entityObject, $operationElementValue)
246246
{
247247
if ($operationElementValue != $entityObject->getType()) {
248-
// if we have a mismatch attempt to retrieve linked data and return just the first linkage
248+
// if we have a mismatch attempt to retrieve linked data and return just the last linkage
249+
// this enables overwriting of required entity fields
249250
$linkName = $entityObject->getLinkedEntitiesOfType($operationElementValue);
250251
if (!empty($linkName)) {
251-
$linkName = $linkName[0];
252+
$linkName = array_pop($linkName);
252253
return DataObjectHandler::getInstance()->getObject($linkName);
253254
}
254255
return null;

src/Magento/FunctionalTestingFramework/_bootstrap.php

-6
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,3 @@
7474
'TESTS_MODULE_PATH',
7575
realpath(TESTS_BP . $RELATIVE_TESTS_MODULE_PATH)
7676
);
77-
78-
// add the debug flag here
79-
$debugMode = $_ENV['MFTF_DEBUG'] ?? false;
80-
if (!(bool)$debugMode && extension_loaded('xdebug')) {
81-
xdebug_disable();
82-
}

0 commit comments

Comments
 (0)