fedarovich / isle

ISLE (Interpolated String Logging Extensions) is a library that allows developers to perform structured logging using interpolated strings in C# 10 or later.
MIT License
45 stars 1 forks source link

Allow parallel integration tests #7

Open cremor opened 1 year ago

cremor commented 1 year ago

This issue is very similar to #3 As explained there, you have to call IsleConfiguration.Reset() to get ASP.NET Core integration tests with ISLE to work. But this only helps as long as you execute all integration tests sequentially. If you want to execute them in parallel then you'll again get "Isle has already been configured" exceptions because multiple IsleConfiguration.Configure calls may happen between the IsleConfiguration.Reset() calls.

Please make it possible to run parallel ASP.NET Core integration tests with ISLE.

bbartels commented 9 months ago

I'm running into the same issue. Using this very dirty workaround

if (Environment.GetEnvironmentVariable("APPLICATION_INTEGRATION_TEST") is not "true") 
    IsleConfiguration.Configure(_ => {});
bbartels commented 9 months ago

On further thought, I just ended up calling it from a static constructor. Should work in both normal application runtime and in integration test scenarios