machine.specifications icon indicating copy to clipboard operation
machine.specifications copied to clipboard

Add ITestContext hook

Open mikeblakeuk opened this issue 5 years ago • 2 comments

Add hook in the same style as AssemblyContext

(PR Used to run unit tests!)

mikeblakeuk avatar May 20 '20 20:05 mikeblakeuk

Hi @robertcoltheart, Hope you are handling the current quarantine ok. Not sure what your thoughts are on adding a ITestContext to allow users to add hooks when tests start and stop? It's super hard to time the tests. Only the It is measured when using the VSAdapter. We are going use AppInsights to track the test times.

mikeblakeuk avatar May 28 '20 09:05 mikeblakeuk

Sorry for the delay. I get where you're going with this, but I think it needs a bit of thought. For instance, your implementation only looks in the current assembly for a test context. What if you are timing tests for multiple test projects or multiple repos? It implies a lot of copy+paste code.

The approach Xunit takes is to have assembly attributes that load the extensions into the xunit engine. That's obviously quite a bit of work.

Will noodle a bit more on this topic and see if I can think of something that will help you.

robertcoltheart avatar Jun 03 '20 10:06 robertcoltheart