Skip to content

Reference trimmer #5549

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
9 changes: 7 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@

<!-- Versioning -->
<PropertyGroup>
<MSTestEnginePreReleaseVersionLabel>alpha</MSTestEnginePreReleaseVersionLabel>

<!--
This is a early preview package, keep 1.0.0-alpha or similar suffix even in official builds.
-->
<MSTestEngineVersionPrefix>1.0.0</MSTestEngineVersionPrefix>
<MSTestEnginePreReleaseVersionLabel>alpha</MSTestEnginePreReleaseVersionLabel>
</PropertyGroup>

<!-- Pack config -->
Expand All @@ -70,6 +69,12 @@
<PolyGuard>true</PolyGuard>
</PropertyGroup>

<!-- Test config -->
<PropertyGroup>
<!-- Set the test runner here and not in test folder so that arcade doesn't force add xunit to any folder of the repo -->
<TestRunnerName>TestingPlatformRunner</TestRunnerName>
</PropertyGroup>

<ItemGroup>
<Using Include="System.Collections" />
<Using Include="System.Collections.Concurrent" />
Expand Down
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(MicrosoftCodeAnalysisPublicApiAnalyzersVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.13.61" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<GlobalPackageReference Include="ReferenceTrimmer" Version="3.3.11" />
</ItemGroup>
<ItemGroup Label="Product dependencies">
<PackageVersion Include="Microsoft.ApplicationInsights" Version="2.23.0" />
Expand Down
1 change: 1 addition & 0 deletions TestFx.sln
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IntegrationTests", "Integra
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestAssets", "TestAssets", "{C9F82701-0E0F-4E61-B05B-AE387E7631F6}"
ProjectSection(SolutionItems) = preProject
test\IntegrationTests\TestAssets\Directory.Build.props = test\IntegrationTests\TestAssets\Directory.Build.props
test\IntegrationTests\TestAssets\Directory.Build.targets = test\IntegrationTests\TestAssets\Directory.Build.targets
EndProjectSection
EndProject
Expand Down
1 change: 0 additions & 1 deletion samples/Playground/Playground.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<ProjectReference Include="$(RepoRoot)src\Analyzers\MSTest.Analyzers.CodeFixes\MSTest.Analyzers.CodeFixes.csproj" PrivateAssets="all" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
<ProjectReference Include="$(RepoRoot)src\Analyzers\MSTest.Analyzers\MSTest.Analyzers.csproj" PrivateAssets="all" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
<PackageReference Include="StreamJsonRpc" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.Telemetry\Microsoft.Testing.Extensions.Telemetry.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@

<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\Adapter\MSTestAdapter.PlatformServices\MSTestAdapter.PlatformServices.csproj" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.VSTestBridge\Microsoft.Testing.Extensions.VSTestBridge.csproj" Condition=" '$(TargetFramework)' != '$(UwpMinimum)' " />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.VSTestBridge\Microsoft.Testing.Extensions.VSTestBridge.csproj"
Condition=" '$(TargetFramework)' != '$(UwpMinimum)' AND '$(TargetFramework)' != '$(ModernUwpMinimum)' " />
<ProjectReference Include="$(RepoRoot)src\Analyzers\MSTest.Internal.Analyzers\MSTest.Internal.Analyzers.csproj">
<OutputItemType>Analyzer</OutputItemType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\MSTest.Analyzers.CodeFixes\MSTest.Analyzers.CodeFixes.csproj" />
<ProjectReference Include="..\MSTest.Analyzers\MSTest.Analyzers.csproj" />
<ProjectReference Include="..\MSTest.Analyzers.CodeFixes\MSTest.Analyzers.CodeFixes.csproj" NoWarn="RT0002" />
<ProjectReference Include="..\MSTest.Analyzers\MSTest.Analyzers.csproj" NoWarn="RT0002" />
</ItemGroup>

<ItemGroup>
Expand Down
15 changes: 10 additions & 5 deletions src/Package/MSTest/MSTest.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<Project>

<!-- SDK top import -->
<Import Project="Sdk.props" Sdk="MSBuild.Sdk.Extras" Condition=" '$(OS)' == 'Windows_NT' " />
Expand Down Expand Up @@ -44,10 +44,15 @@
</Target>

<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\Adapter\MSTest.TestAdapter\MSTest.TestAdapter.csproj" />
<ProjectReference Include="$(RepoRoot)src\TestFramework\TestFramework.Extensions\TestFramework.Extensions.csproj" />
<ProjectReference Include="$(RepoRoot)src\Analyzers\MSTest.Analyzers.Package\MSTest.Analyzers.Package.csproj" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.TrxReport\Microsoft.Testing.Extensions.TrxReport.csproj" Condition=" '$(TargetFramework)' != '$(UwpMinimum)' " />
<ProjectReference Include="$(RepoRoot)src\Adapter\MSTest.TestAdapter\MSTest.TestAdapter.csproj"
NoWarn="RT0002" />
<ProjectReference Include="$(RepoRoot)src\TestFramework\TestFramework.Extensions\TestFramework.Extensions.csproj"
NoWarn="RT0002" />
<ProjectReference Include="$(RepoRoot)src\Analyzers\MSTest.Analyzers.Package\MSTest.Analyzers.Package.csproj"
NoWarn="RT0002" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.TrxReport\Microsoft.Testing.Extensions.TrxReport.csproj"
Condition=" '$(TargetFramework)' != '$(UwpMinimum)' "
NoWarn="RT0002" />

<!-- CodeCoverage 17.14 doesn't support netcoreapp3.1. -->
<!-- We end up having System.Collections.Immutable 8.0.0 which is not compatible with netcoreapp3.1 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ This package extends Microsoft Testing Platform to provide a crash dump function

<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Platform\Microsoft.Testing.Platform.csproj" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.TrxReport.Abstractions\Microsoft.Testing.Extensions.TrxReport.Abstractions.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Platform\Microsoft.Testing.Platform.csproj" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.TrxReport.Abstractions\Microsoft.Testing.Extensions.TrxReport.Abstractions.csproj" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.Telemetry\Microsoft.Testing.Extensions.Telemetry.csproj" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.Telemetry\Microsoft.Testing.Extensions.Telemetry.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>

<!-- NuGet properties -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\Platform\Microsoft.Testing.Platform\Microsoft.Testing.Platform.csproj" CopyToBuildOutput="true" />
<!-- Deps only so we can include it in the lib of the NuGet package -->
<ProjectReference Include="$(RepoRoot)\src\Platform\Microsoft.Testing.Extensions.MSBuild\Microsoft.Testing.Extensions.MSBuild.csproj" PrivateAssets="All" />
<ProjectReference Include="$(RepoRoot)\src\Platform\Microsoft.Testing.Extensions.MSBuild\Microsoft.Testing.Extensions.MSBuild.csproj" PrivateAssets="All"
NoWarn="RT0002" />
</ItemGroup>

<!-- NuGet properties -->
Expand Down
1 change: 1 addition & 0 deletions test/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.CrashDump\Microsoft.Testing.Extensions.CrashDump.csproj" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.HangDump\Microsoft.Testing.Extensions.HangDump.csproj" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.Retry\Microsoft.Testing.Extensions.Retry.csproj" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.Telemetry\Microsoft.Testing.Extensions.Telemetry.csproj" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.TrxReport\Microsoft.Testing.Extensions.TrxReport.csproj" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.AzureDevOpsReport\Microsoft.Testing.Extensions.AzureDevOpsReport.csproj" />
<PackageReference Include="Microsoft.Testing.Platform.MSBuild" Condition="'$(UseMSTestFromSource)' == 'true'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
#if ENABLE_CODECOVERAGE
builder.AddCodeCoverageProvider();
#endif
builder.AddHangDumpProvider();
builder.AddAppInsightsTelemetryProvider();
builder.AddCrashDumpProvider(ignoreIfNotSupported: true);
builder.AddHangDumpProvider();
builder.AddRetryProvider();
builder.AddTrxReportProvider();
builder.AddAzureDevOpsProvider();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
#if ENABLE_CODECOVERAGE
builder.AddCodeCoverageProvider();
#endif
builder.AddHangDumpProvider();
builder.AddAppInsightsTelemetryProvider();
builder.AddCrashDumpProvider(ignoreIfNotSupported: true);
builder.AddHangDumpProvider();
builder.AddRetryProvider();
builder.AddTrxReportProvider();
builder.AddRetryProvider();
builder.AddAzureDevOpsProvider();
Expand Down
9 changes: 9 additions & 0 deletions test/IntegrationTests/TestAssets/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../../'))" />

<PropertyGroup>
<EnableReferenceTrimmer>false</EnableReferenceTrimmer>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions test/IntegrationTests/TestAssets/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
<ProjectCapability Remove="TestContainer" />
<ProjectCapability Remove="TestingPlatformServer" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeRefactoring.Testing" />

<!-- Deps of MSTest.TestAdapter -->
<PackageReference Include="Microsoft.TestPlatform.AdapterUtilities" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion test/UnitTests/MSTest.Analyzers.UnitTests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
#if ENABLE_CODECOVERAGE
builder.AddCodeCoverageProvider();
#endif
builder.AddCrashDumpProvider();
builder.AddAppInsightsTelemetryProvider();
builder.AddCrashDumpProvider(ignoreIfNotSupported: true);
builder.AddHangDumpProvider();
builder.AddRetryProvider();
builder.AddTrxReportProvider();
builder.AddAzureDevOpsProvider();

Expand Down
3 changes: 2 additions & 1 deletion test/UnitTests/MSTest.Engine.UnitTests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
#if ENABLE_CODECOVERAGE
builder.AddCodeCoverageProvider();
#endif
builder.AddHangDumpProvider();
builder.AddCrashDumpProvider(ignoreIfNotSupported: true);
builder.AddHangDumpProvider();
builder.AddRetryProvider();
builder.AddTrxReportProvider();
builder.AddAppInsightsTelemetryProvider();
builder.AddAzureDevOpsProvider();
Expand Down
3 changes: 2 additions & 1 deletion test/UnitTests/MSTest.SourceGeneration.UnitTests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
#if ENABLE_CODECOVERAGE
builder.AddCodeCoverageProvider();
#endif
builder.AddHangDumpProvider();
builder.AddCrashDumpProvider(ignoreIfNotSupported: true);
builder.AddHangDumpProvider();
builder.AddRetryProvider();
builder.AddTrxReportProvider();
builder.AddAppInsightsTelemetryProvider();
builder.AddAzureDevOpsProvider();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
#if ENABLE_CODECOVERAGE
builder.AddCodeCoverageProvider();
#endif
builder.AddHangDumpProvider();
builder.AddAppInsightsTelemetryProvider();
builder.AddCrashDumpProvider(ignoreIfNotSupported: true);
builder.AddHangDumpProvider();
builder.AddRetryProvider();
builder.AddTrxReportProvider();
builder.AddAppInsightsTelemetryProvider();
builder.AddAzureDevOpsProvider();

// Custom suite tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
#if ENABLE_CODECOVERAGE
builder.AddCodeCoverageProvider();
#endif
Console.WriteLine("NATIVE_AOT disabled");
builder.AddAppInsightsTelemetryProvider();
builder.AddCrashDumpProvider(ignoreIfNotSupported: true);
builder.AddHangDumpProvider();
Console.WriteLine("NATIVE_AOT disabled");
#else
Console.WriteLine("NATIVE_AOT enabled");
#endif

builder.AddCrashDumpProvider(ignoreIfNotSupported: true);
builder.AddRetryProvider();
builder.AddTrxReportProvider();
builder.AddAzureDevOpsProvider();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
#if ENABLE_CODECOVERAGE
builder.AddCodeCoverageProvider();
#endif
builder.AddHangDumpProvider();
builder.AddAppInsightsTelemetryProvider();
builder.AddCrashDumpProvider(ignoreIfNotSupported: true);
builder.AddHangDumpProvider();
builder.AddRetryProvider();
builder.AddTrxReportProvider();
builder.AddAzureDevOpsProvider();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
#if ENABLE_CODECOVERAGE
builder.AddCodeCoverageProvider();
#endif
builder.AddCrashDumpProvider();
builder.AddAppInsightsTelemetryProvider();
builder.AddCrashDumpProvider(ignoreIfNotSupported: true);
builder.AddHangDumpProvider();
builder.AddRetryProvider();
builder.AddTrxReportProvider();
builder.AddAzureDevOpsProvider();

Expand Down
Loading