Comments (7)
I don't know if the recent update of the playground has changed something, but my example is no longer passing.
Now, it is detected as uncovered
like it is on my local or my servers.
- https://infection-php.dev/r/5wee with Infection 0.26.13 and PHPUnit 9.5.9
- https://infection-php.dev/r/n7m3 with Infection 0.26.20 and PHPUnit 10.1.2
Maybe the line format normalization is not applied before the analysis but after, which could explain why it is detected as uncovered while it is (same reason that I explained a previous comments here).
I'll try to propose a PR about it.
from infection.
I managed to provide a PR with some unit tests: #1847
If you have tips or suggestions, I'll be pleased to apply them ASAP.
Thanks a lot!
from infection.
It's now killed https://infection-php.dev/r/p3e2
from infection.
Can you make an example using Infection's playground? https://infection-php.dev/
Never mind, saw you last observation. Can you at least share it?
from infection.
I wonder if we could skip mutating PHP Attributes for now.
from infection.
Never mind, saw you last observation. Can you at least share it?
Yes of course. I wrote it few days ago to open an issue here but that's how I discovered the mutant is killed as expected in the playground, and I didn't understood why until I came into PHP Infection's source code and I understood how the coverage is bound to the mutation.
https://infection-php.dev/r/5wee
You'll see on the playground that the attribute is no longer on line 10 of the sources but normalized at line 8, which is why, IMO, it passes on playground. If you can ask for no line normalization on the playground, you should be able to reproduce my example.
from infection.
I wonder if we could skip mutating PHP Attributes for now.
Technically, the ReflectionVisitor
could add a new custom attribute on the PhpParser\Node elements to detect if such node is into a PhpParser\AttributeGroup
(= current node has any ancestor of type PhpParser\AttributeGroup
) and then we could generate no mutation for nodes having such custom attribute.
Functionnally, I'm not a fan of such idea as I really do think that some static value given to arguments of attributes should be tested, and tests should be tested to ensure they are actually testing those values as expected. But regarding the impacts PHP Attributes can have on the good behavior of PHP Infection, maybe that's the wiser decision to take.
from infection.
Related Issues (20)
- All mutants escapes when using `function-mocking` and `patchwork` HOT 10
- GitHub annotations without Actions HOT 2
- --min-covered-msi=100 vs 0 coverage breaks CI integration HOT 6
- When a test appears in multiple suites, Infection errors out HOT 4
- PublicVisibility method issue in Traits that are used in classes with a matching Interface method. HOT 2
- Investigate is it possible to check duplicates of generated mutators (physical and logical) HOT 5
- Infection needs to be adapted for `phpunit.xml` schema change in PHPUnit 10.1 HOT 1
- No GPG Signature for Phive. HOT 2
- Error infection phpunit 10.1 in Schema PHPUNIT. HOT 1
- [False-positive] Mutations on PHP Attributes are not killed HOT 1
- Do not mutate `instanceof` in `assert()` 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
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.