I am working on magento 2 project. I am using Jenkins as continuous integration tool. How can I use Jenkins for PHP unit testing for Magento 2. I know Magento 2 has inbuilt tool for unit testing. How can I use this inbuilt testing tool with jerkins.
to use the magento testing frameworks you need the magento codebase in your build. So if not in your repository, the first step would be to deploy magento
dev/tests/unit directory you find a
phpunit.xml.dist which is preconfigured to execute the Magento tests.
you need a copy of this file in your repository, but without the
.dist at the end and adjust it so that phpunit will execute your own tests.
so the next step would be to ensure you have the adjusted file at
next, you can execute phpunit from the test directory like this (example shell script):
cd dev/tests/unit && ../../../vendor/bin/phpunit -c phpunit.xml