Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running the Infection cannot detect code coverage driver correctly #1700

Closed
peter279k opened this issue Jun 21, 2022 · 0 comments · Fixed by #1701 or #1703
Closed

Running the Infection cannot detect code coverage driver correctly #1700

peter279k opened this issue Jun 21, 2022 · 0 comments · Fixed by #1701 or #1703
Labels

Comments

@peter279k
Copy link
Contributor

peter279k commented Jun 21, 2022

Question Answer
Infection version 0.26.11
Test Framework version PHPUnit 9.5.21
PHP version 8.0.20 (php -v)
Platform Ubuntu 18.04
Github Repo https://github.com/peter279k/php-gender

When enabling the XDebug extension to run the ./vendor/bin/infection, it will get the following error message:

The code coverage generated by the initial test run is invalid. Please report the issue on the                                                          
  infection repository "https://github.com/infection/infection".               
                                                                               
                                                                 
  $ '/data/php-gender/vendor/bin/phpunit' '--configuration' '/tmp/infection/p  
  hpunitConfiguration.initial.infection.xml' '--coverage-xml=/tmp/infection/c  
  overage-xml' '--log-junit=/tmp/infection/junit.xml'                          
  PHPUnit 9.5.21 #StandWithUkraine                                             
                                                                               
  Random Seed:   1655794267                                                    
  Warning:       XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set    
                                                                               
  .                                                                   1 / 1 (  
  100%)                                                                        
                                                                               
  Time: 00:00.006, Memory: 8.00 MB                                             
                                                                               
  OK (1 test, 3 assertions)                                                    
                                                                                                                                             
                                                                               
  Issue(s):                                                                    
  - The file "index.xml" could not be found: Could not find any "index.xml" file in "/tmp/infection"                                                      

  • If adding the XDEBUG_MODE=coverage to declare the environment variable, it will not get above error message.
    • As this comment says, it's not necessary to do that. It seems to be a bug.
peter279k added a commit to peter279k/infection that referenced this issue Jun 21, 2022
peter279k added a commit to peter279k/infection that referenced this issue Jun 21, 2022
maks-rafalko pushed a commit that referenced this issue Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants