Giter VIP home page Giter VIP logo

Comments (7)

niconoe- avatar niconoe- commented on May 25, 2024 1

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.

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.

niconoe- avatar niconoe- commented on May 25, 2024 1

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.

maks-rafalko avatar maks-rafalko commented on May 25, 2024 1

It's now killed https://infection-php.dev/r/p3e2 👍

from infection.

sanmai avatar sanmai commented on May 25, 2024

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.

sanmai avatar sanmai commented on May 25, 2024

I wonder if we could skip mutating PHP Attributes for now.

from infection.

niconoe- avatar niconoe- commented on May 25, 2024

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.

niconoe- avatar niconoe- commented on May 25, 2024

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)

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.