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:
Download the third-party libraries needed to execute the unit tests contained in the module
Execute all the unit tests present in the module
Remove all the libraries just downloaded
This approach had two main downsides:
There was a significant time overhead for unit test execution of each icingaweb2 module (as well as network overhead) caused by downloading the third-party libraries
Code was duplicated due to the replication of the script php_run_tests.sh in 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 icingaweb2devel 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.
Writing high-performance code is key when tackling complex problems. While it might be tempting to focus on optimizing the programming language itself, the best strategy is often to implement the right algorithm. Let’s take a look at three lesser-known Python Read More
When adopting an open-source software project that you don't own, you may find it necessary to modify it partially to meet your specific requirements. However, as you implement those changes, it's important to recognize that the upstream project will eventually Read More
As the NetEye R&D team, we sometimes need to develop features in NetEye that require a lot of work to finish implementing. To handle the development of these features, we're always trying to divide the work into smaller, more manageable Read More
Over the course of the last few years, we've introduced more and more features in NetEye 4. This fact has had a side effect that's not directly visible to customers, namely that we keep adding more and more tests to Read More
In the last few weeks the NetEye development team and the Alyvix development team have been collaborating to achieve support for Time Periods in Alyvix. In this blog post, we'd like to share some interesting challenges that this feature has Read More