stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.75k stars 176 forks source link

Project not building with Stryker #2345

Closed AshleighAdams closed 2 days ago

AshleighAdams commented 1 year ago

Describe the bug When running locally, Stryker builds and tests things fine (Windows), but on GitHub Actions, a compile error is generated. In particular, it looks to be related with a standard2.0 compatibility library for adding nullable annotations (https://github.com/manuelroemer/Nullable)

Logs

[21:32:08 WRN] Stryker.NET encountered an compile error in /home/runner/work/Verlite/Verlite/src/Verlite.Core/SemVer.cs (at 80:45) with message: The type or namespace name 'NotNullWhenAttribute' could not be found (are you missing a using directive or an assembly reference?) (Source code: NotNullWhen)

Stryker log is attached.

Expected behavior Mutation testing to complete sucessfully as it does when running locally on my Windows machine.

Desktop (please complete the following information):

Additional context The exact project setup can be found here: https://github.com/AshleighAdams/Verlite/actions/runs/3596938533/jobs/6058181386

Additionally, this bug looks to be related: https://github.com/manuelroemer/Nullable/issues/24 StrykerOutput.zip

rouke-broersma commented 1 year ago

Linked issues seem to suggest this is related to ContentFiles, and is fixed in a newer version of Nullable. Do you have this issue with the latest version?

AshleighAdams commented 1 year ago

Yeah, I did encounter that bug in my other CI/CD parts, and updating did fix those parts.

rouke-broersma commented 1 year ago

So this problem is fixed?

AshleighAdams commented 1 year ago

Nope, sorry, I was experiencing the linked bug where it wasn't building until I updated to the fixed version. The fixed version that now otherwise builds fails with Stryker.

rouke-broersma commented 1 year ago

We probably don't search ContentFiles for source code.

Liam-Rougoor commented 1 year ago

@AshleighAdams I've been looking into it a little, it seems that if you run the action on Windows instead of Linux, this error/issue does not occur (just like how it works on your local Windows machine). I have not yet found the cause of this issue, but this could be a temporary workaround for you.

AshleighAdams commented 1 year ago

Thanks, that workaround works for me :)

FrediKats commented 2 months ago

Faced with the same problem. CI doesn't work on Ubuntu and works on Windows. PR with confirm attached.

rouke-broersma commented 2 days ago

ContentFiles should now be supported