atoum is a popular PHP test framework. TeamCity is a Continuous Integration and Continuous Delivery software developed by Jetbrains. Despites atoum supports many industry standards to report test execution verdicts, TeamCity uses its own non-standard report, and thus atoum is not compatible with TeamCity… until now.
atoum/teamcity-extension provides TeamCity support inside atoum. When executing tests, the reported verdicts are understandable by TeamCity, and activate all its UI features.
If you have Composer, just run:
$ composer require atoum/teamcity-extension '~1.0'
From this point, you need to enable the extension in your
.atoum.php configuration file. The following example forces to enable the extension for every test execution:
$extension = new atoum\teamcity\extension($script); $extension->addToRunner($runner);
The following example enables the extension only within a TeamCity environment:
$extension = new atoum\teamcity\extension($script); $extension->addToRunnerWithinTeamCityEnvironment($runner);
This latter installation is recommended. That’s it 🙂.
The default CLI report looks like this:
The TeamCity report looks like this in your terminal (note the
TEAMCITY_VERSION variable as a way to emulate a TeamCity environment):
Which is less easy to read. However, when it comes into TeamCity UI, we will have the following result:
We are using it at Automattic. Hope it is useful for someone else!
If you find any bugs, or would like any other features, please use Github at the following repository: https://github.com/Hywan/atoum-teamcity-extension/.