Exclude code files that generate error messages? #2017
-
I'm using stryker.net 1.5.2. on an .Net Core solution that includes several projects. On one of the projects-under-test stryker generates errors: I tried to exclude the file by using a flag: I did a little test on another project that stryker runs fine on without errors and excluded a file in a similar manner; the result from that project now had an expected N/A for the file; but also "Ignored" value was a number, not zero; does this imply mutations are still generated, just that tests are not run against them? So the question is, if I'm gathering correctly, that using -m is not a way to get around above mentioned kind of errors? Am I missing another way to exclude some parts of code from begin mutated? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The short answer is that, yes, you understand this correctly: mutations are still generated but ignored. As of now, there is no way to completely exclude file (or part of a file) from being mutated. One can only request Stryker to ignore some mutations (see documentation). Regarding the error you are reporting, I would like to stress out this is a warning because Stryker faced an error for which it could not identify which mutation was the cause. Therefore, it needs to removes all mutation from the concerned method. |
Beta Was this translation helpful? Give feedback.
The short answer is that, yes, you understand this correctly: mutations are still generated but ignored.
As of now, there is no way to completely exclude file (or part of a file) from being mutated. One can only request Stryker to ignore some mutations (see documentation).
This is on purpose as it still tracks generated mutations, allowing one to decide to stop ignoring them, and we estimate there is no benefit in actually exclude files from being mutated.
Regarding the error you are reporting, I would like to stress out this is a warning because Stryker faced an error for which it could not identify which mutation was the cause. Therefore, it needs to removes all mutation from the concer…