2017-05-28 18 views
3

ネットワーク上のいくつかのソースでIchがチェックされていますが、ここでもスタックオーバーフローが発生していますが、これまで解決できませんでした。相続人PHPUnitコードカバレッジが機能しないと常に不正なホワイトリストの設定が表示される

私の設定:

<?xml version="1.0" encoding="UTF-8"?> 

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html --> 
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.0/phpunit.xsd" 
    backupGlobals="false" 
    colors="true" 
    bootstrap="../../src/test.bootstrap.php" 
    convertErrorsToExceptions="true" 
    convertNoticesToExceptions="true" 
    convertWarningsToExceptions="true" 
    processIsolation="false" 
    stopOnError="false" 
    stopOnFailure="false" 
    stopOnIncomplete="false" 
    stopOnSkipped="false" 
    stopOnRisky="false" 
    verbose="true" 
> 
<!--printerFile="vendor/whatthejeff/emoji-phpunit-resultprinter/src/Emoji/PHPUnit/ResultPrinter.php"--> 
<!--printerClass="Emoji\PHPUnit\ResultPrinter"--> 
<php> 
    <ini name="error_reporting" value="-1" /> 
    <server name="KERNEL_DIR" value="src/" /> 
    <env name="BOOTSTRAP_CLEAR_CACHE_ENV" value="testing"/> 
</php> 

<loggin> 
    <log type="coverage-html" target="build/coverage"/> 
    <log type="coverage-clover" target="build/logs/clover.xml"/> 
    <log type="coverage-crap4j" target="build/logs/crap4j.xml"/> 
    <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/> 
</loggin> 

<testsuites> 
    <testsuite name="Project Test Suite"> 
     <directory>src/*/*Bundle/Tests</directory> 
     <directory>src/*/Bundle/*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> 
</phpunit> 

ため、私は次のコマンドではPHPUnitを呼び出す必要がビルド・サーバーの制限:

./build/bin/phpunit.phar -c build/config/phpunit.xml --coverage-clover build/logs/clover.xml --coverage-crap4j build/logs/crap4j.xml --coverage-html build/coverage --coverage-xml build/logs/coverage.xml --log-junit build/logs/junit.xml --testdox-html build/testdox/testdox.html --testdox-xml build/logs/testdox.xml src/ -v 

すべてはHERESに結果出力コードカバレッジを除いて動作します。

PHPUnit 6.1.4 by Sebastian Bergmann and contributors. 

    Runtime:  PHP 7.1.5-1+0~20170522123046.25+jessie~1.gbpb8686b with Xdebug 2.6.0-dev 
    Configuration: /home/testcase/build-directories/build/config/phpunit.xml 
    Error:   Incorrect whitelist config, no code coverage will be generated. 

    ..................            18/18 (100%) 

    Time: 945 ms, Memory: 6.00MB 

    OK (18 tests, 68 assertions) 

単体テスト自体が機能しているので少し気になります。レッズ・サーバーはまだ完全に構成されていないため、レッズ・メッセージは無視できます(希望)。

私は私にエラーが

+0

phpはバージョン7.1.5にあります –

答えて

3

は、あなたがこれををphpunitにホワイトリストdeirectoryを変更しようとする私の構成である手がかりを与えてくださいああ、ユニット6.1.4

を使用しています:

<whitelist> 
    <directory suffix=".php">./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> 
+0

私はちょうどそれを修正して、やはり同じ結果を試しました。ホワイトリストの設定が正しくないと、コードカバレッジが生成されません。私は間違いをしない。 –

+0

投稿した設定で正確に挿入しました。 –

+0

okディレクトリノードに接尾辞を追加して回答を更新しました。今すぐ試してください。@ChrisWest –

0

filter/whitelist/directory XMLノードで指定されたディレクトリは、phpunit構成ファイルを含むディレクトリからの相対パスです。

../../srcとお考えください。

関連する問題