How to test multiple PHP versions with JetBrains TeamCity.

There are a lots tools for Continues Integration on the market. We've tested Jenkins, Hudson and TeamCity. Of course there is also Travis - probably the most often used to testing Open Source codes. In our work we using TeamCity from JetBrains.

But with TeamCity we had some small problems. TeamCity is not very well adapted to work with PHP. There is some meta-runners gives possibility to set some test variables but we need something more. Our policy in work is that our projects should be works today, tomorrow, year or two years after tomorrow.

Support for PHP 5.3 was dropped about 10 months ago (14 Aug 2014). Versions of PHP 5.4 and 5.5 have support until 14 Sep 2015 and 10 Jul 2016. From now it is only one year to death of version 5.5. What choice is for developing software now? Of course it is version PHP 5.6.
But we make step forward and testing our software for upcoming PHP 7 (Release date is planned at October 2015). And with PHP 7 and TeamCity there is some problem. Delivered meta-runners by JetBrains using default php path delivered by PATH. If you using some Ubuntu and PPA's you will get php in /usr/bin directory. PHP 7 delivered by Zend is installed in /usr/local/php7/

So if you want using some binary of PHP 7, you need set system.php.binDir to /usr/local/php7/bin. See some screen below.

Default parameter should be:
default-parameter

And changed parameter:
modified-parameter

Check also our meta-runners GitHub repository.

We also know that method is not the best. But which method is it? In the future we planning testing and doing CI by some containers with Docker.

Do you have some own methods and want share with us? Feel free to contact!

Best regards,
ant.qa Team

Comments