Skip to content
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
2 changes: 1 addition & 1 deletion eng/verify-nupkgs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Confirm-NugetPackages {
$expectedNumOfFiles = @{
"MSTest.Sdk" = 15
"MSTest.TestFramework" = 105
"MSTest.TestAdapter" = 66
"MSTest.TestAdapter" = 68
"MSTest" = 10
"MSTest.Analyzers" = 56
"MSTest.SourceGeneration" = 8
Expand Down

Large diffs are not rendered by default.

19 changes: 12 additions & 7 deletions src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ $(CommonProductDescription)]]></PackageDescription>

<!-- Curated package dependencies. PrivateAssets="none" so all assets (including build/buildTransitive
targets, e.g. from Microsoft.Testing.Platform.MSBuild) flow to consumers. -->
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.TrxReport.Abstractions\Microsoft.Testing.Extensions.TrxReport.Abstractions.csproj" Condition=" '$(TargetFramework)' != '$(UwpMinimum)' " PrivateAssets="none" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.Telemetry\Microsoft.Testing.Extensions.Telemetry.csproj" Condition=" '$(TargetFramework)' != '$(UwpMinimum)' " PrivateAssets="none" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Platform.MSBuild\Microsoft.Testing.Platform.MSBuild.csproj" Condition=" '$(TargetFramework)' != '$(UwpMinimum)' " PrivateAssets="none" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.TrxReport.Abstractions\Microsoft.Testing.Extensions.TrxReport.Abstractions.csproj" PrivateAssets="none" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Extensions.Telemetry\Microsoft.Testing.Extensions.Telemetry.csproj" PrivateAssets="none" />
<ProjectReference Include="$(RepoRoot)src\Platform\Microsoft.Testing.Platform.MSBuild\Microsoft.Testing.Platform.MSBuild.csproj" PrivateAssets="none" />
<!-- On Windows the package depends on MSTest.TestFramework, matching the historical MSTest.TestAdapter.nuspec.
The historical MSTest.TestAdapter.NonWindows.nuspec did NOT declare this dependency, so on non-Windows builds
we keep the compile-time reference but suppress the package dependency via PrivateAssets="all" to keep the
Expand All @@ -88,10 +88,10 @@ $(CommonProductDescription)]]></PackageDescription>
referenced explicitly for every TFM. -->
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" />

<!-- The native Microsoft.Testing.Platform integration (TestingPlatformAdapter\MSTestFilterContext, guarded by
!WINDOWS_UWP) parses VSTest filter expressions via the Filter source package. It flows in transitively via
the VSTestBridge today (PrivateAssets=all there), so reference it explicitly where the native path builds. -->
<PackageReference Include="Microsoft.TestPlatform.Filter.Source" PrivateAssets="all" Condition=" '$(TargetFramework)' != '$(UwpMinimum)' " />
<!-- The native Microsoft.Testing.Platform integration (TestingPlatformAdapter\MSTestFilterContext) parses VSTest
filter expressions via the Filter source package. It flows in transitively via the VSTestBridge today
(PrivateAssets=all there), so reference it explicitly here. -->
<PackageReference Include="Microsoft.TestPlatform.Filter.Source" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -181,6 +181,11 @@ $(CommonProductDescription)]]></PackageDescription>
<TfmSpecificPackageFile Include="$(TargetDir)MSTest.TestAdapter.dll" PackagePath="$(_BuildTransitiveDir)" />
<TfmSpecificPackageFile Include="$(TargetDir)MSTestAdapter.PlatformServices.dll" PackagePath="$(_BuildTransitiveDir)" />

<!-- Classic UWP's VSTest deployment only includes adapter dependencies declared by this package's targets.
Bundle the direct dependencies introduced by the native MTP integration so the adapter remains loadable. -->
<TfmSpecificPackageFile Condition=" '$(TargetFramework)' == '$(UwpMinimum)' " Include="$(TargetDir)Microsoft.Testing.Platform.dll" PackagePath="$(_BuildTransitiveDir)" />
<TfmSpecificPackageFile Condition=" '$(TargetFramework)' == '$(UwpMinimum)' " Include="$(TargetDir)Microsoft.Testing.Extensions.TrxReport.Abstractions.dll" PackagePath="$(_BuildTransitiveDir)" />

<!-- .NET Framework also bundles the TestFramework assemblies. -->
<TfmSpecificPackageFile Condition=" '$(TargetFramework)' == '$(NetFrameworkMinimum)' " Include="$(TargetDir)MSTest.TestFramework.dll" PackagePath="$(_BuildTransitiveDir)" />
<TfmSpecificPackageFile Condition=" '$(TargetFramework)' == '$(NetFrameworkMinimum)' " Include="$(TargetDir)MSTest.TestFramework.Extensions.dll" PackagePath="$(_BuildTransitiveDir)" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
#nullable enable
#nullable enable
Microsoft.VisualStudio.TestTools.UnitTesting.TestApplicationBuilderExtensions
Microsoft.VisualStudio.TestTools.UnitTesting.TestingPlatformBuilderHook
static Microsoft.VisualStudio.TestTools.UnitTesting.TestApplicationBuilderExtensions.AddMSTest(this Microsoft.Testing.Platform.Builder.ITestApplicationBuilder! testApplicationBuilder, System.Func<System.Collections.Generic.IEnumerable<System.Reflection.Assembly!>!>! getTestAssemblies) -> void
static Microsoft.VisualStudio.TestTools.UnitTesting.TestingPlatformBuilderHook.AddExtensions(Microsoft.Testing.Platform.Builder.ITestApplicationBuilder! testApplicationBuilder, string![]! arguments) -> void
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Extensions.TrxReport.Abstractions;

namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatformAdapter;
Expand All @@ -15,4 +14,3 @@ internal interface IMSTestTrxReportCapability : ITrxReportCapability
{
bool IsTrxEnabled { get; }
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Platform.Capabilities.TestFramework;
using Microsoft.Testing.Platform.Services;
using Microsoft.Testing.Shared;
Expand All @@ -18,4 +17,3 @@ internal sealed class MSTestBannerCapability : IBannerMessageOwnerCapability
public Task<string?> GetBannerMessageAsync()
=> Task.FromResult<string?>(BannerMessageHelper.BuildBannerMessage(_platformInformation, "MSTest", MSTestVersion.SemanticVersion));
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Platform.Extensions;
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Resources;

Expand All @@ -26,4 +25,3 @@ private static string GetExtensionUid()
return assemblyMetadataAttributes?.FirstOrDefault(x => x.Key == "MSTest.Extension.Uid")?.Value ?? nameof(MSTestExtension);
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Platform.CommandLine;
using Microsoft.Testing.Platform.Extensions.Messages;
using Microsoft.Testing.Platform.Requests;
Expand Down Expand Up @@ -260,4 +259,3 @@ public MSTestDiscoveryContext(ICommandLineOptions commandLineOptions, IRunSettin
{
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Platform.Extensions;
using Microsoft.Testing.Platform.Extensions.OutputDevice;
using Microsoft.Testing.Platform.OutputDevice;
Expand Down Expand Up @@ -75,4 +74,3 @@ public void SendMessage(TestMessageLevel testMessageLevel, string message)

Task<bool> IExtension.IsEnabledAsync() => _extension.IsEnabledAsync();
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Platform.Capabilities.TestFramework;
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter;

Expand Down Expand Up @@ -130,4 +129,3 @@ private enum ExecutionState
Completed,
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Platform.Telemetry;
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter;

Expand Down Expand Up @@ -48,4 +47,3 @@ internal static void TryEnable(IServiceProvider serviceProvider)
: null);
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Platform.CommandLine;
using Microsoft.Testing.Platform.Configurations;
using Microsoft.Testing.Platform.Services;
Expand Down Expand Up @@ -213,4 +212,3 @@ private static void WarnOnUnsupportedEntries(XDocument document, IMessageLogger
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Extensions;
using Microsoft.Testing.Platform.Extensions;
using Microsoft.Testing.Platform.Helpers;
Expand Down Expand Up @@ -31,4 +30,3 @@ internal MSTestRunSettingsCommandLineOptionsProvider(IExtension extension, IFile

protected override string EnvironmentVariablesNotSupportedOnBrowserError => PlatformAdapterResources.RunSettingsEnvironmentVariablesNotSupportedOnBrowser;
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Extensions;
using Microsoft.Testing.Platform.CommandLine;
using Microsoft.Testing.Platform.Extensions;
Expand Down Expand Up @@ -39,4 +38,3 @@ public MSTestRunSettingsConfigurationProvider(IExtension extension, IFileSystem
return MSTestRunSettings.ReadRunSettings(fileNames, _fileSystem);
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Extensions;
using Microsoft.Testing.Platform.CommandLine;
using Microsoft.Testing.Platform.Extensions;
Expand All @@ -19,4 +18,3 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.TestingPlatform
[SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")]
internal sealed class MSTestRunSettingsEnvironmentVariableProvider(IExtension extension, ICommandLineOptions commandLineOptions, IFileSystem fileSystem, IEnvironment environment)
: RunSettingsEnvironmentVariableProviderBase(extension, commandLineOptions, fileSystem, environment);
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Extensions;
using Microsoft.Testing.Platform.Extensions;
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Resources;
Expand All @@ -20,4 +19,3 @@ public MSTestTestCaseFilterCommandLineOptionsProvider(IExtension extension)
{
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Extensions.TrxReport.Abstractions;
using Microsoft.Testing.Platform.Capabilities.TestFramework;
using Microsoft.Testing.Platform.Extensions.Messages;
Expand Down Expand Up @@ -249,4 +248,3 @@ public void Dispose()
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Extensions.TrxReport.Abstractions;
using Microsoft.Testing.Platform.Extensions.Messages;
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter;
Expand Down Expand Up @@ -495,4 +494,3 @@ private static void AddAttachments(TestNode testNode, FrameworkTestResult result
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
namespace Microsoft.VisualStudio.TestTools.UnitTesting;

/// <summary>
Expand All @@ -19,4 +18,3 @@ public MSTestTestNodeException(string? message, string? stackTrace)

public override string? StackTrace { get; }
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Extensions;
using Microsoft.Testing.Platform.Extensions;
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Resources;
Expand All @@ -21,4 +20,3 @@ public MSTestTestRunParametersCommandLineOptionsProvider(IExtension extension)
{
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
#if NETFRAMEWORK
using System.Security;
#endif
Expand Down Expand Up @@ -74,4 +73,3 @@ public void SetupRemoteEqtTraceListeners(AppDomain? childDomain)
}
#endif
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions;
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface;
Expand Down Expand Up @@ -169,4 +168,3 @@ public bool Matches(UnitTestElement testElement)
}
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Platform.Extensions.Messages;
using Microsoft.Testing.Platform.Messages;
using Microsoft.Testing.Platform.TestHost;
Expand Down Expand Up @@ -65,4 +64,3 @@ public async Task<bool> RecordResultAsync(UnitTestElement testElement, Framework
private Task PublishAsync(TestNode testNode)
=> _messageBus.PublishAsync(_dataProducer, new TestNodeUpdateMessage(_sessionUid, testNode));
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Platform.Extensions.Messages;
using Microsoft.Testing.Platform.Messages;
using Microsoft.Testing.Platform.TestHost;
Expand Down Expand Up @@ -37,4 +36,3 @@ public Task SendTestElementAsync(UnitTestElement testElement)
return _messageBus.PublishAsync(_dataProducer, new TestNodeUpdateMessage(_sessionUid, testNode));
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Platform.Configurations;

using PlatformServicesConfiguration = Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.IConfiguration;
Expand All @@ -18,4 +17,3 @@ public PlatformServicesConfigurationAdapter(IConfiguration configuration)

public string? this[string key] => _configuration[key];
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Extensions.TrxReport.Abstractions;
using Microsoft.Testing.Platform.Builder;
using Microsoft.Testing.Platform.Capabilities.TestFramework;
Expand Down Expand Up @@ -76,4 +75,3 @@ public static void AddMSTest(this ITestApplicationBuilder testApplicationBuilder
(capabilities, serviceProvider) => new MSTestTestFramework(extension, getTestAssemblies, serviceProvider, capabilities));
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#if !WINDOWS_UWP
using Microsoft.Testing.Platform.Builder;

namespace Microsoft.VisualStudio.TestTools.UnitTesting;
Expand All @@ -21,4 +20,3 @@ public static class TestingPlatformBuilderHook
public static void AddExtensions(ITestApplicationBuilder testApplicationBuilder, string[] arguments)
=> testApplicationBuilder.AddMSTest(() => [Assembly.GetEntryAssembly()!]);
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,16 @@
<IsMSTestTestAdapterReferenced>true</IsMSTestTestAdapterReferenced>
</PropertyGroup>

<ItemGroup>
<!--
!!! IMPORTANT !!!
DO NOT CHANGE THE GUID, IT'S A WELL KNOWN EXTENSION POINT AND THIS EXTENSION NEEDS TO BE REGISTERED AT THE END
WE HAVE CODE INSIDE THE TASK 'TestingPlatformEntryPoint' TO ENSURE THE ORDER OF THE REGISTRATION BASED ON THIS GUID
-->
<TestingPlatformBuilderHook Include="031F8871-2660-4208-8F6B-FC142B40ABFF">
<DisplayName>MSTest</DisplayName>
<TypeFullName>Microsoft.VisualStudio.TestTools.UnitTesting.TestingPlatformBuilderHook</TypeFullName>
</TestingPlatformBuilderHook>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<Project>

<!-- Handle the coexistence between testing platform and Microsoft.NET.Test.Sdk -->
<PropertyGroup>
<EnableMSTestRunner Condition=" '$(EnableMSTestRunner)' == '' ">false</EnableMSTestRunner>
<IsTestingPlatformApplication>$(EnableMSTestRunner)</IsTestingPlatformApplication>
Comment thread
Evangelink marked this conversation as resolved.
Resolved

<GenerateProgramFile Condition=" '$(EnableMSTestRunner)' == 'true' ">false</GenerateProgramFile>
</PropertyGroup>

<ItemGroup>
<Reference Include="MSTest.TestAdapter">
<HintPath>$(MSBuildThisFileDirectory)MSTest.TestAdapter.dll</HintPath>
Expand All @@ -9,6 +17,13 @@
</Reference>
</ItemGroup>

<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)Microsoft.Testing.Extensions.TrxReport.Abstractions.dll"
Link="Microsoft.Testing.Extensions.TrxReport.Abstractions.dll" />
<Content Include="$(MSBuildThisFileDirectory)Microsoft.Testing.Platform.dll"
Link="Microsoft.Testing.Platform.dll" />
</ItemGroup>

<ItemGroup>
<CompilerVisibleProperty Include="IsMSTestTestAdapterReferenced" />
</ItemGroup>
Expand Down
Loading
Loading