Skip to content

Commit 20e1c7e

Browse files
authored
Merge pull request #636 from magento/MQE-2018
MQE-2018: Remove dead code: GenerateDocsCommand
2 parents 4098f44 + 1e534e1 commit 20e1c7e

File tree

7 files changed

+0
-478
lines changed

7 files changed

+0
-478
lines changed

dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ActionGroupAnnotationExtractorTest.php

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -44,49 +44,6 @@ public function testActionGroupExtractAnnotations()
4444
$this->assertEquals("someDescription", $returnedAnnotations['description']);
4545
}
4646

47-
/**
48-
* Annotation extractor should throw warning when required annotations are missing
49-
*
50-
* @throws \Exception
51-
*/
52-
public function testActionGroupMissingAnnotations()
53-
{
54-
// Action Group Data, missing description
55-
$testAnnotations = [];
56-
// Perform Test
57-
$extractor = new ActionGroupAnnotationExtractor();
58-
AspectMock::double($extractor, ['isCommandDefined' => true]);
59-
$extractor->extractAnnotations($testAnnotations, "fileName");
60-
61-
// Asserts
62-
TestLoggingUtil::getInstance()->validateMockLogStatement(
63-
'warning',
64-
'DEPRECATION: Action Group File fileName is missing required annotations.',
65-
[
66-
'actionGroup' => 'fileName',
67-
'missingAnnotations' => "description"
68-
]
69-
);
70-
}
71-
72-
/**
73-
* Annotation extractor should not throw warning when required
74-
* annotations are missing if command is not generate:docs
75-
*
76-
* @throws \Exception
77-
*/
78-
public function testActionGroupMissingAnnotationsNoWarning()
79-
{
80-
// Action Group Data, missing description
81-
$testAnnotations = [];
82-
// Perform Test
83-
$extractor = new ActionGroupAnnotationExtractor();
84-
$extractor->extractAnnotations($testAnnotations, "fileName");
85-
86-
// Asserts
87-
TestLoggingUtil::getInstance()->validateMockLogEmpty();
88-
}
89-
9047
/**
9148
* After class functionality
9249
* @return void

dev/tests/unit/Magento/FunctionalTestFramework/Util/DocGeneratorTest.php

Lines changed: 0 additions & 127 deletions
This file was deleted.

docs/commands/mftf.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,6 @@ vendor/bin/mftf run:failed
8989
This command cleans up the previously generated tests; generates and runs the tests listed in `dev/tests/acceptance/tests/_output/failed`.
9090
For more details about `failed`, refer to [Reporting][].
9191

92-
### Generate documentation for action groups
93-
94-
```bash
95-
vendor/bin/mftf generate:docs
96-
```
97-
98-
This command generates documentation for action groups.
99-
10092
## Reference
10193

10294
### `build:project`
@@ -270,32 +262,6 @@ vendor/bin/mftf generate:urn-catalog [--force] [<path to the directory with misc
270262
vendor/bin/mftf generate:urn-catalog .idea/
271263
```
272264

273-
### `generate:docs`
274-
275-
#### Description
276-
277-
Generates documentation that lists all action groups available in the codebase.
278-
The default path is `<projectRoot>/dev/tests/docs/documentation.md`.
279-
280-
#### Usage
281-
282-
```bash
283-
vendor/bin/mftf generate:docs [--clean] [--output=/path/to/alternate/dir]
284-
```
285-
286-
#### Options
287-
288-
| Option | Description |
289-
| ------------- | --------------------------------------------------------------------- |
290-
| `-c, --clean` | Overwrites previously existing documentation |
291-
| `-o, --output` | Changes the default output directory to a user specified directory |
292-
293-
#### Example
294-
295-
```bash
296-
vendor/bin/mftf generate:docs --clean
297-
```
298-
299265
### `reset`
300266

301267
#### Description

src/Magento/FunctionalTestingFramework/Console/CommandList.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public function __construct(array $commands = [])
3131
$this->commands = [
3232
'build:project' => new BuildProjectCommand(),
3333
'doctor' => new DoctorCommand(),
34-
'generate:docs' => new GenerateDocsCommand(),
3534
'generate:suite' => new GenerateSuiteCommand(),
3635
'generate:tests' => new GenerateTestsCommand(),
3736
'generate:urn-catalog' => new GenerateDevUrnCommand(),

src/Magento/FunctionalTestingFramework/Console/GenerateDocsCommand.php

Lines changed: 0 additions & 86 deletions
This file was deleted.

src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupAnnotationExtractor.php

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
*/
1414
class ActionGroupAnnotationExtractor extends AnnotationExtractor
1515
{
16-
const ACTION_GROUP_REQUIRED_ANNOTATIONS = [
17-
"description"
18-
];
19-
const GENERATE_DOCS_COMMAND = 'generate:docs';
20-
2116
/**
2217
* This method trims away irrelevant tags and returns annotations used in the array passed. The annotations
2318
* can be found in both Tests and their child element tests.
@@ -35,52 +30,7 @@ public function extractAnnotations($testAnnotations, $filename)
3530
foreach ($annotations as $annotationKey => $annotationData) {
3631
$annotationObjects[$annotationKey] = $annotationData[parent::ANNOTATION_VALUE];
3732
}
38-
// TODO: Remove this when all action groups have annotations
39-
if ($this->isCommandDefined()) {
40-
$this->validateMissingAnnotations($annotationObjects, $filename);
41-
}
4233

4334
return $annotationObjects;
4435
}
45-
46-
/**
47-
* Validates given annotations against list of required annotations.
48-
*
49-
* @param array $annotationObjects
50-
* @return void
51-
* @throws \Exception
52-
*/
53-
private function validateMissingAnnotations($annotationObjects, $filename)
54-
{
55-
$missingAnnotations = [];
56-
57-
foreach (self::ACTION_GROUP_REQUIRED_ANNOTATIONS as $REQUIRED_ANNOTATION) {
58-
if (!array_key_exists($REQUIRED_ANNOTATION, $annotationObjects)) {
59-
$missingAnnotations[] = $REQUIRED_ANNOTATION;
60-
}
61-
}
62-
63-
if (!empty($missingAnnotations)) {
64-
$message = "Action Group File {$filename} is missing required annotations.";
65-
LoggingUtil::getInstance()->getLogger(ActionObject::class)->deprecation(
66-
$message,
67-
["actionGroup" => $filename, "missingAnnotations" => implode(", ", $missingAnnotations)],
68-
true
69-
);
70-
}
71-
}
72-
73-
/**
74-
* Checks if command is defined as generate:docs
75-
*
76-
* @return boolean
77-
*/
78-
private function isCommandDefined()
79-
{
80-
if (defined('COMMAND') and COMMAND == self::GENERATE_DOCS_COMMAND) {
81-
return true;
82-
} else {
83-
return false;
84-
}
85-
}
8636
}

0 commit comments

Comments
 (0)