Skip to content

Commit 4e94af4

Browse files
doboothsoumyau
authored andcommitted
Editorial pass
1 parent a9b6bbe commit 4e94af4

File tree

1 file changed

+53
-46
lines changed

1 file changed

+53
-46
lines changed

docs/guides/cicd.md

+53-46
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,106 @@
11
# How to use MFTF in CICD
22

3-
If you want to integrate MFTF tests into your CICD pipeline, then it's best to start with the conceptual flow of the pipeline code.
3+
To integrate MFTF tests into your CICD pipeline, then it is best to start with the conceptual flow of the pipeline code.
44

55
## Concept
66

7-
The overall workflow that tests should follow is thus:
7+
The overall workflow that tests should follow is:
88

9-
* Obtain Magento instance + install pre-requisites
10-
* Generate tests for running
11-
* Options for single/parallel running
12-
* Delegate and run tests + gather test run artifacts
13-
* Re-run options
14-
* Generate Allure report from aggregate
9+
- Obtain a Magento instance + install pre-requisites.
10+
- Generate the tests.
11+
- Set options for single or parallel running.
12+
- Delegate and run tests and gather test-run artifacts.
13+
- Re-run options.
14+
- Generate the Allure reports from results.
1515

16-
### Obtain Magento instance
16+
## Obtain a Magento instance
1717

18-
To start, we need a Magento instance to operate against for generation and execution.
18+
To start, we need a Magento instance to operate against for test generation and execution.
1919

20+
```bash
21+
git clone https://github.com/magento/magento2
2022
```
21-
$ git clone https://github.com/magento/magento2
23+
2224
or
23-
$ composer create-project --repository=https://repo.magento.com/ magento/project-community-edition magento2ce
25+
26+
```bash
27+
composer create-project --repository=https://repo.magento.com/ magento/project-community-edition magento2ce
2428
```
2529

2630
For more information on installing magento see [Install Magento using Composer].
2731

2832
After installing the Magento instance, you need to set a couple of configurations to the magento instance:
2933

30-
```
31-
$ bin/magento config:set general/locale/timezone America/Los_Angeles
32-
$ bin/magento config:set admin/security/admin_account_sharing 1
33-
$ bin/magento config:set admin/security/use_form_key 0
34-
$ bin/magento config:set cms/wysiwyg/enabled disabled
34+
```bash
35+
bin/magento config:set general/locale/timezone America/Los_Angeles
36+
bin/magento config:set admin/security/admin_account_sharing 1
37+
bin/magento config:set admin/security/use_form_key 0
38+
bin/magento config:set cms/wysiwyg/enabled disabled
3539
```
3640

37-
These help set the state for the `default` state of the Magento instance. If you are wanting to change the default state of the application (and have merged into the tests sufficiently to account for it), this is the step in which you would do it.
41+
These help set the `default` state of the Magento instance. If you wish to change the default state of the application (and have updated your tests sufficiently to account for it), this is the step in which you would do it.
3842

39-
#### Install allure
43+
## Install allure
4044

4145
This will be required to generate the report after your test runs. See [Allure] for details.
4246

47+
## Generate tests
4348

44-
### Generate tests
45-
46-
#### Single execution
49+
### Single execution
4750

48-
Simply generate tests based on what you want to run:
51+
Generate tests based on what you want to run:
4952

50-
```
51-
$ vendor/bin/mftf generate:tests
53+
```bash
54+
vendor/bin/mftf generate:tests
5255
```
5356

54-
This will generate all tests, and a single manifest file under `dev/tests/acceptance/tests/functional/Magento/FunctionalTest/_generated/testManifest.txt`
57+
This will generate all tests and a single manifest file under `dev/tests/acceptance/tests/functional/Magento/FunctionalTest/_generated/testManifest.txt`
5558

56-
#### Parallel execution
59+
### Parallel execution
5760

5861
To generate all tests for use in parallel nodes:
5962

60-
```
61-
$ vendor/bin/mftf generate:tests --config parallel
63+
```bash
64+
vendor/bin/mftf generate:tests --config parallel
6265
```
6366

6467
This will generate a folder under `dev/tests/acceptance/tests/functional/Magento/FunctionalTest/_generated/groups`. This folder contains several `group#.txt` files that can be used later with the `mftf run:manifest` command.
6568

66-
### Delegate and run tests
69+
## Delegate and run tests
6770

68-
#### Single execution
69-
If you are running on a single node, this step is simply to call:
71+
### Single execution
7072

73+
If you are running on a single node, call:
74+
75+
```bash
76+
vendor/bin/mftf run:manifest dev/tests/acceptance/tests/functional/Magento/FunctionalTest/_generated/testManifest.txt
7177
```
72-
$ vendor/bin/mftf run:manifest dev/tests/acceptance/tests/functional/Magento/FunctionalTest/_generated/testManifest.txt
73-
```
7478

75-
#### Parallel execution
76-
To run MFTF tests in parallel, you will need to clone the contents of the current node and duplicate them depending on how many nodes you have available for use.
79+
### Parallel execution
80+
81+
To run MFTF tests in parallel, clone the contents of the current node and duplicate them depending on how many nodes you have.
82+
83+
- Clone contents of current node as a baseline.
84+
- For each `groups/group#.txt` file:
7785

78-
* Clone contents of current node as a baseline
79-
* For each `groups/group#.txt` file:
80-
* Set a node's contents to the baseline
81-
* Run `vendor/bin/mftf run:manifest <current_group.txt>`
82-
* Gather artifacts from `dev/tests/acceptance/tests/_output` from current node to master
86+
- Set a node's contents to the baseline.
87+
- Run `vendor/bin/mftf run:manifest <current_group.txt>`.
88+
- Gather artifacts from `dev/tests/acceptance/tests/_output` from current node to master.
8389

8490
#### Rerun options
85-
In either single or parallel execution, to re-run failed tests simply add a `run:failed` command after executing a manifest:
8691

87-
```
88-
$ vendor/bin/mftf run:failed
92+
In either single or parallel execution, to re-run failed tests simply add the `run:failed` command after executing a manifest:
93+
94+
```bash
95+
vendor/bin/mftf run:failed
8996
```
9097

9198
### Generate Allure report
9299

93100
In the master node, simply generate using your `<path_to_results>` into a desired output path
94101

95-
```
96-
$ allure generate <path_to_results> -c -o <path_to_output>
102+
```bash
103+
allure generate <path_to_results> -c -o <path_to_output>
97104
```
98105

99106
<!-- Link definitions -->

0 commit comments

Comments
 (0)