microsoft / xunit-performance

Provides extensions over xUnit to author performance tests.
MIT License
188 stars 55 forks source link

XunitPerformanceHarness prints unwanted Console output #260

Closed noahfalk closed 3 years ago

noahfalk commented 6 years ago

Issue ported from comments in https://github.com/dotnet/coreclr/pull/16353:

XunitPerformanceHarness has hard-coded console writeline usage inside it and I wanted all that output spew in a file to keep the console output clearer. I wound up hijacking Console.Out whenever using XunitPerformanceHarness in order to capture and redirect the logging.

Repro: Write code such as...

using(var harness = new XunitPerformanceHarness(args))
{
    harness.RunScenario(...)
}

Goal: Provide someway to redirect the console logging this does into a stream, or ideally a callback Actual: Output will be written to the console

default-writer commented 6 years ago

You can redirect the console logging manuallyb y using cmd.exe > operator

jzabroski commented 5 years ago

@noahfalk Why doesn't Xunit.Performance just use ITestOutputHelper abstraction in Xunit core for tests, and IMessageSink for general purpose output?

https://xunit.github.io/docs/capturing-output

noahfalk commented 5 years ago

@jzabroski - I wasn't the person who wrote xunit.performance so I can't give a definitive answer why the authors made particular design choices. I can say that in my use-case I wasn't using this library from an xunit test so if the authors had done that it would have made it a little awkward for me.

brianrob commented 3 years ago

Closing prior to archive.