Skip to content

Commit 0faa3a0

Browse files
MQE-2964 Log MFTF test dependencies (magento#166)
* MQE-2964 Log MFTF test dependencies * MQE-2964 Log MFTF test dependencies * MQE-2964 fix static check test dependecies * MQE-2964 fix static check test dependecies * MQE-2964 fix static check test dependecies * new test depencyutil file created * else case added for testEntityJson * update doc for parameters Co-authored-by: Kevin Kozan <kkozan@adobe.com>
1 parent cbb551c commit 0faa3a0

File tree

6 files changed

+512
-150
lines changed

6 files changed

+512
-150
lines changed

dev/tests/unit/Magento/FunctionalTestFramework/Console/GenerateTestsCommandTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class GenerateTestsCommandTest extends TestCase
1717
* @param mixed $expected
1818
* @return void
1919
* @dataProvider configParallelOptions
20+
* @throws \ReflectionException
2021
*/
2122
public function testParseConfigParallelOptions($time, $groups, $expected): void
2223
{

docs/commands/mftf.md

+26-11
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,20 @@ suiteName:testInSuite
6565
vendor/bin/mftf generate:tests WYSIWYGDisabledSuite:AdminCMSPageCreatePageTest
6666
```
6767

68+
### Generate test dependencies
69+
70+
```bash
71+
vendor/bin/mftf generate:tests -l testEntityJson
72+
```
73+
74+
This command generate json file consist of all test dependent module.
75+
76+
### Generate test dependencies by test name
77+
78+
```bash
79+
vendor/bin/mftf generate:tests testName1 testName2 .. testNameN -l testEntityJson
80+
```
81+
6882
### Generate and run the tests for a specified group
6983

7084
```bash
@@ -183,17 +197,18 @@ vendor/bin/mftf generate:tests [option] [<test name>] [<test name>] [--remove]
183197

184198
#### Options
185199

186-
| Option | Description|
187-
| ---| --- |
188-
| `--config=[<default> or <singleRun> or <parallel>]` | Creates a single manifest file with a list of all tests. The default location is `tests/functional/Magento/FunctionalTest/_generated/testManifest.txt`.<br/> You can split the list into multiple groups using `--config=parallel`; the groups will be generated in `_generated/groups/` like `_generated/groups/group1.txt, group2.txt, ...`.<br/> Available values: `default` (default), `singleRun`(same as `default`), and `parallel`.<br/> Example: `generate:tests --config=parallel`. |
189-
| `--filter` | Option to filter tests to be generated.<br/>Template: '&lt;filterName&gt;:&lt;filterValue&gt;'.<br/>Existing filter types: severity, includeGroup, excludeGroup.<br/>Existing severity values: BLOCKER, CRITICAL, MAJOR, AVERAGE, MINOR.<br/>Example: `vendor/bin/mftf generate:tests --filter=severity:CRITICAL --filter=severity:BLOCKER --filter=includeGroup:customer`|
190-
| `--force` | Forces test generation, regardless of the module merge order defined in the Magento instance. Example: `generate:tests --force`. |
191-
| `-i,--time` | Set time in minutes to determine the group size when `--config=parallel` is used. <br/>Example: `generate:tests --config=parallel --time=15` <br/>Option `--time` will be the default and the __default value__ is `10` when neither `--time` nor `--groups` is specified. <br/>Example: `generate:tests --config=parallel`|
192-
| `-g,--groups` | Set number of groups to be split into when `--config=parallel` is used. <br>Example: `generate:tests --config=parallel --groups=300` <br/>Options `--time` and `--groups` are mutually exclusive and only one should be used.|
193-
| `--tests` | Defines the test configuration as a JSON string or JSON file path.|
194-
| `--allow-skipped` | Allows MFTF to generate and run tests marked with `<skip>.`|
195-
| `--debug` | Performs schema validations on XML files. <br/> DEFAULT: `generate:tests` implicitly performs schema validation on merged files. It does not indicate the file name where the error is encountered. <br/> DEVELOPER: `--debug` performs per-file validation and returns additional debug information (such as the filename where an error occurred) when test generation fails because of an invalid XML schema. This option takes extra processing time. Use it after test generation has failed once.<br/>|
196-
| `-r,--remove`| Removes the existing generated suites and tests cleaning up the `_generated` directory before the actual run. For example, `generate:tests SampleTest --remove` cleans up the entire `_generated` directory and generates `SampleTest` only.|
200+
| Option | Description |
201+
|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
202+
| `--config=[<default> or <singleRun> or <parallel>]` | Creates a single manifest file with a list of all tests. The default location is `tests/functional/Magento/FunctionalTest/_generated/testManifest.txt`.<br/> You can split the list into multiple groups using `--config=parallel`; the groups will be generated in `_generated/groups/` like `_generated/groups/group1.txt, group2.txt, ...`.<br/> Available values: `default` (default), `singleRun`(same as `default`), and `parallel`.<br/> Example: `generate:tests --config=parallel`. |
203+
| `--filter` | Option to filter tests to be generated.<br/>Template: '&lt;filterName&gt;:&lt;filterValue&gt;'.<br/>Existing filter types: severity, includeGroup, excludeGroup.<br/>Existing severity values: BLOCKER, CRITICAL, MAJOR, AVERAGE, MINOR.<br/>Example: `vendor/bin/mftf generate:tests --filter=severity:CRITICAL --filter=severity:BLOCKER --filter=includeGroup:customer` |
204+
| `--force` | Forces test generation, regardless of the module merge order defined in the Magento instance. Example: `generate:tests --force`. |
205+
| `-i,--time` | Set time in minutes to determine the group size when `--config=parallel` is used. <br/>Example: `generate:tests --config=parallel --time=15` <br/>Option `--time` will be the default and the __default value__ is `10` when neither `--time` nor `--groups` is specified. <br/>Example: `generate:tests --config=parallel` |
206+
| `-g,--groups` | Set number of groups to be split into when `--config=parallel` is used. <br>Example: `generate:tests --config=parallel --groups=300` <br/>Options `--time` and `--groups` are mutually exclusive and only one should be used. |
207+
| `--tests` | Defines the test configuration as a JSON string or JSON file path. |
208+
| `--allow-skipped` | Allows MFTF to generate and run tests marked with `<skip>.` |
209+
| `--debug` | Performs schema validations on XML files. <br/> DEFAULT: `generate:tests` implicitly performs schema validation on merged files. It does not indicate the file name where the error is encountered. <br/> DEVELOPER: `--debug` performs per-file validation and returns additional debug information (such as the filename where an error occurred) when test generation fails because of an invalid XML schema. This option takes extra processing time. Use it after test generation has failed once.<br/> |
210+
| `-r,--remove` | Removes the existing generated suites and tests cleaning up the `_generated` directory before the actual run. For example, `generate:tests SampleTest --remove` cleans up the entire `_generated` directory and generates `SampleTest` only. |
211+
| `-l,--log` | Generate metadata files during test generation. Accepted parameters are: testEntityJson. |
197212

198213
#### Examples of the JSON configuration
199214

0 commit comments

Comments
 (0)