microsoft / vstest

Visual Studio Test Platform is the runner and engine that powers test explorer and vstest.console.
MIT License
870 stars 316 forks source link

Hot to get TFM information inside custom datacollector? #3360

Closed daveMueller closed 1 week ago

daveMueller commented 2 years ago

Hi,

is there any information on how to get TFM inside our datacollector? As I have seen this issue here https://github.com/microsoft/vstest/issues/2592, the information must be available. Is it somehow possible to get this information inside the collector so we can pass it to the filename (https://github.com/coverlet-coverage/coverlet/issues/1276)?

daveMueller commented 2 years ago

After going through the vstest code I figured out I can do something like this as a workaround.

string framework = _configurationElement["Framework"]?.InnerText;
string tfm = string.IsNullOrEmpty(framework) ? "" : NuGetFramework.Parse(framework).ToString();

With this approach I would have to add another dependency to our code just to parse back the tfm. Is there any plan on changing the runsettings Framework value to the actual tfm? Or additionally expose the tfm?

MarcoRossignoli commented 2 years ago

Hi @daveMueller,

at the moment we don't have any plan for what I know, I think we can add that deps to coverlet...with this fix https://github.com/coverlet-coverage/coverlet/pull/1243 shouldn't be an issue anymore.

@nohwnd do we have other requests for this one?

nohwnd commented 1 week ago

This is a new feature and won't be implemented, we are focusing on adding new features to Testing.Platform instead. https://aka.ms/testingplatform