检查器和来自phpunit的特定测试 [英] Scrutinizer and specific test from phpunit

查看:94
本文介绍了检查器和来自phpunit的特定测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个phpunit.xml文件:

I have this phpunit.xml file:

<phpunit>
  <testsuites>
    <testsuite name="domoticz-api">
      <directory suffix="Test.php">tests</directory>
    </testsuite>
    <testsuite name="scrutinizer">
        <file>tests/Domoticzapi4Scrutinizer/ClientTest.php</file>
    </testsuite>
  </testsuites>
</phpunit>

遵循此答案:如何运行特定的phpunit xml测试包? 在我的服务器上,我可以这样做:

Following this answer: How to run a specific phpunit xml testsuite? In my server I can do:

./vendor/bin/phpunit --configuration phpunit.xml --testsuite scrutinizer

执行测试.其他测试(主要测试)由于多种原因而被排除在审查员之外.

to perform test. Other test (main test) for several reason I want to exclude from scrutinizer.

所以,在检查器的配置文件中,我有:

So, in config file of scrutinizer I have:

build:
    nodes:
        analysis:
            project_setup:
                override:
                    - 'true'
            tests:
                override:
                    - php-scrutinizer-run
                    - command: 'php ./vendor/bin/phpunit --configuration phpunit.xml --testsuite scrutinizer'

        tests: true

coding_style:
    php:
        indentation:
            general:
                use_tabs: true

但是不幸的是,审查员试图执行第一组失败的测试(domoticz-api).

But unfortunately Scrutinizer try and want execute first group of test (domoticz-api) that fails.

我也尝试了不带单引号的情况,配置已通过验证,但Scrutinizer执行了第一组.

I did try also without the single quote, configuration is validated but Scrutinizer perform first group.

非常感谢您.

推荐答案

我正在为某人发布分析器...

I'm posting the anser for some one...

经过几次尝试和错误后,我得到了解决方案:

After some try and error, I got the solution:

build:
    nodes:
        analysis:
            project_setup:
                override:
                    - 'true'
            tests:
                override:
                    - php ./vendor/bin/phpunit --configuration phpunit.xml --testsuite scrutinizer

coding_style:
    php:
        indentation:
            general:
                use_tabs: true

一个简单的命令覆盖并删除"test:true".不知道是否还会消除报价影响.

One simply command in override and remove the "test: true". Don't know if also removing the quote impacts.

这篇关于检查器和来自phpunit的特定测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆