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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
private const string CoverletDataCollector = "coverlet.collector.dll"; | ||
|
||
/// <inheritdoc/> | ||
public bool IsInitialized { get; private set; } = false; | ||
|
||
|
@@ -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 inproc DC is not initialized via runsetting inproc node. | ||
extensions = extensions.Concat(TestPluginCache.Instance.GetExtensionPaths(ProxyExecutionManager.CoverletDataCollector, true)).ToList(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assuming the LUT inproc data collector gets initialized via runsettings There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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)); | ||
|
There was a problem hiding this comment.
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.