diff --git a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBridgedTestFramework.cs b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBridgedTestFramework.cs index 4fb87cc30e..e175c89ce1 100644 --- a/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBridgedTestFramework.cs +++ b/src/Adapter/MSTest.TestAdapter/TestingPlatformAdapter/MSTestBridgedTestFramework.cs @@ -19,6 +19,7 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting; [SuppressMessage("ApiDesign", "RS0030:Do not use banned APIs", Justification = "We can use MTP from this folder")] +[StackTraceHidden] internal sealed class MSTestBridgedTestFramework : SynchronizedSingleSessionVSTestBridgedTestFramework { private readonly BridgedConfiguration? _configuration; diff --git a/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestExecutor.cs b/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestExecutor.cs index f85044c5f8..cc872a0d9e 100644 --- a/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestExecutor.cs +++ b/src/Adapter/MSTest.TestAdapter/VSTestAdapter/MSTestExecutor.cs @@ -17,6 +17,7 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter; /// Contains the execution logic for this adapter. /// [ExtensionUri(EngineConstants.ExecutorUriString)] +[StackTraceHidden] internal sealed class MSTestExecutor : ITestExecutor { private readonly CancellationToken _cancellationToken; diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs b/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs index 6dbea119b7..74d60443e0 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestExecutionManager.cs @@ -19,6 +19,7 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; /// Class responsible for execution of tests at assembly level and sending tests via framework handle. /// #pragma warning disable CA1852 // Seal internal types - This class is inherited in tests. +[StackTraceHidden] internal class TestExecutionManager { private sealed class RemotingMessageLogger : diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodInfo.cs b/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodInfo.cs index 4d81c5f61f..165a49355d 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodInfo.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodInfo.cs @@ -12,6 +12,7 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; /// Defines the TestMethod Info object. /// #pragma warning disable CA1852 // Seal internal types - This class is inherited in tests. +[StackTraceHidden] internal partial class TestMethodInfo : ITestMethod { /// diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.cs b/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.cs index 49965d0f0e..9f96f02485 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.cs @@ -17,6 +17,7 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; /// /// This class is responsible to running tests and converting framework TestResults to adapter TestResults. /// +[StackTraceHidden] internal sealed class TestMethodRunner { /// diff --git a/src/Adapter/MSTestAdapter.PlatformServices/Execution/UnitTestRunner.cs b/src/Adapter/MSTestAdapter.PlatformServices/Execution/UnitTestRunner.cs index 27cc6bb8ce..5e391fb043 100644 --- a/src/Adapter/MSTestAdapter.PlatformServices/Execution/UnitTestRunner.cs +++ b/src/Adapter/MSTestAdapter.PlatformServices/Execution/UnitTestRunner.cs @@ -20,6 +20,7 @@ namespace Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution; /// /// The runner that runs a single unit test. Also manages the assembly and class cleanup methods at the end of the run. /// +[StackTraceHidden] internal sealed class UnitTestRunner #if NETFRAMEWORK : MarshalByRefObject diff --git a/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/SynchronizedSingleSessionVSTestAndTestAnywhereAdapter.cs b/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/SynchronizedSingleSessionVSTestAndTestAnywhereAdapter.cs index 977788a3d8..cdb5362e76 100644 --- a/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/SynchronizedSingleSessionVSTestAndTestAnywhereAdapter.cs +++ b/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/SynchronizedSingleSessionVSTestAndTestAnywhereAdapter.cs @@ -16,6 +16,7 @@ namespace Microsoft.Testing.Extensions.VSTestBridge; /// /// A specialized bridged test framework base class that supports a single test session. /// +[StackTraceHidden] public abstract class SynchronizedSingleSessionVSTestBridgedTestFramework : VSTestBridgedTestFrameworkBase, IDisposable { private readonly IExtension _extension; diff --git a/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/VSTestBridgedTestFrameworkBase.cs b/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/VSTestBridgedTestFrameworkBase.cs index 84b1b3c677..bdf7f6f335 100644 --- a/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/VSTestBridgedTestFrameworkBase.cs +++ b/src/Platform/Microsoft.Testing.Extensions.VSTestBridge/VSTestBridgedTestFrameworkBase.cs @@ -17,6 +17,7 @@ namespace Microsoft.Testing.Extensions.VSTestBridge; /// /// Represents a base class for bridged test frameworks (support of Microsoft.Testing.Platform while supporting VSTest like APIs). /// +[StackTraceHidden] public abstract class VSTestBridgedTestFrameworkBase : ITestFramework, IDataProducer { private readonly ITrxReportCapability? _trxReportCapability; diff --git a/src/Platform/Microsoft.Testing.Platform/Hosts/CommonTestHost.cs b/src/Platform/Microsoft.Testing.Platform/Hosts/CommonTestHost.cs index 8eeac3f0a1..ba69cf06a0 100644 --- a/src/Platform/Microsoft.Testing.Platform/Hosts/CommonTestHost.cs +++ b/src/Platform/Microsoft.Testing.Platform/Hosts/CommonTestHost.cs @@ -18,6 +18,7 @@ namespace Microsoft.Testing.Platform.Hosts; /// This represents either a test host (console or server), or a test host controller. /// This doesn't represent an orchestrator host. /// +[StackTraceHidden] internal abstract class CommonHost(ServiceProvider serviceProvider) : IHost { public ServiceProvider ServiceProvider => serviceProvider; diff --git a/src/Platform/Microsoft.Testing.Platform/Hosts/ConsoleTestHost.cs b/src/Platform/Microsoft.Testing.Platform/Hosts/ConsoleTestHost.cs index 0ff442bd35..83e759a9e9 100644 --- a/src/Platform/Microsoft.Testing.Platform/Hosts/ConsoleTestHost.cs +++ b/src/Platform/Microsoft.Testing.Platform/Hosts/ConsoleTestHost.cs @@ -15,6 +15,7 @@ namespace Microsoft.Testing.Platform.Hosts; +[StackTraceHidden] internal sealed class ConsoleTestHost( ServiceProvider serviceProvider, Func> buildTestFrameworkAsync, diff --git a/src/Platform/Microsoft.Testing.Platform/Hosts/ServerTestHost.cs b/src/Platform/Microsoft.Testing.Platform/Hosts/ServerTestHost.cs index cce82cc236..fc21a93912 100644 --- a/src/Platform/Microsoft.Testing.Platform/Hosts/ServerTestHost.cs +++ b/src/Platform/Microsoft.Testing.Platform/Hosts/ServerTestHost.cs @@ -21,6 +21,7 @@ namespace Microsoft.Testing.Platform.Hosts; +[StackTraceHidden] internal sealed partial class ServerTestHost : CommonHost, IServerTestHost, IDisposable, IOutputDeviceDataProducer { public const string ProtocolVersion = PlatformVersion.Version; diff --git a/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControlledHost.cs b/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControlledHost.cs index 8236d770b4..4af00861c1 100644 --- a/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControlledHost.cs +++ b/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControlledHost.cs @@ -8,6 +8,7 @@ namespace Microsoft.Testing.Platform.Hosts; [UnsupportedOSPlatform("browser")] +[StackTraceHidden] internal sealed class TestHostControlledHost(NamedPipeClient testHostControllerPipeClient, IHost innerHost, CancellationToken cancellationToken) : IHost, IDisposable #if NETCOREAPP #pragma warning disable SA1001 // Commas should be spaced correctly diff --git a/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControllersTestHost.cs b/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControllersTestHost.cs index d2eb6a5fc5..740dcf7c91 100644 --- a/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControllersTestHost.cs +++ b/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostControllersTestHost.cs @@ -22,6 +22,7 @@ namespace Microsoft.Testing.Platform.Hosts; [UnsupportedOSPlatform("browser")] +[StackTraceHidden] internal sealed class TestHostControllersTestHost : CommonHost, IHost, IDisposable, IOutputDeviceDataProducer { private readonly TestHostControllerConfiguration _testHostsInformation;