-
Notifications
You must be signed in to change notification settings - Fork 188
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
Stryker disable comment not working for global statements #3073
Comments
hi
|
Hi, thanks for your quick reaction!
{
"stryker-config": {
"report-file-name": "WebApi.html",
"project": "WebApi.csproj",
"test-projects": [
"../WebApiTests/WebApiTests.csproj",
"../WebApiRoutesTests/WebApiRoutesTests.csproj"
],
"thresholds": {
"break": 77
},
"mutation-level": "Complete",
"additional-timeout": 30000
}
} |
I should maybe also mention that the <PropertyGroup Condition="$(Configuration.Equals('Debug'))">
<DefineConstants>SWAGGER_MODULE;SERILOG_SINK_SEQ_MODULE</DefineConstants>
</PropertyGroup> |
Thanks. Any occurrence where you use PS: yes, it does not appear you use any form of diff mutation testing, so no lead there. It does look like an issue with preprocessor command and I cannot see how it could have an impact, but it looks like it does. |
Many thanks, this helps me. |
Hummm You could introduce an empty statement (´;´) between the directive and the comment. |
Still unable to reproduce it, but at least, I know that Stryker tends to mess with #endif directives |
I will add the extra semicolon, run it over night, and report back. |
Since I cannot reproduce it, no promises there. |
Well. They are still there. No idea why they appear in timeout. Interestingly, the first statement which was ignored in the original code is now mutated (and in timeout). As if |
If there is any other info I can provide, please let me know. |
Well. I was about to abandon all hopes, but I got a bunch of weird results doing integrated tests (vs unit): some mutators are disabled but not others. So there is something fishy here and I have a reproducing project. So, I can work now |
Wow, thanks for the heroic stamina! |
I have to revert my previous findings: I was so focused on the problem that I failed to notice there was another Stryker comment involved in my test. Long story short: everything works as documented in my test project. So I still have no idea on why this happens and/or how to replicate it. |
I am afraid the log will not be able to help me, and I definitely need your help to move forward. Finally, you can also try and debug Stryker locally and see what happens. I can give you pointers where to look and hook 😄 |
I've just looked through the offending file ("Program.cs"). While the whole API is a commercial product, I can easily defend sharing the "Program.cs" with you, if you provide me with an upload pointer. Be warned though that the "Program.cs", being the "composition root" in the sense of dependency injection, is full of dependencies that I cannot provide. |
Thanks. I think the best way is for you to go to the project slack: https://stryker-mutator.slack.com/join/shared_invite/enQtOTUyMTYyNTg1NDQ0LTU4ODNmZDlmN2I3MmEyMTVhYjZlYmJkOThlNTY3NTM1M2QxYmM5YTM3ODQxYmJjY2YyYzllM2RkMmM1NjNjZjM#/shared-invite/email And DM me there with the file. You can also email to me (I think my email is publicly displayed here) |
Thanks, I just DMed you the file. |
Thanks for your help. I am now able to reproduce the issue. This is a problem with top level statements. It turns out we have no test for these (unit or otherwise). I am looking into how to fix this. I suppose you consider this problem as a minor until we provide a fix, but if you want to have a workaround, you can either use the legacy construct for the main method. If you can't or it does not suit you, you can use Ultimately, you can also use multiple Sorry for the inconvenience and thank you for bearing with me with this. |
#if
I just opened PR #3087 that will fix that. |
This problem is indeed a minor to me. Thanks for your effort! Should I close this issue? |
Describe the bug
I have a .NET 8 Web API whose "Program.cs" contains the code below.
The variable
SWAGGER_MODULE
is set when the project compiles with the "DEBUG" configuration, and not set when it compiles with the "RELEASE" configuration. Eitherway, note how the// Stryker disable all
is outside of the#if
. Still, the code gets mutated. (This is also the case if I move the// Stryker disable all
inside the#if
.)Why does
// Strykler disable all
not work?Logs
Stryker takes several hours on this very big project. I can run it over night and deliver the logs if really required.
Expected behavior
I expect that the code between
// Stryker disable all
and// Stryker restore all
is not mutated.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: