Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only send Coverlet in proc datacollector dll to testhost #2226

Merged
merged 2 commits into from Oct 17, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -37,6 +37,12 @@ internal class ProxyExecutionManager : ProxyOperationManager, IProxyExecutionMan
private bool skipDefaultAdapters;
private readonly IFileHelper fileHelper;

// Only send coverlet inproc datacollector dll to be initialized via testhost,
// ideally this should get initialized via InProcessDC Node in runsettings, but
// somehow it is failing, hence putting this ugly HACK, to fix issues like
// https://developercommunity.visualstudio.com/content/problem/738856/could-not-load-file-or-assembly-microsoftintellitr.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the runsettings, we do not send the complete codebase path for coverlet. We send just the dll name (coverlet.collector.dll). Later, in test host while initializing the inproc data collector, we look for all directories from where (datacollector)extensions were loaded and try to find the coverlet.collector.dll in those paths. (https://github.com/microsoft/vstest/blob/master/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs#L69)

If there's a way we can add the full codebase in runsettings, then this can be avoided.

private const string CoverletDataCollector = "coverlet.collector.dll";

/// <inheritdoc/>
public bool IsInitialized { get; private set; } = false;

Expand Down Expand Up @@ -261,7 +267,9 @@ private void LogMessage(TestMessageLevel testMessageLevel, string message)
private void InitializeExtensions(IEnumerable<string> sources)
{
var extensions = TestPluginCache.Instance.GetExtensionPaths(TestPlatformConstants.TestAdapterEndsWithPattern, this.skipDefaultAdapters);
extensions = extensions.Concat(TestPluginCache.Instance.GetExtensionPaths(TestPlatformConstants.DataCollectorEndsWithPattern, true)).ToList();

// remove this line once we figure out why coverlet inrpoc DC is not initialized via runsetting inproc node.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: inproc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

extensions = extensions.Concat(TestPluginCache.Instance.GetExtensionPaths(ProxyExecutionManager.CoverletDataCollector, true)).ToList();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming the LUT inproc data collector gets initialized via runsettings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code was recently added, so LUT should not be dependent on it, will double check though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LUT inproc datacollector would be providing full codebase path in runsettings, which wouldn't depend on this flow.


// Filter out non existing extensions
var nonExistingExtensions = extensions.Where(extension => !this.fileHelper.Exists(extension));
Expand Down