From a96095dc6a926e6bfdc45dcedd84ed70c7fa2b96 Mon Sep 17 00:00:00 2001 From: vineeth Hanumanthu Date: Wed, 4 Dec 2019 18:42:05 +0530 Subject: [PATCH 1/3] eqttrace error was thrown if extension uri is not given --- .../Utilities/TestExtensionPluginInformation.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs index ec389d56ec..31186c7cd3 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs @@ -79,6 +79,11 @@ private static string GetExtensionUri(Type testLoggerType) } } + if(string.IsNullOrEmpty(extensionUri)) + { + EqtTrace.Error("Error!! The type \"{0}\" defined in \"{1}\" does not have ExtensionUri attibute.", testLoggerType.ToString(), testLoggerType.Module.Name); + } + return extensionUri; } } From ef7b309640d070796f266adaa51cb2c8ffaf3913 Mon Sep 17 00:00:00 2001 From: vineeth Hanumanthu Date: Tue, 10 Dec 2019 15:52:29 +0530 Subject: [PATCH 2/3] check for eqttrace error is enable or not --- .../Utilities/TestExtensionPluginInformation.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs index 31186c7cd3..f94441a69e 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs @@ -79,9 +79,9 @@ private static string GetExtensionUri(Type testLoggerType) } } - if(string.IsNullOrEmpty(extensionUri)) + if(EqtTrace.IsErrorEnabled && string.IsNullOrEmpty(extensionUri)) { - EqtTrace.Error("Error!! The type \"{0}\" defined in \"{1}\" does not have ExtensionUri attibute.", testLoggerType.ToString(), testLoggerType.Module.Name); + EqtTrace.Error("The type \"{0}\" defined in \"{1}\" does not have ExtensionUri attibute.", testLoggerType.ToString(), testLoggerType.Module.Name); } return extensionUri; From d81f910519799dd1e49cbe4e7e8324fe07f43d9c Mon Sep 17 00:00:00 2001 From: vineeth Hanumanthu Date: Wed, 11 Dec 2019 11:41:12 +0530 Subject: [PATCH 3/3] formatted --- .../Utilities/TestExtensionPluginInformation.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs index f94441a69e..fd94f4f9c6 100644 --- a/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs +++ b/src/Microsoft.TestPlatform.Common/ExtensionFramework/Utilities/TestExtensionPluginInformation.cs @@ -67,7 +67,7 @@ public string ExtensionUri private static string GetExtensionUri(Type testLoggerType) { string extensionUri = string.Empty; - + object[] attributes = testLoggerType.GetTypeInfo().GetCustomAttributes(typeof(ExtensionUriAttribute), false).ToArray(); if (attributes != null && attributes.Length > 0) { @@ -79,7 +79,7 @@ private static string GetExtensionUri(Type testLoggerType) } } - if(EqtTrace.IsErrorEnabled && string.IsNullOrEmpty(extensionUri)) + if (EqtTrace.IsErrorEnabled && string.IsNullOrEmpty(extensionUri)) { EqtTrace.Error("The type \"{0}\" defined in \"{1}\" does not have ExtensionUri attibute.", testLoggerType.ToString(), testLoggerType.Module.Name); }