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

Filtering sources based on assembly type #1537

Merged

Conversation

abhishkk
Copy link
Contributor

@abhishkk abhishkk commented Apr 9, 2018

Part 3 of RFC:
Contains changes for filtering sources based on assembly type.

if (discoverer.Metadata.AssemblyType == AssemblyType.Native ||
discoverer.Metadata.AssemblyType == AssemblyType.Managed)
{
assemblyTypeToSoucesMap = assemblyTypeToSoucesMap ?? GetAssemblyTypeToSoucesMap(sources);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

spelling

@mayankbansal018 mayankbansal018 removed their request for review April 10, 2018 07:07
@@ -31,6 +34,7 @@ public class DiscovererEnumeratorTests
private DiscoveryResultCache discoveryResultCache;
private Mock<IRequestData> mockRequestData;
private Mock<IMetricsCollection> mockMetricsCollection;
private Mock<IAssemblyProperties> mockPEReaderHelper;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

renaming mockPEReaderHelper to mockAssemblyProperties

@mayankbansal018 mayankbansal018 self-assigned this Apr 10, 2018
}

// Added this to make class testable, needed a PEHeader mocked Instance
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: needed a AssemblyProperties or remove comment.

var result = new Dictionary<LazyExtension<ITestDiscoverer, ITestDiscovererCapabilities>, IEnumerable<string>>();
var sourcesForWhichNoDiscovererIsAvailable = new List<string>(sources);

foreach (var discoverer in allDiscoverers)
{
var sourcesToCheck = sources;

if (discoverer.Metadata.AssemblyType == AssemblyType.Native ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a chance discoverer can support both managed and native?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. adapter can't mention both

assemblyTypeToSoucesMap[assemblyProperties.GetAssemblyType(source)] :
assemblyTypeToSoucesMap[AssemblyType.None];

((List<string>)sourcesList).Add(source);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use IList here?

Copy link
Contributor

Choose a reason for hiding this comment

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

done

}
finally
{
this.ResetDiscoverers();
Copy link
Contributor

Choose a reason for hiding this comment

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

Add this to cleanup.

@mayankbansal018 mayankbansal018 merged commit 2f6e1db into microsoft:master Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants