2013-08-16 1 views
2

PHP 응용 프로그램 (Symfony2)에서 Jenkins를 Ant와 함께 사용하려고하지만 테스트를 실행할 수 없습니다. Jenkins 'console output'화면에서 올바른 구성 파일을 읽을 수 있지만 테스트가 실행되지 않았 음을 알 수 있습니다.Jenkins (Ant 사용)가 PHPUnit 테스트를 수행하지 않음

내 프로젝트의 루트 디렉토리에서 cli로 Ant build.xml 파일을 실행하면 빌드가 성공하고 테스트가 실행되어 통과합니다.

/Users/Shared/Jenkins/{...}/workspace 디렉토리에 들어가서 'sudo ant'를 실행하면 테스트가 실행되지 않는다고 표시됩니다! 이는 정확히 동일한 build.xml 파일이 프로젝트 루트 디렉토리에서 실행될 때 테스트를 실행하기 때문에 당황 스럽다.

내 buil.xml 파일의 관련 부분입니다 : 내가 설치 한 젠킨스 클로버, 젠킨스 클로버 PHP와 xUnit의 플러그인이

<?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> 

:

<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> 

응용 프로그램/phpunit.xml처럼 보이는 .

젠킨스에서 콘솔 출력의 관련 부분은 다음과 같습니다 당신이 테스트를 위탁하는 경우

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 

답변

9

그것은 도움이됩니다. 너 바보 야.

관련 문제