【问题标题】:Permissions error with "//proc/tty/driver" in PHPUnit and Jenkins?PHPUnit和Jenkins中的“//proc/tty/driver”权限错误?
【发布时间】:2016-01-05 07:05:56
【问题描述】:

我正在尝试在运行 Ubuntu 14.04 的 Jenkins 上运行构建。我的 PHPUnit 因以下错误消息而崩溃,但似乎没有太多关于此错误的信息。我的 xdebug 似乎加载正确。我正在运行 PHPUnit v4.8.10。

当我尝试直接通过命令行运行phpunit 时,它只是挂起并且不会返回。我错过了什么?

 phpunit: 
 [phpunit] PHP Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(//proc/tty/driver): failed to open dir: Permission denied' in /var/lib/jenkins/jobs/Some other job/workspace/vendor/phpunit/php-file-iterator/src/Factory.php:66
 [phpunit] Stack trace:
 [phpunit] #0 [internal function]: RecursiveDirectoryIterator->__construct('//proc/tty/driv...', 512)
 [phpunit] #1 [internal function]: RecursiveDirectoryIterator->getChildren()
 [phpunit] #2 [internal function]: FilterIterator->rewind()
 [phpunit] #3 /var/lib/jenkins/jobs/Some other job/workspace/vendor/phpunit/php-file-iterator/src/Factory.php(66): AppendIterator->append(Object(File_Iterator))
 [phpunit] #4 /var/lib/jenkins/jobs/Some other job/workspace/vendor/phpunit/php-file-iterator/src/Facade.php(38): File_Iterator_Factory->getFileIterator(Array, '.php', '', Array)
 [phpunit] #5 /var/lib/jenkins/jobs/Some other job/workspace/vendor/phpunit/php-code-coverage/src/CodeCoverage/Filter.php(112): File_Iterator_Facade->getFilesAsArray('/', '.php', '')
 [phpunit] #6 /var/lib/jenkins/jobs/Some other job/workspace/vend in /var/lib/jenkins/jobs/Some other job/workspace/vendor/phpunit/php-file-iterator/src/Factory.php on line 66

 BUILD FAILED
 /var/lib/jenkins/jobs/Some other job/workspace/build.xml:169: exec returned: 255

PHP 信息:

 PHP 5.5.9-1ubuntu4.13 (cli) (built: Sep 29 2015 15:24:49)
 Copyright (c) 1997-2014 The PHP Group
 Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

【问题讨论】:

    标签: php testing jenkins phpunit xdebug


    【解决方案1】:

    问题在于我在phpunit.xml 中的白名单。正如您在<directory> 标签中看到的那样,我告诉我的代码覆盖率从服务器的根目录开始!这就是它最终如何通过我的插座查看并在不应该出现的地方被抓住的原因。

    要解决此问题,请将下面的 <directory suffix=".php">/</directory> 更改为 <directory suffix=".php">./</directory>,这样代码覆盖率只会查看您的项目目录。

    旧过滤器:

    <filter>
        <whitelist addUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">/</directory>
            <exclude>
                <file>bootstrap/autoload.php</file>
            </exclude>
        </whitelist>
    </filter>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-19
      • 2023-03-06
      • 2014-07-07
      • 1970-01-01
      • 2014-12-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-29
      相关资源
      最近更新 更多