Scrutinizer and specific test from phpunit

谁说我不能喝 提交于 2020-01-25 07:04:35

问题


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>

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

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

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

Thank you very much.


回答1:


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

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



来源:https://stackoverflow.com/questions/50937828/scrutinizer-and-specific-test-from-phpunit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!