-
Notifications
You must be signed in to change notification settings - Fork 152
MFTF test packaging proposal #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MFTF test packaging proposal #172
Conversation
For sure, code that may be executed is a subject of attack but in case of MFTF module contains only XML configuration so no executable that may be used somehow while MFTF itself is not installed. Another question that deserves explicit discussion is what is the production environment for Magento. I totally agree that running instance of Magento that serve real merchant customers should not contain any executable test code. But are composer packages that we produce production code or not? With removing our tests from packages we increase the complexity of system integrators and vendors workflow and internal and external CI infrastructures. It also leads to controversial decisions in release management and packaging. Alternatively, we may consider a possibility to provide instruments to remove test code (including from any possible 3rd party extensions and SI customizations) as part of operations during deploying Magento. This may be done as CLI command which may be part of enabling the production mode. Or it may be done by Composer plugin that will remove test code if |
- update directory
1629b01
to
d4cefd7
Compare
- address comment
@melnikovi Yes, I will investigate tooling for that. Will update document afterwards. |
- update image
2. Create `magento2-module` package as usual, but without tests. | ||
|
||
3. Out of excluded tests create a separate package. | ||
- For this package we will automatically generate `composer.json` based on existing module `composer.json` file as shown on image below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type: "magento2-test-module"
- will this information be used anywhere or can we use just standard Composer type library
?
- Update proposal to match [Module separation naming]
- Update proposal to match [Module separation naming]
|
||
#### Magento metapackage | ||
In Magento `magento/project-community-edition` we will be able to specify 2 metapackage under different blocks. | ||
Magento application will go to `require` section as it is right now and we will be able to put `magento/functional-test-project-community-edition` under `require-dev` section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
functional-tests (instead of test?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This proposal is about packaging Functional tests only. And they shouldn't be distributed with other test types together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I am in favor of this proposal. It aligns well with the the best practices mentioned here: https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world.html
@ravmenon Please take a look at files section and you will see that proposal was changed drastically. So some of your comments goes to outdated part. |
|
||
#### Magento metapackage | ||
In Magento `magento/project-community-edition` we will be able to specify 2 metapackage under different blocks. | ||
Magento application will go to `require` section as it is right now and we will be able to put `magento/functional-test-project-community-edition` under `require-dev` section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks odd to include project
in a project
. Maybe this metapackage should not be called project
? And someone can include it in the "Magento project" or to create an empty "project" for tests and include this metapackage. Could you please also include more details what do you expect in the metapackage? Does it include all the frameworks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is typo. It meant to be magento/functional-test-product-community-edition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, documentation should explicitly state that Web Setup Wizard does not support testing packages and it's intentional (because it's considered to be used in production). Please confirm with PO and validate that this is real behavior (when implementing).
>Future-proof: | ||
> - ability to release separately, on separate cadence | ||
> - matches the general plan for all other non-critical modules - we want to modularize and release separately things like payment extensions, shipping and more. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Performance:
- MFTF coverage grows drastically, which side effect is growing deployment time for staging / production environment
I'm not sure if I'm missing something, but... In practice - each module needs tests only for |
Adding here discussion from Slack channel to not loose it.
|
- small changes to address comments
|
||
#### Magento metapackage | ||
In Magento `magento/project-community-edition` we will be able to specify 2 metapackage under different blocks. | ||
Magento application will go to `require` section as it is right now and we will be able to put `magento/functional-test-project-community-edition` under `require-dev` section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to move "magento/magento2-functional-testing-framework" from 'require-dev' to new meta package with tests as well
Edited:
In order to support existing mftf tests in 3rd party modules we should keep it
@lbajsarowicz, |
Same. It will not work. |
- small changes to address comments from arch meeting
@buskamuza @melnikovi @paliarush @maghamed Do I need to do something with this proposal? Or we can merge it and I will proceed with implementation tasks and implementation itself? |
@buskamuza sorry missed this discussion and your comment. Keeping the testing metapackage out of the root composer.json require-dev section was exactly my point. If someone chooses to use the same tools as Magento for their development - great. It's only a |
Exactly. So we're adding the testing metapacakge to |
@buskamuza I was hoping that this proposal here #157 was going ahead. |
Problem
Tests are dead code on production env.
Solution
Exclude tests from
magento2-module
package and introduce new type of packages with Tests onlyThere is going to be new modules which will have Functional Tests only.
Example:
CatalogAdminUi
- will have Magento Admin UI logic insideCatalogAdminUiFunctionalTest
- will have Automated Test Coverage for Catalog Magento Admin UI moduleRequested Reviewers
@paliarush
@maghamed
@buskamuza
@antonkril