Skip to content

Commit 8dce78f

Browse files
authored
Grammar and formatting
1 parent 2744889 commit 8dce78f

File tree

1 file changed

+31
-35
lines changed

1 file changed

+31
-35
lines changed
Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,47 @@
1-
# Git vs Composer Installation of Magento with MFTF
1+
# Git vs Composer installation of Magento with MFTF
22

3+
Depending on how you plan to use Magnto code, there are different options for installing Magento.
34

4-
### GitHub Installation
5+
## GitHub Installation
56

6-
If you are planning on contributing a PR to the Magento 2 codebase, you can download Magento 2 from GitHub. Contribution to the codebase is done using the 'fork and pull' model where contributors maintain their own fork of the repo. This repo is then used to submit a pull request to the base repo.
7+
If you are contributing a pull request to the Magento 2 codebase, download Magento 2 from our GitHub repository. Contribution to the codebase is done using the 'fork and pull' model where contributors maintain their own fork of the repo. This repo is then used to submit a pull request to the base repo.
78

8-
Install guide: [GitHub Installation](https://devdocs.magento.com/guides/v2.3/install-gde/prereq/dev_install.html)
9+
Install guide: [GitHub Installation][]
910

11+
## Composer based Installation
1012

11-
### Composer based Installation
13+
A Composer install downloads released packages of Magento 2 from the composer repo [https://repo.magento.com](https://repo.magento.com).
1214

13-
Composer install downloads released packages of Magento 2 from the composer repo [https://repo.magento.com](https://repo.magento.com).
15+
All Magento modules and their MFTF tests are put under `<vendor>` directory, for convenience of 3rd party developers. With this setup, you can keep your custom modules separate from core modules. You can also develop modules in a separate VCS repository and add them to your `composer.json` which installs them into the `vendor` directory.
1416

15-
All Magento modules and their MFTF tests are put under `<vendor>` directory for convenience of 3rd party developers. With this setup, you can keep your custom modules separate from the core. You can also develop modules in a separate VCS repository and add them to your `composer.json` which will allow them to be installed into the `vendor` directory.
17+
Install guide: [Composer based Installation][]
1618

17-
Install guide: [Composer based Installation](https://devdocs.magento.com/guides/v2.3/install-gde/composer.html)
19+
## MFTF Installation
1820

21+
After installing your Magento project in either of the above ways, the composer dependency `magento/magento2-functional-testing-framework` downloads and installs MFTF. MFTF is embedded in your Magento 2 installation and will cover your project with functional tests.
1922

20-
### MFTF Installation
23+
If you want to contribute a pull request into MFTF codebase, you will need to install MFTF in the [Standalone][] mode.
2124

22-
After installing your Magento project in either of the above ways, the composer dependency `magento/magento2-functional-testing-framework` allows you to download and install MFTF. MFTF will be embedded in your Magento 2 installation and will cover your project with functional tests.
25+
## Managing modules - Composer vs GitHub
2326

24-
If you want to contribute a PR into MFTF codebase, you will need to install MFTF in the [Standalone] mode.
27+
### Via GitHub
2528

29+
Cloning the Magento 2 git repository is a way of installing where you do not have to worry about matching your codebase with production. Your version control system generally holds and manages your `app/code` folder and you can do manual, ad-hoc development here.
2630

27-
### Managing modules - Composer vs GitHub
31+
### Via Composer
2832

29-
#### Via GitHub:
33+
Magento advocates the use of composer for managing modules. When you install a module through composer, it is added to `vendor/<vendor-name>/<module>`.
3034

31-
Cloning Magento 2 git repository is a way of installing when you don't have to worry frequently about matching the codebase with production. Your version control system generally holds and manages your `app/code` folder and you can do manual ad-hoc development here.
35+
When developing your own module or adding MFTF tests to a module, you should not edit in `vendor` because a composer update could overwrite your changes. Instead, overwrite a module under `vendor` by adding files or cloning your module-specific Git repo to `app/code/<vendor-name>/<module>`.
3236

33-
#### Via composer:
37+
To distribute the module and its tests, you can initialize a git repo and create a [composer package][]. In this way others will be able to download and install your module and access your tests as a composer package, in their `<vendor>` folder.
3438

35-
Magento 2 advocates the use of composer for managing modules. When you install a module through composer, it is added to `vendor/<vendor-name>/<module>`
39+
## MFTF test materials location
3640

37-
If you are developing your own module or adding MFTF tests to the module, you should not edit `vendor` because a composer update could clobber your changes. Instead, you can override a module under `vendor`, by adding files or cloning your module specific git repo to `app/code/<vendor-name>/<module>`.
41+
- For GitHub installations, MFTF test materials are located in `<magento_root>/app/code/<vendor_name>/<module_name>/Test/Mftf/`. This is the directory for new tests or to maintain existing ones.
42+
- For Composer-based installations, MFTF test materials are located at `<magento_root>/vendor/<vendor_name>/<module_name>/Test/Mftf/`. This is the directory to run tests fetched by Composer.
3843

39-
If you want to distribute the module and its tests, you can initialize a git repo and create a [composer package](https://devdocs.magento.com/guides/v2.3/extension-dev-guide/package/package_module.html). In this way others will be able to download and install your module and access your tests as a composer package, in their `<vendor>` folder.
40-
41-
42-
### MFTF test materials location
43-
44-
- For GitHub installation, MFTF test materials are located at `<magento_root>/app/code/<vendor_name>/<module_name>/Test/Mftf/`. This is the directory to create new tests or maintain existing ones.
45-
46-
- For Composer based installation, MFTF test materials are located at `<magento_root>/vendor/<vendor_name>/<module_name>/Test/Mftf/`. This is the directory to run tests fetched by Composer.
47-
48-
The file structure under both paths is the same as below:
44+
The file structure under both paths is the same:
4945

5046
```tree
5147
<Path>
@@ -63,22 +59,22 @@ The file structure under both paths is the same as below:
6359
└── ...
6460
```
6561

62+
## How ModuleResolver reads modules
6663

67-
### How ModuleResolver reads modules
68-
69-
In either of the installations, all tests and test data are read and merged by MFTF's ModuleResolver in the order indicated below:
64+
With either type of installation, all tests and test data are read and merged by MFTF's ModuleResolver in this order:
7065

7166
1. `<magento_root>/app/code/<vendor_name>/<module_name>/Test/Mftf/`
72-
2. `<magento_root>/vendor/<vendor_name>/<module_name>/Test/Mftf/`
67+
1. `<magento_root>/vendor/<vendor_name>/<module_name>/Test/Mftf/`
7368

69+
## Conclusion
7470

75-
### Conclusion
76-
77-
There are no differences from MFTF's perspective between having the test materials in `app/code` or in `/vendor`. It works the same. Composer based install may benefit teams when there's a need to match file systems in dev and production.
71+
There is no difference between having the test materials in `app/code` or in `/vendor`: it works the same. Composer-based installs may benefit teams when there is a need to match file systems in `development` and `production`.
7872

7973
If you are a contributing developer with an understanding of Git and Composer commands, you can choose the GitHub installation method instead.
8074

81-
8275
<!-- Link definitions -->
8376

77+
[Composer based Installation]: https://devdocs.magento.com/guides/v2.3/install-gde/composer.html
78+
[GitHub Installation]: https://devdocs.magento.com/guides/v2.3/install-gde/prereq/dev_install.html
8479
[Standalone]: ../getting-started.html#set-up-a-standalone-mftf
80+
[composer package]: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/package/package_module.html

0 commit comments

Comments
 (0)