-
Notifications
You must be signed in to change notification settings - Fork 325
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
Adapter Failed to Load #958 #2156
Merged
Merged
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
98cfefc
committing changes for #958 fix
DineshChirnanchu 5081873
committing changes for #958 fix
DineshChirnanchu f7bb50c
committing tests fixes #958
DineshChirnanchu 6b64b05
Merge remote-tracking branch 'upstream/master'
DineshChirnanchu 0aab6d0
Merge branch 'master' into AdapterFailedToLoad
DineshChirnanchu 3d2ceeb
commtting fixes for tests #958
DineshChirnanchu 520272c
Updated handle class name and downgraded TestMessageLevel Error to Wa…
DineshChirnanchu 1c938a4
Merge remote-tracking branch 'upstream/master'
DineshChirnanchu e89a48c
commit changes to print specific error messages in each case of adapt…
DineshChirnanchu 65418b7
committing new tests for #958
DineshChirnanchu c291d2d
Code changes refined #958
DineshChirnanchu 1fc1a8a
LogWarningOnNoTestsDiscovered change reverted
DineshChirnanchu 40f5291
commit changes improve test results
DineshChirnanchu 2b8895b
Merge branch 'master' of https://github.com/DineshChirnanchu/vstest
DineshChirnanchu 8dbee95
commit latest changes
DineshChirnanchu 0410144
commtting latest changes
DineshChirnanchu 3e62089
Merge remote-tracking branch 'upstream/master'
DineshChirnanchu f6df00e
Merge branch 'master' into AdapterFailedToLoad
DineshChirnanchu afd4420
Reverted TestRunMessage handler unsubscription
DineshChirnanchu 7211af9
Unsubscribed testRunMessage session
DineshChirnanchu 6ab126a
latest changes
DineshChirnanchu c38ecae
Amendments have been done
DineshChirnanchu 96f69f6
Format corrected
DineshChirnanchu da55993
Merge remote-tracking branch 'upstream/master'
DineshChirnanchu 1868b1d
Merge branch 'master' into AdapterFailedToLoad
DineshChirnanchu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...TestPlatform.CommunicationUtilities/EventHandlers/TestExtensionInitializeEventsHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.EventHandlers | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; | ||
|
||
/// <summary> | ||
/// The test run events handler. | ||
/// </summary> | ||
public class TestExtensionInitializeEventsHandler : ITestMessageEventHandler | ||
{ | ||
private ITestRequestHandler requestHandler; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="TestExtensionInitializeEventsHandler"/> class. | ||
/// </summary> | ||
/// <param name="requestHandler">test request handler</param> | ||
public TestExtensionInitializeEventsHandler(ITestRequestHandler requestHandler) | ||
{ | ||
this.requestHandler = requestHandler; | ||
} | ||
|
||
/// <summary> | ||
/// Handles a test run message. | ||
/// </summary> | ||
/// <param name="level"> The level. </param> | ||
/// <param name="message"> The message. </param> | ||
public void HandleLogMessage(TestMessageLevel level, string message) | ||
{ | ||
switch ((TestMessageLevel)level) | ||
{ | ||
case TestMessageLevel.Informational: | ||
EqtTrace.Info(message); | ||
break; | ||
|
||
case TestMessageLevel.Warning: | ||
EqtTrace.Warning(message); | ||
break; | ||
|
||
case TestMessageLevel.Error: | ||
EqtTrace.Error(message); | ||
break; | ||
|
||
default: | ||
EqtTrace.Info(message); | ||
break; | ||
} | ||
|
||
this.requestHandler.SendLog(level, message); | ||
} | ||
|
||
public void HandleRawMessage(string rawMessage) | ||
{ | ||
// No-Op | ||
// TestHost at this point has no functionality where it requires rawmessage | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution | |
using System.Linq; | ||
|
||
using Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework; | ||
using Microsoft.VisualStudio.TestPlatform.Common.Logging; | ||
using Microsoft.VisualStudio.TestPlatform.Common.SettingsProvider; | ||
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities; | ||
using Microsoft.VisualStudio.TestPlatform.CoreUtilities.Tracing; | ||
|
@@ -20,6 +21,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution | |
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine.ClientProtocol; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine.TesthostProtocol; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; | ||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities; | ||
|
||
/// <summary> | ||
|
@@ -28,16 +30,35 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution | |
public class ExecutionManager : IExecutionManager | ||
{ | ||
private readonly ITestPlatformEventSource testPlatformEventSource; | ||
|
||
private BaseRunTests activeTestRun; | ||
|
||
private IRequestData requestData; | ||
private readonly TestSessionMessageLogger sessionMessageLogger; | ||
private ITestMessageEventHandler testMessageEventsHandler; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ExecutionManager"/> class. | ||
/// </summary> | ||
public ExecutionManager(IRequestData requestData) : this(TestPlatformEventSource.Instance, requestData) | ||
{ | ||
this.sessionMessageLogger = TestSessionMessageLogger.Instance; | ||
this.sessionMessageLogger.TestRunMessage += this.TestSessionMessageHandler; | ||
} | ||
|
||
private void TestSessionMessageHandler(object sender, TestRunMessageEventArgs e) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move private to bottom There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moved under private methods region |
||
{ | ||
if (this.testMessageEventsHandler != null) | ||
{ | ||
this.testMessageEventsHandler.HandleLogMessage(e.Level, e.Message); | ||
} | ||
else | ||
{ | ||
if (EqtTrace.IsWarningEnabled) | ||
{ | ||
EqtTrace.Warning( | ||
"ExecutionManager: Could not pass the log message '{0}' as the callback is null.", | ||
e.Message); | ||
} | ||
} | ||
} | ||
|
||
/// <summary> | ||
|
@@ -56,8 +77,9 @@ protected ExecutionManager(ITestPlatformEventSource testPlatformEventSource, IRe | |
/// Initializes the execution manager. | ||
/// </summary> | ||
/// <param name="pathToAdditionalExtensions"> The path to additional extensions. </param> | ||
public void Initialize(IEnumerable<string> pathToAdditionalExtensions) | ||
public void Initialize(IEnumerable<string> pathToAdditionalExtensions, ITestMessageEventHandler testMessageEventsHandler) | ||
{ | ||
this.testMessageEventsHandler = testMessageEventsHandler; | ||
this.testPlatformEventSource.AdapterSearchStart(); | ||
|
||
if (pathToAdditionalExtensions != null && pathToAdditionalExtensions.Any()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be testExtensionInitializeEventsHandler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will go ahead with this once we finalize the permanent fix for it