I'm trying to use Jenkins with Ant in my PHP application (Symfony2) but can't get my tests execute. I can see in Jenkins 'console output' screen that the correct configuration file is being read, but it shows that no tests are executed.
When I run the Ant build.xml file in the cli from my project's root directory, the build is successful and my tests execute and pass.
If I cd into the /Users/Shared/Jenkins/{...}/workspace directory and run 'sudo ant', it says no tests executed! which is baffling as the exact same build.xml file executes the tests when run from my project root directory.
The relevant portion of my buil.xml file is:
<target name="phpunit" description="Run unit tests with PHPUnit">
<exec executable="phpunit" failonerror="true">
<arg value="-c" />
<arg path="${workspace}/app/phpunit.xml.dist" />
</exec>
</target>
app/phpunit.xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
backupGlobals = "false"
backupStaticAttributes = "false"
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "false"
syntaxCheck = "false"
bootstrap = "bootstrap.php.cache" >
<testsuites>
<testsuite name="Project Test Suite">
<directory>../src/*/*Bundle/Tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>../src</directory>
<exclude>
<directory>../src/*/*Bundle/Resources</directory>
<directory>../src/*/*Bundle/Tests</directory>
<directory>../src/*/Bundle/*Bundle/Resources</directory>
<directory>../src/*/Bundle/*Bundle/Tests</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="build/coverage" title="GMS" charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>
</phpunit>
I have the Jenkins Clover, Jenkins Clover PHP and xUnit plugins installed.
The relevant portion of the console output from Jenkins is:
phpunit:
[exec] PHPUnit 3.7.24 by Sebastian Bergmann.
[exec]
[exec] Configuration read from /Users/Shared/Jenkins/Home/jobs/GMS/workspace/app/phpunit.xml.dist
[exec]
[exec]
[exec]
[exec] Time: 181 ms, Memory: 2.50Mb
[exec]
[exec] [30;43m[2KNo tests executed!
[exec] [0m[2K
[exec] Generating code coverage report in Clover XML format ... done
[exec]
[exec] Generating code coverage report in HTML format ... done