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

Adding Microsoft.VisualStudio.ArchitectureTools.PEReader.dll to Extensions #2041

Merged
merged 4 commits into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@ function Create-VsixPackage
$legacyDir = Join-Path $env:TP_PACKAGES_DIR "Microsoft.Internal.TestPlatform.Extensions\$testPlatformExternalsVersion\contentFiles\any\any"
Copy-Item -Recurse $legacyDir\* $packageDir -Force

# Copy Microsoft.VisualStudio.ArchitectureTools.PEReader to Extensions
Copy-Item $legacyDir\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll $extensionsPackageDir -Force

# Copy QtAgent Related depedencies
$legacyDir = Join-Path $env:TP_PACKAGES_DIR "Microsoft.VisualStudio.QualityTools\$testPlatformExternalsVersion\contentFiles\any\any"
Copy-Item -Recurse $legacyDir\* $packageDir -Force
Expand Down
2 changes: 1 addition & 1 deletion src/package/nuspec/Microsoft.TestPlatform.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<file src="net451\$Runtime$\Microsoft.TestPlatform.Utilities.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.TestPlatform.Utilities.dll" />
<file src="net451\$Runtime$\Microsoft.TestPlatform.VsTestConsole.TranslationLayer.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.TestPlatform.VsTestConsole.TranslationLayer.dll" />
<file src="net451\$Runtime$\Microsoft.TestPlatform.VsTestConsole.TranslationLayer.xml" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.TestPlatform.VsTestConsole.TranslationLayer.xml" />
<file src="net451\$Runtime$\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll" />
<file src="net451\$Runtime$\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Extensions\Microsoft.VisualStudio.ArchitectureTools.PEReader.dll" />
<file src="net451\$Runtime$\Microsoft.VisualStudio.Coverage.Analysis.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.VisualStudio.Coverage.Analysis.dll" />
<file src="net451\$Runtime$\Microsoft.VisualStudio.Coverage.Interop.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.VisualStudio.Coverage.Interop.dll" />
<file src="net451\$Runtime$\Microsoft.VisualStudio.Diagnostics.Utilities.dll" target="tools\net451\Common7\IDE\Extensions\TestPlatform\Microsoft.VisualStudio.Diagnostics.Utilities.dll" />
Expand Down
24 changes: 24 additions & 0 deletions test/Microsoft.TestPlatform.AcceptanceTests/DataCollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,30 @@ public void ExecuteTestsWithDataCollectionUsingCollectArgument(RunnerInfo runner
this.VaildateDataCollectorOutput();
}

[TestMethod]
[NetCoreTargetFrameworkDataSource]
public void DataCollectorAssemblyLoadingShouldNotThrowErrorForNetCore(RunnerInfo runnerInfo)
{
AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo);

var arguments = PrepareArguments(GetAssetFullPath("AppDomainGetAssembliesTestProject.dll", "netcoreapp2.0"), string.Empty, string.Empty, this.FrameworkArgValue);

this.InvokeVsTest(arguments);
this.ValidateSummaryStatus(1, 0, 0);
}

[TestMethod]
[NetFullTargetFrameworkDataSource]
public void DataCollectorAssemblyLoadingShouldNotThrowErrorForFullFramework(RunnerInfo runnerInfo)
{
AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo);

var arguments = PrepareArguments(GetAssetFullPath("AppDomainGetAssembliesTestProject.dll"), string.Empty, string.Empty, this.FrameworkArgValue);

this.InvokeVsTest(arguments);
this.ValidateSummaryStatus(1, 0, 0);
}

private static void CreateDataCollectionRunSettingsFile(string destinationRunsettingsPath, Dictionary<string, string> dataCollectionAttributes)
{
var doc = new XmlDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ protected string GetAssetFullPath(string assetName)
return this.testEnvironment.GetTestAsset(assetName);
}

protected string GetAssetFullPath(string assetName, string targetFramework)
{
return this.testEnvironment.GetTestAsset(assetName, targetFramework);
}

protected string GetTestAdapterPath(UnitTestFramework testFramework = UnitTestFramework.MSTest)
{
string adapterRelativePath = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net451</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.1" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.1" />
</ItemGroup>

</Project>
24 changes: 24 additions & 0 deletions test/TestAssets/AppDomainGetAssembliesTestProject/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Linq;

namespace AppDomainGetAssembliesTestProject
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
// https://github.com/microsoft/vstest/issues/2008
// GetAssemblies adds datacollectors to test host appdomain which was failing in the above issue

var allAssemblies = AppDomain.CurrentDomain.GetAssemblies();

foreach(var assembly in allAssemblies)
{
var typeInfo = assembly.GetTypes();
}
}
}
}
6 changes: 6 additions & 0 deletions test/TestAssets/TestAssets.sln/TestAssets.sln
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LegacySettingsUnitTestProje
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NewtonSoftDependency", "..\NewtonSoftDependency\NewtonSoftDependency.csproj", "{79EDA259-5EA0-45F0-990A-F078427E198A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppDomainGetAssembliesTestProject", "..\AppDomainGetAssembliesTestProject\AppDomainGetAssembliesTestProject.csproj", "{BF090BCE-CC7D-4359-93E2-30F2B454F751}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -135,6 +137,10 @@ Global
{79EDA259-5EA0-45F0-990A-F078427E198A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79EDA259-5EA0-45F0-990A-F078427E198A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79EDA259-5EA0-45F0-990A-F078427E198A}.Release|Any CPU.Build.0 = Release|Any CPU
{BF090BCE-CC7D-4359-93E2-30F2B454F751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF090BCE-CC7D-4359-93E2-30F2B454F751}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BF090BCE-CC7D-4359-93E2-30F2B454F751}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BF090BCE-CC7D-4359-93E2-30F2B454F751}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down