-
Notifications
You must be signed in to change notification settings - Fork 175
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
Exclude folder path from mutation in stryker-config #2795
Comments
Did you try the mutate option? |
I excluded the methods using "ignore-methods" but the strings and boolean values are being highlighted for mutation, categorized under No Coverage I have about 100+ mutants being highlighted from just that file. |
Ignore methods is not the same as mutate. Try the mutate option. https://stryker-mutator.io/docs/stryker-net/configuration/#mutate-glob |
I am not familiar with EF inner workings, but Stryker normally does not mutate generated code. |
It doesn't but instead of ignoring the contents, it categorizes it as mutants that are not covered. Not Covered mutants fall are regarded as survived mutants, so still affecting the mutation score I noticed it ignored 2 other files in the same directory though; EF Core generates 3 files when a migration is initialized. |
Iirc ef doesn't consider it generated code because you should always manually check and modify migrations, so they refuse to place the generated code attribute. |
It should be marked as ignored when excluding using the mutate option. Could you share your full configuration or your debug log file? Are you using since or baseline? |
Well, yeah I understand but there are still a lot of hard coded values that could be mutated. |
This is the configuration I have used so far: |
@gentcod The option you are using won't work in this case. See: https://stryker-mutator.io/docs/stryker-net/ignore-mutations/ for an extensive guide on how to ignore mutations. |
@richardwerkman oh I get but in cases where there are strings in other test suites, that implies that they would be overlooked unless there is a way for me to ignore specific strings. If there is, please do let me know, thank you. |
I read the documentation and saw |
Could you link to these docs? |
I am trying to exclude DB migrations from mutation.
The code for the DB migrations is auto generated by Entity Framework Core and it makes no sense to include them in the mutation as there are a lot of hard coded string values. It gets the mutants that are not covered.
This is a sample of code generated that needs to be excluded:
migrationBuilder.CreateTable( name: "RecipeRatings", columns: table => new { Id = table.Column<int>(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), RecipeId = table.Column<int>(type: "INTEGER", nullable: false), RatingNum = table.Column<int>(type: "INTEGER", nullable: false), Comment = table.Column<string>(type: "TEXT", nullable: true) },
The text was updated successfully, but these errors were encountered: