感染抛出异常,但为什么,以及如何处理它?

Infection Throws Exeption, but why, and how to handle it?

任务是错误确实正确地解释了那个问题。

错误:

Project tests must be in a passing state before running Infection.
Infection runs the test suite in a RANDOM order. Make sure your tests do not have hidden dependencies.

You can add these attributes to phpunit.xml to check it:

If you don't want to let Infection run tests in a random order, set the executionOrder to some value, for example

Check the executed command to identify the problem: '/usr/bin/php7.2' '-d' 'zend_extension=xdebug.so' '/mnt/e/dev/bin/phpunit' '--configuration' '/mnt/e/dev/var/infection/
infection/phpunitConfiguration.initial.infection.xml' '-vvv'
PHPUnit reported an exit code of 143.
Refer to the PHPUnit's output below:
STDERR:

无法加载 Xdebug - 它已经加载

我尝试执行以下语句很简单:

vendor/bin/infection --threads=10 --only-covered

但是当我尝试在那个错误中解释的那个语句时,测试将 运行 成功,但这只是我没有突变测试的单元测试。

这是我的 phpunit.xml.dist

中 phpunit 标签的摘要
<phpunit .... backupGlobals="false" colors="false" bootstrap="/mnt/e/dev/RESTler/config/bootstrap.php" executionOrder="random" resolveDependencies="true" cacheResult="false" stopOnFailure="true" stderr="false" .../>

版本是:

有没有人提示我可以尝试什么或我的错误在哪里?

经过漫长的旅程,我发现了一些东西。 但是不知道为什么它不能与我的配置一起工作。

在我从 php.ini

中删除 xdebug.so 之后,这对我来说是正确的说法
infection --threads=10 --only-covered --initial-tests-php-options='-d zend_extension=xdebug.so'

我以为这样就够了,但后来 memory_limit 问题来了,那个凸轮是用同样的方法固定的

infection --threads=10 --only-covered --initial-tests-php-options='-d zend_extension=xdebug.so -d memory_limit=-1'

现在它运行了,我有一些待办事项:)

.: killed, M: escaped, S: uncovered, E: fatal error, T: timed out

.........M..MMMMMMM.M.M.MMM.MMMM.M.MMMMMMMM.MMMM.M (50 / 89) .....MM................MMMMMMM.MMMM.... (89 / 89)

89 mutations were generated:

  45 mutants were killed

   0 mutants were not covered by tests

  44 covered mutants were not detected

   0 errors were encountered

   0 time outs were encountered

Metrics:

   Mutation Score Indicator (MSI): 50%
   Mutation Code Coverage: 100%
   Covered Code MSI: 50%

如果有人使用 phpdbg 而不是 xdebug 并且有 memory_limit 问题,对我来说,如果我在我的 phpdbg 中覆盖了新的 php.ini /etc/php/7.3/phpdbg/php.ini

我希望这里的post能再次帮助到其他人。我先不删除它。也许有一天 mod.