Giter Site home page Giter Site logo

Comments (7)

corpsee avatar corpsee commented on May 19, 2024

Can you run phpunit --coverage-text for your project and post output here?

from infection.

3DFace avatar 3DFace commented on May 19, 2024

Sure, here it is:

D:\Projects\php\generic-storage>phpunit --coverage-text
PHPUnit 6.4-ga1b5663 by Sebastian Bergmann and contributors.

...............................................................  63 / 134 ( 47%)
............................................................... 126 / 134 ( 94%)
........                                                        134 / 134 (100%)

Time: 6.03 seconds, Memory: 10.00MB

OK (134 tests, 232 assertions)

Code Coverage Report:       
  2017-08-30 14:28:41       
                            
 Summary:                   
  Classes: 100.00% (9/9)    
  Methods: 100.00% (76/76)  
  Lines:   100.00% (490/490)

\dface\GenericStorage\Memory::MemoryManyToMany
  Methods: 100.00% ( 6/ 6)   Lines: 100.00% ( 16/ 16)
\dface\GenericStorage\Memory::MemoryOrderDefComparator
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 13/ 13)
\dface\GenericStorage\Memory::MemorySet
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% (  8/  8)
\dface\GenericStorage\Memory::MemoryStorage
  Methods: 100.00% (10/10)   Lines: 100.00% ( 42/ 42)
\dface\GenericStorage\Mysql::MyManyToMany
  Methods: 100.00% (10/10)   Lines: 100.00% ( 67/ 67)
\dface\GenericStorage\Mysql::MySet
  Methods: 100.00% ( 6/ 6)   Lines: 100.00% ( 41/ 41)
\dface\GenericStorage\Mysql::MyStorage
  Methods: 100.00% (27/27)   Lines: 100.00% (263/263)
\dface\GenericStorage\Mysql::MyStorageBuilder
  Methods: 100.00% (10/10)   Lines: 100.00% ( 32/ 32)
\dface\GenericStorage\Mysql::MyUniqueConstraintViolation
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  4/  4)

from infection.

maks-rafalko avatar maks-rafalko commented on May 19, 2024

I tried to run Infection for your project (https://github.com/3DFace/generic-storage, commit 3DFace/generic-storage@6ad7556) with disabled MySQL-related tests, and it works (I'm using MacOS, not Windows).

Also, noticed that phpunit.xml has been changed since your last message, so I'm not sure I've tested the same code as you.

Could you please try to run infection on the same commit on windows and unix and post results here?

from infection.

3DFace avatar 3DFace commented on May 19, 2024

@borNfreee Thank you for investigation!

Just tried it on Unix and it seems to be working.

I have tested both - HEAD and commit referenced by you. Result is the same - it works on Unix but not on Windows (errors from first message).

Not sure if unix output matters... here it is:

Running initial test suite...                                                    
                                                                                 
  147 [============================] 4 secs                                      
                                                                                 
Generate mutants...                                                              
                                                                                 
Processing source code files: 14/14                                              
Creating mutated files and processes: 225/225                                    
.: killed, M: escaped, S: uncovered, E: fatal error, T: timed out                
                                                                                 
SS...M...M..MM.M.M..M.M.M.M..M.......S.MM.SMM..MM.   ( 50 / 225)                 
....MM.MMMMTT..MMTTMMTTM..M..T.M..T.M...M........M   (100 / 225)                 
M.T.....M.........M..T.....M.....S..M..M..M..M....   (150 / 225)                 
.......SSSSM.M...M..M.M.M.........S.M.SSS.........   (200 / 225)                 
......SSSSSSSSSSSSSSSSSSS                            (225 / 225)                 
                                                                                 
225 mutations were generated:                                                    
     135 mutants were killed                                                     
      32 mutants were not covered by tests                                       
      48 covered mutants were not detected                                       
      10 time outs were encountered                                              
                                                                                 
Metrics:                                                                         
         Mutation Score Indicator (MSI): 64%                                     
         Mutation Code Coverage: 86%                                             
         Covered Code MSI: 75%                                                   
                                                                                 
Please note that some mutants will inevitably be harmless (i.e. false positives).

from infection.

3DFace avatar 3DFace commented on May 19, 2024

To my shame, I found old (3.x) phpunit.phar on my PATH :(

After removing it infection told me Unable to locate a phpunit executable on local system. Ensure that phpunit is installed and available. Although I have phpunit as dev-dependency in my project, and have installed it by composer global require. Phpunit from root of my project works correctly.

After downloading phpunit.phar and putting it on my PATH all seems working now.

Should it work when phpunit is project dev-dependency or installed as composer global require?

from infection.

maks-rafalko avatar maks-rafalko commented on May 19, 2024

Should it work when phpunit is project dev-dependency

yes, it should and it works. Please see the following code where vendor bin folder is added to PATH.

private function addVendorFolderToPath()
{
$vendorPath = null;
try {
$composer = $this->findComposer();
$process = new Process(sprintf('%s %s', $composer, 'config bin-dir'));
$process->run();
$vendorPath = trim($process->getOutput());
} catch (\RuntimeException $e) {
$candidate = getcwd() . '/vendor/bin';
if (file_exists($candidate)) {
$vendorPath = $candidate;
}
}
if (!is_null($vendorPath)) {
putenv('PATH=' . $vendorPath . PATH_SEPARATOR . getenv('PATH'));
}
}

or installed as composer global require

If your composer global bin dir is already in PATH, it should work out of the box. But infection does not search this folder itself.

E.g. I've added global composer bin dir to path on my machine:

echo $PATH # outputs "...;/Users/user/.composer/vendor/bin;..."

I'm closing this issue since there is no bug :)

Please feel free to open a separate one about any issues with executable finder.

from infection.

3DFace avatar 3DFace commented on May 19, 2024

Indeed it was again due to my weak environment.

My composer.bat was written by hand and it was lacked a line @echo OFF. This led to pollution of composer config bin-dir output by command itself.

Sorry for wasting your time and thank you for help!

from infection.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.