Testfx: Which Code Creates the Initial List in Test Explorer?

Created on 6 Jun 2018  路  5Comments  路  Source: microsoft/testfx

Description

I'm working on #410 and I'm not sure which code is responsible for populating the initial values in the Test Explorer. I've updated src/Adapter/MSTest.CoreAdapter/Discovery/TypeEnumerator.cs and that is working when the discovery is triggered.

The problem is, apparently there is more code that populates the window. I would assume the original code before the Discovery was introduced?

When I initial add the references to MSTest.TestAdapter and MSTest.TestFramework I get:

image

After I build my test project I get:

image

Which Code Creates the Initial List in Test Explorer?

question

Most helpful comment

@spottedmahn @singhsarab You are correct that source-based discovery is doing the initial discovery. After the build completes, then the tests are updated (with potentially more detail) from the adapter's discovery process.

Currently, the source-based discovery and reflection-based discovery are two different code-bases which can cause issues like you are seeing. Our plan is to merge the source-based discovery code into the adapters so that they can use a single code-base to do both kinds of discovery.

All 5 comments

@spottedmahn Latest VS 2017 has fast discovery (also known as source based discovery) enabled. This does not rely the adapter for discovery. On build, the discovery happens via the adapter and hence your changes are reflecting.

@ManishJayaswal @peterwald @genlu This is an interesting one, how are we planning to accommodate changes like these with source based discovery.

@spottedmahn @singhsarab You are correct that source-based discovery is doing the initial discovery. After the build completes, then the tests are updated (with potentially more detail) from the adapter's discovery process.

Currently, the source-based discovery and reflection-based discovery are two different code-bases which can cause issues like you are seeing. Our plan is to merge the source-based discovery code into the adapters so that they can use a single code-base to do both kinds of discovery.

Our plan is to merge the source-based discovery code into the adapters so that they can use a single code-base to do both kinds of discovery.

Great! 馃憤

Where is the source-based discovery code/class?

It's currently shipped with VS as part of the Test Explorer (not open source), but we are working with the test adapter owners to migrate that functionality.

Oh, I see, thanks!

No wonder I couldn't find it 馃槀

Was this page helpful?
0 / 5 - 0 ratings