Comments (7)
Can you run phpunit --coverage-text
for your project and post output here?
from infection.
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.
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.
@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.
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.
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
.
infection/src/Finder/TestFrameworkExecutableFinder.php
Lines 52 to 70 in 47dca3d
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.
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)
- Attributes on parameters of method signature are not detected as part of method signature HOT 7
- Implement real-time reporting for Infection
- Infection can't run custom Test Framework extensions because TestFrameworkTypes is hardcoded
- Allow Infection to run without a pre-existing Test Framework configuration file
- Implement always `true` or always `false` `if` and `elseif` conditions HOT 8
- Error "Expected a value identical to 1. Got: 62" when using PHPUnit 10.2 HOT 10
- Syntax error: infection drops required parentheses HOT 1
- git-diff on tests to trigger corresponding covered source files? HOT 1
- Session Interference Issue with Magento 1.9 on PHP 8.0.29 using Infection 0.26.19 HOT 2
- Infection wrongly claims "continue to break" mutation would be uncovered HOT 17
- Checking fail if config not in root directory (testFramework=codeception)
- Add new GitLab (Code Climate) code quality JSON logger.
- Release tag shows incorrect version HOT 2
- MulEqual with -1 cannot be fixed HOT 3
- Disable PHP Attribute mutations globally via config. HOT 2
- Attribute is removed when `public` is mutated to `protected`
- Compatibility with composer-bin-plugin HOT 3
- Incorrect --filter with PHPUnit 10 HOT 10
- E2E tests fails HOT 5
- Infection reports mutations on impossible to cover parts: PHP Attributes HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infection.