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

Order of keys in mutators config array, leads to different results #1408

Closed
canvural opened this issue Nov 2, 2020 · 5 comments · Fixed by #1410
Closed

Order of keys in mutators config array, leads to different results #1408

canvural opened this issue Nov 2, 2020 · 5 comments · Fixed by #1410
Labels

Comments

@canvural
Copy link
Sponsor

canvural commented Nov 2, 2020

Question Answer
Infection version 0.19.1@46c17a7fdba19ad05bec7b10e006ce2f00d954a1, 0.20.0@735506ce5fc35dd504c9ba147d5fe0554898b232
Test Framework version PHPUnit 9.3
PHP version 7.4 ?
Platform Playground
Github Repo -

Here is playground link which ignores a DecrementInteger mutation in Infected\\SourceClass::add method. Works as expected.

But if the array key order changed and @default": true comes after the ignore rule, it does not work as expected. Can be seen here.

Is this expected? Couldn't find anything in the documentation. And lost 45 minutes to this, trying to figure out why wouldn't it ignore it.

@sidz
Copy link
Member

sidz commented Nov 2, 2020

as for me it sounds like an issue.
Good catch btw 👍

@sanmai
Copy link
Member

sanmai commented Nov 2, 2020

I believe a similar issue #1380 was fixed in 0.20. Can you check that you can reproduce with it?

@canvural
Copy link
Sponsor Author

canvural commented Nov 2, 2020

@sanmai Yes, it also happens with 0.20.0@735506ce5fc35dd504c9ba147d5fe0554898b232

Although you can't see the actual infection log file, I had a failing (cause MSI was too low due to not ignoring) CI job here. Also confirmed locally of course.

@sidz sidz removed the Not Confirmed label Nov 2, 2020
sanmai added a commit that referenced this issue Nov 3, 2020
sanmai added a commit that referenced this issue Nov 3, 2020
* Add test that profile settings override particular mutator setting in case when profile setting is higher than mutator setting in the Infection configuration file

* Fix #1408

* Fix issue where both mutator and profile have settings

Co-authored-by: Oleg Zhulnev <plbsid@gmail.com>
@sanmai
Copy link
Member

sanmai commented Nov 3, 2020

Thank you for the report! There was another similar issue we managed to discover/fix. Should be in a next release.

@canvural
Copy link
Sponsor Author

canvural commented Nov 3, 2020

Thank you @sanmai, @sidz and @maks-rafalko

maks-rafalko pushed a commit that referenced this issue Nov 3, 2020
* Add test that profile settings override particular mutator setting in case when profile setting is higher than mutator setting in the Infection configuration file

* Fix #1408

* Fix issue where both mutator and profile have settings

Co-authored-by: Oleg Zhulnev <plbsid@gmail.com>
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.

3 participants