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

dotnet-stryker is distributed in DEBUG mode #2603

Open rouke-broersma opened 12 months ago

rouke-broersma commented 12 months ago

Describe the bug We publish the nuget package with a DEBUG build instead of RELEASE. This causes some fatal exceptions to not be caught.

Expected behavior We should pack the release artifact using the RELEASE profile

Additional context https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/dotnet-pack-config#new-behavior

0xced commented 12 months ago

With GitHub actions I'm setting the Configuration environment variable to Release to make sure that all (build, test, pack) commands are performed with the release configuration:

https://github.com/serilog-contrib/serilog-formatting-log4net/blob/70cee806736f99604d36c4470fed798b842c346f/.github/workflows/continuous-integration.yml#L6-L7

(I'm also setting ContinuousIntegrationBuild to true)

This works because MSBuild reads environment variables as MSBuild properties.

I guess setting environment variables should be straightforward with Azure Pipelines too.