PragmaticFlow / NBomber

Modern and flexible load testing framework for Pull and Push scenarios, designed to test any system regardless a protocol (HTTP/WebSockets/AMQP etc) or a semantic model (Pull/Push).
https://nbomber.com
Other
2.07k stars 131 forks source link

Spectre.Console (0.49.1) compatibility issue #720

Open michaelplavnik opened 2 weeks ago

michaelplavnik commented 2 weeks ago

This issue manifests as exception

2024-08-26 19:13:37.647 -04:00 [ERR] [ThreadId:10] ConsoleReport.print failed
System.Security.VerificationException: Method Spectre.Console.AlignableExtensions.Centered: type argument 'Spectre.Console.Rule' violates the constraint of type parameter 'T'.
   at NBomber.Infra.Console.addHeader(String header)
   at NBomber.DomainServices.Reports.ConsoleReport.ConsoleTestInfo.printTestInfo(TestInfo testInfo)
   at NBomber.DomainServices.Reports.ConsoleReport.print(ILogger logger, NodeSessionResult sessionResult, IDictionary`2 simulations)

My project is using Spectre.Console.Cli 0.49.1 and NBomber 5.7.0.

After brief analysis, it turns out that Spectre.Console has changed interface implemented by Rule class from IAlignable to IHasJustification as of version 0.46.

Most probably this issue in not on priority path, but might be it is time to migrate ? Another consideration, is there a good reason to maintain Serilog.Sinks.SpectreConsole compared to default Serilog colored console?

AntyaDev commented 2 weeks ago

Hi @michaelplavnik Thank you for this callout. We will check regarding upgrading NBomber to the latest SpectreConsole. We use SpectreConsole to render realtime tables. If you know some good alternative that provides such functionality we could consider it.

michaelplavnik commented 1 week ago

Thanks for including into 5.9!

I find Spectre.Console to be a good option for your project. May be instead, you can consider making immediate reporting to console a candidate for plugin design? More than one version of Spectre.Console can be supported then...

AntyaDev commented 1 week ago

May be instead, you can consider making immediate reporting to console a candidate for plugin design?

Can you please elaborate on this?