From fb59898fcf24adf0c738c817ced78fbb38f7c914 Mon Sep 17 00:00:00 2001 From: Codrin-Victor Poienaru Date: Tue, 23 Feb 2021 12:37:08 +0100 Subject: [PATCH] Mark early testhost startup APIs as internal for TP 16.10 (#2768) * Marked test session APIs as internal Co-authored-by: Codrin Poienaru --- .../Interfaces/ITestSession.cs | 2 +- .../Interfaces/ITestSessionAsync.cs | 2 +- .../Interfaces/IVsTestConsoleWrapper.cs | 270 +++++++++--------- .../Interfaces/IVsTestConsoleWrapperAsync.cs | 254 ++++++++-------- .../TestSession.cs | 2 +- .../VsTestConsoleWrapper.cs | 36 +-- 6 files changed, 283 insertions(+), 283 deletions(-) diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITestSession.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITestSession.cs index 206c3aa009..e8e404a061 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITestSession.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITestSession.cs @@ -13,7 +13,7 @@ namespace Microsoft.VisualStudio.TestPlatform.VsTestConsole.TranslationLayer.Int /// Defines a test session that can be used to make calls to the vstest.console /// process. /// - public interface ITestSession : ITestSessionAsync + internal interface ITestSession : ITestSessionAsync { /// /// Starts test discovery. diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITestSessionAsync.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITestSessionAsync.cs index 9c2aff1496..c992ccc569 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITestSessionAsync.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/ITestSessionAsync.cs @@ -13,7 +13,7 @@ namespace Microsoft.VisualStudio.TestPlatform.VsTestConsole.TranslationLayer.Int /// Defines a test session that can be used to make async calls to the vstest.console /// process. /// - public interface ITestSessionAsync + internal interface ITestSessionAsync { /// /// Starts test discovery. diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapper.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapper.cs index d3ea821e1e..fb835235a4 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapper.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapper.cs @@ -53,21 +53,21 @@ void DiscoverTests( TestPlatformOptions options, ITestDiscoveryEventsHandler2 discoveryEventsHandler); - /// - /// Starts test discovery. - /// - /// - /// The list of source assemblies for the discovery. - /// The run settings for the discovery. - /// The test platform options. - /// The test session info object. - /// The discovery event handler. - void DiscoverTests( - IEnumerable sources, - string discoverySettings, - TestPlatformOptions options, - TestSessionInfo testSessionInfo, - ITestDiscoveryEventsHandler2 discoveryEventsHandler); + // + // Starts test discovery. + // + // + // The list of source assemblies for the discovery. + // The run settings for the discovery. + // The test platform options. + // The test session info object. + // The discovery event handler. + // void DiscoverTests( + // IEnumerable sources, + // string discoverySettings, + // TestPlatformOptions options, + // TestSessionInfo testSessionInfo, + // ITestDiscoveryEventsHandler2 discoveryEventsHandler); /// /// Cancels the last discovery request. @@ -100,21 +100,21 @@ void RunTests( TestPlatformOptions options, ITestRunEventsHandler testRunEventsHandler); - /// - /// Starts a test run. - /// - /// - /// The list of source assemblies for the test run. - /// The run settings for the run. - /// The test platform options. - /// The test session info object. - /// The run event handler. - void RunTests( - IEnumerable sources, - string runSettings, - TestPlatformOptions options, - TestSessionInfo testSessionInfo, - ITestRunEventsHandler testRunEventsHandler); + // + // Starts a test run. + // + // + // The list of source assemblies for the test run. + // The run settings for the run. + // The test platform options. + // The test session info object. + // The run event handler. + // void RunTests( + // IEnumerable sources, + // string runSettings, + // TestPlatformOptions options, + // TestSessionInfo testSessionInfo, + // ITestRunEventsHandler testRunEventsHandler); /// /// Starts a test run. @@ -142,21 +142,21 @@ void RunTests( TestPlatformOptions options, ITestRunEventsHandler testRunEventsHandler); - /// - /// Starts a test run. - /// - /// - /// The list of test cases for the test run. - /// The run settings for the run. - /// The test platform options. - /// The test session info object. - /// The run event handler. - void RunTests( - IEnumerable testCases, - string runSettings, - TestPlatformOptions options, - TestSessionInfo testSessionInfo, - ITestRunEventsHandler testRunEventsHandler); + // + // Starts a test run. + // + // + // The list of test cases for the test run. + // The run settings for the run. + // The test platform options. + // The test session info object. + // The run event handler. + // void RunTests( + // IEnumerable testCases, + // string runSettings, + // TestPlatformOptions options, + // TestSessionInfo testSessionInfo, + // ITestRunEventsHandler testRunEventsHandler); /// /// Starts a test run. @@ -188,23 +188,23 @@ void RunTestsWithCustomTestHost( ITestRunEventsHandler testRunEventsHandler, ITestHostLauncher customTestHostLauncher); - /// - /// Starts a test run. - /// - /// - /// The list of source assemblies for the test run. - /// The run settings for the run. - /// The test platform options. - /// The test session info object. - /// The run event handler. - /// The custom host launcher. - void RunTestsWithCustomTestHost( - IEnumerable sources, - string runSettings, - TestPlatformOptions options, - TestSessionInfo testSessionInfo, - ITestRunEventsHandler testRunEventsHandler, - ITestHostLauncher customTestHostLauncher); + // + // Starts a test run. + // + // + // The list of source assemblies for the test run. + // The run settings for the run. + // The test platform options. + // The test session info object. + // The run event handler. + // The custom host launcher. + // void RunTestsWithCustomTestHost( + // IEnumerable sources, + // string runSettings, + // TestPlatformOptions options, + // TestSessionInfo testSessionInfo, + // ITestRunEventsHandler testRunEventsHandler, + // ITestHostLauncher customTestHostLauncher); /// /// Starts a test run. @@ -236,83 +236,83 @@ void RunTestsWithCustomTestHost( ITestRunEventsHandler testRunEventsHandler, ITestHostLauncher customTestHostLauncher); - /// - /// Starts a test run. - /// - /// - /// The list of test cases for the test run. - /// The run settings for the run. - /// The test platform options. - /// The test session info object. - /// The run event handler. - /// The custom host launcher. - void RunTestsWithCustomTestHost( - IEnumerable testCases, - string runSettings, - TestPlatformOptions options, - TestSessionInfo testSessionInfo, - ITestRunEventsHandler testRunEventsHandler, - ITestHostLauncher customTestHostLauncher); + // + // Starts a test run. + // + // + // The list of test cases for the test run. + // The run settings for the run. + // The test platform options. + // The test session info object. + // The run event handler. + // The custom host launcher. + // void RunTestsWithCustomTestHost( + // IEnumerable testCases, + // string runSettings, + // TestPlatformOptions options, + // TestSessionInfo testSessionInfo, + // ITestRunEventsHandler testRunEventsHandler, + // ITestHostLauncher customTestHostLauncher); - /// - /// Starts a new test session. - /// - /// - /// The list of source assemblies for the test run. - /// The run settings for the run. - /// The session event handler. - /// - /// A test session info object. - ITestSession StartTestSession( - IList sources, - string runSettings, - ITestSessionEventsHandler eventsHandler); + // + // Starts a new test session. + // + // + // The list of source assemblies for the test run. + // The run settings for the run. + // The session event handler. + // + // A test session info object. + // ITestSession StartTestSession( + // IList sources, + // string runSettings, + // ITestSessionEventsHandler eventsHandler); - /// - /// Starts a new test session. - /// - /// - /// The list of source assemblies for the test run. - /// The run settings for the run. - /// The test platform options. - /// The session event handler. - /// - /// A test session info object. - ITestSession StartTestSession( - IList sources, - string runSettings, - TestPlatformOptions options, - ITestSessionEventsHandler eventsHandler); + // + // Starts a new test session. + // + // + // The list of source assemblies for the test run. + // The run settings for the run. + // The test platform options. + // The session event handler. + // + // A test session info object. + // ITestSession StartTestSession( + // IList sources, + // string runSettings, + // TestPlatformOptions options, + // ITestSessionEventsHandler eventsHandler); - /// - /// Starts a new test session. - /// - /// - /// The list of source assemblies for the test run. - /// The run settings for the run. - /// The test platform options. - /// The session event handler. - /// The custom host launcher. - /// - /// A test session info object. - ITestSession StartTestSession( - IList sources, - string runSettings, - TestPlatformOptions options, - ITestSessionEventsHandler eventsHandler, - ITestHostLauncher testHostLauncher); + // + // Starts a new test session. + // + // + // The list of source assemblies for the test run. + // The run settings for the run. + // The test platform options. + // The session event handler. + // The custom host launcher. + // + // A test session info object. + // ITestSession StartTestSession( + // IList sources, + // string runSettings, + // TestPlatformOptions options, + // ITestSessionEventsHandler eventsHandler, + // ITestHostLauncher testHostLauncher); - /// - /// Stops the test session. - /// - /// - /// The test session info object. - /// The session event handler. - /// - /// True if the session was successfuly stopped, false otherwise. - bool StopTestSession( - TestSessionInfo testSessionInfo, - ITestSessionEventsHandler eventsHandler); + // + // Stops the test session. + // + // + // The test session info object. + // The session event handler. + // + // True if the session was successfuly stopped, false otherwise. + // bool StopTestSession( + // TestSessionInfo testSessionInfo, + // ITestSessionEventsHandler eventsHandler); /// /// Cancels the last test run. diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs index 136e6eec84..728aa0a951 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/Interfaces/IVsTestConsoleWrapperAsync.cs @@ -55,21 +55,21 @@ Task DiscoverTestsAsync( TestPlatformOptions options, ITestDiscoveryEventsHandler2 discoveryEventsHandler); - /// - /// Asynchronous equivalent of . - /// - Task DiscoverTestsAsync( - IEnumerable sources, - string discoverySettings, - TestPlatformOptions options, - TestSessionInfo testSessionInfo, - ITestDiscoveryEventsHandler2 discoveryEventsHandler); + // + // Asynchronous equivalent of . + // + // Task DiscoverTestsAsync( + // IEnumerable sources, + // string discoverySettings, + // TestPlatformOptions options, + // TestSessionInfo testSessionInfo, + // ITestDiscoveryEventsHandler2 discoveryEventsHandler); /// /// See . @@ -102,21 +102,21 @@ Task RunTestsAsync( TestPlatformOptions options, ITestRunEventsHandler testRunEventsHandler); - /// - /// Asynchronous equivalent of . - /// - Task RunTestsAsync( - IEnumerable sources, - string runSettings, - TestPlatformOptions options, - TestSessionInfo testSessionInfo, - ITestRunEventsHandler testRunEventsHandler); + // + // Asynchronous equivalent of . + // + // Task RunTestsAsync( + // IEnumerable sources, + // string runSettings, + // TestPlatformOptions options, + // TestSessionInfo testSessionInfo, + // ITestRunEventsHandler testRunEventsHandler); /// /// Asynchronous equivalent of . - /// - Task RunTestsAsync( - IEnumerable testCases, - string runSettings, - TestPlatformOptions options, - TestSessionInfo testSessionInfo, - ITestRunEventsHandler testRunEventsHandler); + // + // Asynchronous equivalent of . + // + // Task RunTestsAsync( + // IEnumerable testCases, + // string runSettings, + // TestPlatformOptions options, + // TestSessionInfo testSessionInfo, + // ITestRunEventsHandler testRunEventsHandler); /// /// Asynchronous equivalent of . - /// - Task RunTestsWithCustomTestHostAsync( - IEnumerable sources, - string runSettings, - TestPlatformOptions options, - TestSessionInfo testSessionInfo, - ITestRunEventsHandler testRunEventsHandler, - ITestHostLauncher customTestHostLauncher); + // + // Asynchronous equivalent of . + // + // Task RunTestsWithCustomTestHostAsync( + // IEnumerable sources, + // string runSettings, + // TestPlatformOptions options, + // TestSessionInfo testSessionInfo, + // ITestRunEventsHandler testRunEventsHandler, + // ITestHostLauncher customTestHostLauncher); /// /// Asynchronous equivalent of . - /// - Task RunTestsWithCustomTestHostAsync( - IEnumerable testCases, - string runSettings, - TestPlatformOptions options, - TestSessionInfo testSessionInfo, - ITestRunEventsHandler testRunEventsHandler, - ITestHostLauncher customTestHostLauncher); + // + // Asynchronous equivalent of . + // + // Task RunTestsWithCustomTestHostAsync( + // IEnumerable testCases, + // string runSettings, + // TestPlatformOptions options, + // TestSessionInfo testSessionInfo, + // ITestRunEventsHandler testRunEventsHandler, + // ITestHostLauncher customTestHostLauncher); - /// - /// Asynchronous equivalent of . - /// - Task StartTestSessionAsync( - IList sources, - string runSettings, - ITestSessionEventsHandler eventsHandler); + // + // Asynchronous equivalent of . + // + // Task StartTestSessionAsync( + // IList sources, + // string runSettings, + // ITestSessionEventsHandler eventsHandler); - /// - /// Asynchronous equivalent of . - /// - Task StartTestSessionAsync( - IList sources, - string runSettings, - TestPlatformOptions options, - ITestSessionEventsHandler eventsHandler); + // + // Asynchronous equivalent of . + // + // Task StartTestSessionAsync( + // IList sources, + // string runSettings, + // TestPlatformOptions options, + // ITestSessionEventsHandler eventsHandler); - /// - /// Asynchronous equivalent of . - /// - Task StartTestSessionAsync( - IList sources, - string runSettings, - TestPlatformOptions options, - ITestSessionEventsHandler eventsHandler, - ITestHostLauncher testHostLauncher); + // + // Asynchronous equivalent of . + // + // Task StartTestSessionAsync( + // IList sources, + // string runSettings, + // TestPlatformOptions options, + // ITestSessionEventsHandler eventsHandler, + // ITestHostLauncher testHostLauncher); - /// - /// Asynchronous equivalent of . - /// - Task StopTestSessionAsync( - TestSessionInfo testSessionInfo, - ITestSessionEventsHandler eventsHandler); + // + // Asynchronous equivalent of . + // + // Task StopTestSessionAsync( + // TestSessionInfo testSessionInfo, + // ITestSessionEventsHandler eventsHandler); /// /// See . diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/TestSession.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/TestSession.cs index d97761a4c9..8635d6cfe6 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/TestSession.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/TestSession.cs @@ -15,7 +15,7 @@ namespace Microsoft.TestPlatform.VsTestConsole.TranslationLayer /// Defines a test session object that can be used to make calls to the vstest.console /// process. /// - public class TestSession : ITestSession + internal class TestSession : ITestSession { private TestSessionInfo testSessionInfo; private VsTestConsoleWrapper consoleWrapper; diff --git a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs index 78adc5bb0c..09292008ae 100644 --- a/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs +++ b/src/Microsoft.TestPlatform.VsTestConsole.TranslationLayer/VsTestConsoleWrapper.cs @@ -211,7 +211,7 @@ public void DiscoverTests( } /// - public void DiscoverTests( + internal void DiscoverTests( IEnumerable sources, string discoverySettings, TestPlatformOptions options, @@ -263,7 +263,7 @@ public void RunTests( } /// - public void RunTests( + internal void RunTests( IEnumerable sources, string runSettings, TestPlatformOptions options, @@ -315,7 +315,7 @@ public void RunTests( } /// - public void RunTests( + internal void RunTests( IEnumerable testCases, string runSettings, TestPlatformOptions options, @@ -371,7 +371,7 @@ public void RunTestsWithCustomTestHost( } /// - public void RunTestsWithCustomTestHost( + internal void RunTestsWithCustomTestHost( IEnumerable sources, string runSettings, TestPlatformOptions options, @@ -429,7 +429,7 @@ public void RunTestsWithCustomTestHost( } /// - public void RunTestsWithCustomTestHost( + internal void RunTestsWithCustomTestHost( IEnumerable testCases, string runSettings, TestPlatformOptions options, @@ -455,7 +455,7 @@ public void RunTestsWithCustomTestHost( } /// - public ITestSession StartTestSession( + internal ITestSession StartTestSession( IList sources, string runSettings, ITestSessionEventsHandler eventsHandler) @@ -468,7 +468,7 @@ public ITestSession StartTestSession( } /// - public ITestSession StartTestSession( + internal ITestSession StartTestSession( IList sources, string runSettings, TestPlatformOptions options, @@ -483,7 +483,7 @@ public ITestSession StartTestSession( } /// - public ITestSession StartTestSession( + internal ITestSession StartTestSession( IList sources, string runSettings, TestPlatformOptions options, @@ -504,7 +504,7 @@ public ITestSession StartTestSession( } /// - public bool StopTestSession( + internal bool StopTestSession( TestSessionInfo testSessionInfo, ITestSessionEventsHandler eventsHandler) { @@ -612,7 +612,7 @@ await this.DiscoverTestsAsync( } /// - public async Task DiscoverTestsAsync( + internal async Task DiscoverTestsAsync( IEnumerable sources, string discoverySettings, TestPlatformOptions options, @@ -658,7 +658,7 @@ await this.RunTestsAsync( } /// - public async Task RunTestsAsync( + internal async Task RunTestsAsync( IEnumerable sources, string runSettings, TestPlatformOptions options, @@ -710,7 +710,7 @@ await this.RunTestsAsync( } /// - public async Task RunTestsAsync( + internal async Task RunTestsAsync( IEnumerable testCases, string runSettings, TestPlatformOptions options, @@ -766,7 +766,7 @@ await this.RunTestsWithCustomTestHostAsync( } /// - public async Task RunTestsWithCustomTestHostAsync( + internal async Task RunTestsWithCustomTestHostAsync( IEnumerable sources, string runSettings, TestPlatformOptions options, @@ -824,7 +824,7 @@ await this.RunTestsWithCustomTestHostAsync( } /// - public async Task RunTestsWithCustomTestHostAsync( + internal async Task RunTestsWithCustomTestHostAsync( IEnumerable testCases, string runSettings, TestPlatformOptions options, @@ -850,7 +850,7 @@ await this.requestSender.StartTestRunWithCustomHostAsync( } /// - public async Task StartTestSessionAsync( + internal async Task StartTestSessionAsync( IList sources, string runSettings, ITestSessionEventsHandler eventsHandler) @@ -863,7 +863,7 @@ public async Task StartTestSessionAsync( } /// - public async Task StartTestSessionAsync( + internal async Task StartTestSessionAsync( IList sources, string runSettings, TestPlatformOptions options, @@ -878,7 +878,7 @@ public async Task StartTestSessionAsync( } /// - public async Task StartTestSessionAsync( + internal async Task StartTestSessionAsync( IList sources, string runSettings, TestPlatformOptions options, @@ -899,7 +899,7 @@ await this.requestSender.StartTestSessionAsync( } /// - public async Task StopTestSessionAsync( + internal async Task StopTestSessionAsync( TestSessionInfo testSessionInfo, ITestSessionEventsHandler eventsHandler) {