8

I write a lot of integration tests for Magento 2. This helps my local development and they fit nicely in a CI way of working.

However, there are some oddities about the integration test suite of Magento. For example:

These issues make it hard for an integration test to be used in a local project. Someone once said to me that the integration tests are only created for extension developers to test if your module passes the criteria to make it to the marketplace. Is this true? Because if so: what's then to a proper way to write integration tests for your clients' webshop? I do like the Magento annotations and stuff. Really frustrating this.

0

I feel you, I have / had the same issues. There is a solution for your first problem: Remove the unwanted modules instead of just disabling them. Add the following to your composer.json:

"replace": {
  "magento/module-admin-notification": "*"
},

if you want to remove the admin notification module for example. It's fully explained in my blog post at https://www.integer-net.com/removing-unused-core-modules-from-magento-2-the-right-way.

Regarding your second point: it's a bug, filed at https://github.com/magento/magento2/issues/12696. I find it really annoying too. There is no good solution for that yet as far as I know, except commenting on the bug report and thus bringing it to attendance of the core developers.

Someone once said to me that the integration tests are only created for extension developers to test if your module passes the criteria to make it to the marketplace. Is this true?

No. It's also really useful on a project base. You just have to take care of the issues you mentioned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.