The R&D team makes extensive use of PHP unit tests in order to ensure functional correctness in all the icingaweb2 modules integrated into NetEye 4. In fact, for each icingaweb2 module we developed a PHPUnit component that allows us to perform unit tests on all PHP classes and functions present in the module. These PHP unit tests are included in the devel package of the module, which contains all the tests developed for the module.
These kinds of tests are of course part of the continuous automated testing process performed in our continuous integration pipeline.
Until now each icingaweb2 module shipped a dedicated script
php_run_tests.sh for executing all the PHPUnit tests of the module, whose aim was to:
This approach had two main downsides:
php_run_tests.shin each icingaweb2 module
To solve these two issues, we decided to create a new rpm package called php-neteye-devel, which is now a required dependency for each icingaweb2 devel package.
We solved the first issue by shipping within the php-neteye-devel package all the third-party libraries needed for running PHP unit tests. All devel packages for Icingaweb2 modules now have to simply declare a dependency on php-neteye-devel. In this way all the third party libraries needed for PHP unit tests will be pre-installed whenever a devel package for icingaweb2 is installed.
The second issue was solved by generalizing the script that executes the PHP unit tests of a single icingaweb2 module. The devel packages in each icingaweb2 module will now only have to create a symbolic link to the new, generalized script.