Infection: Order of keys in `mutators` config array, leads to different results

Created on 2 Nov 2020  路  5Comments  路  Source: infection/infection

| 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.

Bug

Most helpful comment

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

All 5 comments

as for me it sounds like an issue.
Good catch btw :+1:

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

@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.

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sanmai picture sanmai  路  8Comments

sanmai picture sanmai  路  5Comments

sanmai picture sanmai  路  3Comments

maks-rafalko picture maks-rafalko  路  4Comments

eko3alpha picture eko3alpha  路  7Comments