From 1e3b8933474c8a75cd5676b1c3bd59f7524996dd Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Thu, 10 Oct 2019 16:32:17 +0200 Subject: [PATCH 1/7] updates --- TestPlatform.sln | 19 ++++++++- .../InProcDataCollectionExtensionManager.cs | 10 +++++ .../DataCollection/InProcDataCollector.cs | 15 ++++++- .../InProcDataCollectorTests.cs | 21 +++++++++- ...tPlatform.CrossPlatEngine.UnitTests.csproj | 1 + .../CoverletInProcDataCollector.cs | 39 ++++++++++++++++++ .../coverlet.collector.csproj | 11 +++++ test/TestAssets/coverlet.collector/key.snk | Bin 0 -> 596 bytes 8 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs create mode 100644 test/TestAssets/coverlet.collector/coverlet.collector.csproj create mode 100644 test/TestAssets/coverlet.collector/key.snk diff --git a/TestPlatform.sln b/TestPlatform.sln index 2e140d8990..efbbf64ac9 100644 --- a/TestPlatform.sln +++ b/TestPlatform.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.779 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29319.158 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED0C35EB-7F31-4841-A24F-8EB708FFA959}" EndProject @@ -179,6 +179,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Exte EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Extensions.HtmlLogger.UnitTests", "test\Microsoft.TestPlatform.Extensions.HtmlLogger.UnitTests\Microsoft.TestPlatform.Extensions.HtmlLogger.UnitTests.csproj", "{41248B96-6E15-4E5E-A78F-859897676814}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverlet.collector", "test\TestAssets\coverlet.collector\coverlet.collector.csproj", "{F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -897,6 +899,18 @@ Global {41248B96-6E15-4E5E-A78F-859897676814}.Release|x64.Build.0 = Release|Any CPU {41248B96-6E15-4E5E-A78F-859897676814}.Release|x86.ActiveCfg = Release|Any CPU {41248B96-6E15-4E5E-A78F-859897676814}.Release|x86.Build.0 = Release|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Debug|x64.ActiveCfg = Debug|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Debug|x64.Build.0 = Debug|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Debug|x86.ActiveCfg = Debug|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Debug|x86.Build.0 = Debug|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Release|Any CPU.Build.0 = Release|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Release|x64.ActiveCfg = Release|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Release|x64.Build.0 = Release|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Release|x86.ActiveCfg = Release|Any CPU + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -973,6 +987,7 @@ Global {D16ACC60-52F8-4912-8870-5733A9F6852D} = {8DA7CBD9-F17E-41B6-90C4-CFF55848A25A} {236A71E3-01DA-4679-9DFF-16A8E079ACFF} = {5E7F18A8-F843-4C8A-AB02-4C7D9205C6CF} {41248B96-6E15-4E5E-A78F-859897676814} = {020E15EA-731F-4667-95AF-226671E0C3AE} + {F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3} = {8DA7CBD9-F17E-41B6-90C4-CFF55848A25A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0541B30C-FF51-4E28-B172-83F5F3934BCD} diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs index c9abb9b217..3bd88022ab 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollectionExtensionManager.cs @@ -329,5 +329,15 @@ internal static class Constants /// Test sources property name /// public const string TestSourcesPropertyName = "TestSources"; + + /// + /// Coverlet inproc data collector codebase + /// + public const string CoverletDataCollectorCodebase = "coverlet.collector.dll"; + + /// + /// Coverlet inproc data collector type name + /// + public const string CoverletDataCollectorTypeName = "Coverlet.Collector.DataCollection.CoverletInProcDataCollector"; } } diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs index 88dd845c76..e309b5114c 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs @@ -67,9 +67,20 @@ internal InProcDataCollector(string codeBase, string assemblyQualifiedName, Type this.assemblyLoadContext = assemblyLoadContext; var assembly = this.LoadInProcDataCollectorExtension(codeBase); - this.dataCollectorType = - assembly?.GetTypes() + + if (codeBase == Constants.CoverletDataCollectorCodebase) + { + // if inproc data collector is coverlet we skip version check to allow upgrade throught nuget package upgrade + this.dataCollectorType = + assembly?.GetTypes() + .FirstOrDefault(x => x.FullName.Equals(Constants.CoverletDataCollectorTypeName) && interfaceTypeInfo.IsAssignableFrom(x.GetTypeInfo())); + } + else + { + this.dataCollectorType = + assembly?.GetTypes() .FirstOrDefault(x => x.AssemblyQualifiedName.Equals(assemblyQualifiedName) && interfaceTypeInfo.IsAssignableFrom(x.GetTypeInfo())); + } this.AssemblyQualifiedName = this.dataCollectorType?.AssemblyQualifiedName; } diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs index b7cca3f296..80ff8c18db 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs @@ -5,7 +5,7 @@ namespace TestPlatform.CrossPlatEngine.UnitTests.DataCollection { using System.IO; using System.Reflection; - + using Coverlet.Collector.DataCollection; using Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.DataCollection; using Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.DataCollection.Interfaces; using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection; @@ -79,6 +79,25 @@ public void InProcDataCollectorShouldInitializeIfAssemblyContainsAnyInProcDataCo Assert.AreEqual(this.inProcDataCollector.AssemblyQualifiedName, typeInfo.AssemblyQualifiedName); } + [TestMethod] + public void InProcDataCollectorLoadCoverlet() + { + var typeInfo = typeof(CoverletInProcDataCollector).GetTypeInfo(); + + this.assemblyLoadContext.Setup(alc => alc.LoadAssemblyFromPath(It.IsAny())) + .Returns(typeInfo.Assembly); + + this.inProcDataCollector = new InProcDataCollector( + "coverlet.collector.dll", + "Coverlet.Collector.DataCollection.CoverletInProcDataCollector, coverlet.collector, Version=9.9.9.9, Culture=neutral, PublicKeyToken=null", + typeInfo, + string.Empty, + this.assemblyLoadContext.Object); + + Assert.IsNotNull(this.inProcDataCollector.AssemblyQualifiedName); + Assert.AreEqual(this.inProcDataCollector.AssemblyQualifiedName, typeInfo.AssemblyQualifiedName); + } + private class TestableInProcDataCollector : InProcDataCollection { public void Initialize(IDataCollectionSink dataCollectionSink) diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Microsoft.TestPlatform.CrossPlatEngine.UnitTests.csproj b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Microsoft.TestPlatform.CrossPlatEngine.UnitTests.csproj index 12e0cff4dd..d99d8a4486 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Microsoft.TestPlatform.CrossPlatEngine.UnitTests.csproj +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/Microsoft.TestPlatform.CrossPlatEngine.UnitTests.csproj @@ -18,6 +18,7 @@ true + diff --git a/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs b/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs new file mode 100644 index 0000000000..2ce21ed77b --- /dev/null +++ b/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System; + +using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection; +using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollector.InProcDataCollector; +using Microsoft.VisualStudio.TestPlatform.ObjectModel.InProcDataCollector; + +[assembly: AssemblyKeyFileAttribute("key.snk")] + +namespace Coverlet.Collector.DataCollection +{ + public class CoverletInProcDataCollector : InProcDataCollection + { + public void Initialize(IDataCollectionSink dataCollectionSink) + { + throw new NotImplementedException(); + } + + public void TestCaseEnd(TestCaseEndArgs testCaseEndArgs) + { + throw new NotImplementedException(); + } + + public void TestCaseStart(TestCaseStartArgs testCaseStartArgs) + { + throw new NotImplementedException(); + } + + public void TestSessionEnd(TestSessionEndArgs testSessionEndArgs) + { + throw new NotImplementedException(); + } + + public void TestSessionStart(TestSessionStartArgs testSessionStartArgs) + { + throw new NotImplementedException(); + } + } +} diff --git a/test/TestAssets/coverlet.collector/coverlet.collector.csproj b/test/TestAssets/coverlet.collector/coverlet.collector.csproj new file mode 100644 index 0000000000..6c2ed2d15e --- /dev/null +++ b/test/TestAssets/coverlet.collector/coverlet.collector.csproj @@ -0,0 +1,11 @@ + + + + netcoreapp2.1;net451 + + + + + + + diff --git a/test/TestAssets/coverlet.collector/key.snk b/test/TestAssets/coverlet.collector/key.snk new file mode 100644 index 0000000000000000000000000000000000000000..16bbaafe56640fff2bb1ea859376bf05fc4e16a4 GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096UU80jBuSjUS4)T49si3te?0xBsX&;tH zbNnilKVXtEhuE5L&ca$?U-g4p(}tR`on)~h&?CLFOwu@-$kp3^+N1#-9kGM!V6F~t zvLp)j=FxT60kiI-XMasJ;fF~xwRNVE(p$&}7NK-@PQ@(5BHP@^fauE>f=7esFKD+{ z-ouXH3lZm*4WS#fa^QPKkBQ7I7pz|^T;#%KVPr8d@T+u)=c{? z_bYGk#-K9s=cLW6Pf*4s>OMRAw`&PUFKU$X>{YfoBmDrH^TlEB^c>0(TzO}6iA;5p z!no^e44n7XhV?Fs=4Fc7k}Rns~y1aBE} zoafdvGIV*A_pec`eh^l2T!BAdjTP@!_EKA__9jck$w^BJHMw_C?JYa3n9 ziq2wytQ&fH4>ToBL*KcWp5#3+qn~BZ4uT`&OY24k`+iuhF(-tE{&X7-M{6^ZSUYNO2ucDB`;(lnSYs6VbCS;ZO|&EkWW)A^ ir_C8q96uAQu)_{UzZPv|Z)gd$t8}=7=A2ztk1IMFh8@cQ literal 0 HcmV?d00001 From ace24d7820a8d287a281c16cd4980ad49d3dbbab Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Thu, 10 Oct 2019 16:42:51 +0200 Subject: [PATCH 2/7] updates --- .../DataCollection/InProcDataCollectorTests.cs | 6 ++++-- .../coverlet.collector/CoverletInProcDataCollector.cs | 3 ++- .../TestAssets/coverlet.collector/coverlet.collector.csproj | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs index 80ff8c18db..c6c49bcba7 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs @@ -64,7 +64,7 @@ public void InProcDataCollectorShouldNotThrowExceptionIfAssemblyDoesNotContainAn public void InProcDataCollectorShouldInitializeIfAssemblyContainsAnyInProcDataCollector() { var typeInfo = typeof(TestableInProcDataCollector).GetTypeInfo(); - + this.assemblyLoadContext.Setup(alc => alc.LoadAssemblyFromPath(It.IsAny())) .Returns(typeInfo.Assembly); @@ -84,12 +84,14 @@ public void InProcDataCollectorLoadCoverlet() { var typeInfo = typeof(CoverletInProcDataCollector).GetTypeInfo(); + Assert.AreEqual("9.9.9.9", typeInfo.Assembly.GetName().Version.ToString()); + this.assemblyLoadContext.Setup(alc => alc.LoadAssemblyFromPath(It.IsAny())) .Returns(typeInfo.Assembly); this.inProcDataCollector = new InProcDataCollector( "coverlet.collector.dll", - "Coverlet.Collector.DataCollection.CoverletInProcDataCollector, coverlet.collector, Version=9.9.9.9, Culture=neutral, PublicKeyToken=null", + "Coverlet.Collector.DataCollection.CoverletInProcDataCollector, coverlet.collector, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", typeInfo, string.Empty, this.assemblyLoadContext.Object); diff --git a/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs b/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs index 2ce21ed77b..422505b53a 100644 --- a/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs +++ b/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs @@ -5,7 +5,8 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollector.InProcDataCollector; using Microsoft.VisualStudio.TestPlatform.ObjectModel.InProcDataCollector; -[assembly: AssemblyKeyFileAttribute("key.snk")] +[assembly: AssemblyKeyFile("key.snk")] +[assembly: AssemblyVersion("9.9.9.9")] namespace Coverlet.Collector.DataCollection { diff --git a/test/TestAssets/coverlet.collector/coverlet.collector.csproj b/test/TestAssets/coverlet.collector/coverlet.collector.csproj index 6c2ed2d15e..74bce9aef6 100644 --- a/test/TestAssets/coverlet.collector/coverlet.collector.csproj +++ b/test/TestAssets/coverlet.collector/coverlet.collector.csproj @@ -2,6 +2,7 @@ netcoreapp2.1;net451 + false From c4a4f728a56bdc72a8993c3995f03aae2ad724a5 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Thu, 10 Oct 2019 17:13:56 +0200 Subject: [PATCH 3/7] updates --- .../DataCollection/InProcDataCollector.cs | 3 ++- .../DataCollection/InProcDataCollectorTests.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs index e309b5114c..5130e8f5e9 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs @@ -4,6 +4,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.DataCollection { using System; + using System.IO; using System.Linq; using System.Reflection; @@ -68,7 +69,7 @@ internal InProcDataCollector(string codeBase, string assemblyQualifiedName, Type var assembly = this.LoadInProcDataCollectorExtension(codeBase); - if (codeBase == Constants.CoverletDataCollectorCodebase) + if (Path.GetFileName(codeBase) == Constants.CoverletDataCollectorCodebase) { // if inproc data collector is coverlet we skip version check to allow upgrade throught nuget package upgrade this.dataCollectorType = diff --git a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs index c6c49bcba7..a0fb8316f3 100644 --- a/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs +++ b/test/Microsoft.TestPlatform.CrossPlatEngine.UnitTests/DataCollection/InProcDataCollectorTests.cs @@ -90,9 +90,9 @@ public void InProcDataCollectorLoadCoverlet() .Returns(typeInfo.Assembly); this.inProcDataCollector = new InProcDataCollector( - "coverlet.collector.dll", + typeInfo.Assembly.Location, "Coverlet.Collector.DataCollection.CoverletInProcDataCollector, coverlet.collector, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", - typeInfo, + typeof(InProcDataCollection).GetTypeInfo(), string.Empty, this.assemblyLoadContext.Object); From 1fdba7ff8298ba535d48387f9b5643cd61a97ac0 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Thu, 10 Oct 2019 17:35:23 +0200 Subject: [PATCH 4/7] updates --- .../DataCollection/InProcDataCollector.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs index 5130e8f5e9..74b734de18 100644 --- a/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs +++ b/src/Microsoft.TestPlatform.CrossPlatEngine/DataCollection/InProcDataCollector.cs @@ -69,20 +69,19 @@ internal InProcDataCollector(string codeBase, string assemblyQualifiedName, Type var assembly = this.LoadInProcDataCollectorExtension(codeBase); + Func filterPredicate; if (Path.GetFileName(codeBase) == Constants.CoverletDataCollectorCodebase) { - // if inproc data collector is coverlet we skip version check to allow upgrade throught nuget package upgrade - this.dataCollectorType = - assembly?.GetTypes() - .FirstOrDefault(x => x.FullName.Equals(Constants.CoverletDataCollectorTypeName) && interfaceTypeInfo.IsAssignableFrom(x.GetTypeInfo())); + // If we're loading coverlet collector we skip to check the version of assembly + // to allow upgrade throught nuget package + filterPredicate = (x) => x.FullName.Equals(Constants.CoverletDataCollectorTypeName) && interfaceTypeInfo.IsAssignableFrom(x.GetTypeInfo()); } else { - this.dataCollectorType = - assembly?.GetTypes() - .FirstOrDefault(x => x.AssemblyQualifiedName.Equals(assemblyQualifiedName) && interfaceTypeInfo.IsAssignableFrom(x.GetTypeInfo())); + filterPredicate = (x) => x.AssemblyQualifiedName.Equals(assemblyQualifiedName) && interfaceTypeInfo.IsAssignableFrom(x.GetTypeInfo()); } + this.dataCollectorType = assembly?.GetTypes().FirstOrDefault(filterPredicate); this.AssemblyQualifiedName = this.dataCollectorType?.AssemblyQualifiedName; } From 99c243b471fe8e348df8b322263e2ec42a942b2f Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Wed, 23 Oct 2019 14:57:35 +0200 Subject: [PATCH 5/7] updates --- .../Resources/Resources.Designer.cs | 2 +- src/Microsoft.TestPlatform.Common/Resources/Resources.resx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs b/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs index f41b5b64b8..541a9fb661 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs +++ b/src/Microsoft.TestPlatform.Common/Resources/Resources.Designer.cs @@ -349,7 +349,7 @@ internal static string TestCaseFilterFormatException { } /// - /// Looks up a localized string similar to Unable to find a datacollector with friendly name '[0}'.. + /// Looks up a localized string similar to Unable to find a datacollector with friendly name '{0}'.. /// internal static string UnableToFetchUriString { get { diff --git a/src/Microsoft.TestPlatform.Common/Resources/Resources.resx b/src/Microsoft.TestPlatform.Common/Resources/Resources.resx index 295afaf19e..66a2074364 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/Resources.resx +++ b/src/Microsoft.TestPlatform.Common/Resources/Resources.resx @@ -214,7 +214,7 @@ Incorrect format for TestCaseFilter {0}. Specify the correct format and try again. Note that the incorrect format can lead to no test getting executed. - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. This option works only with vstest.console.exe installed as part of Visual Studio. From a165d0f0692846d4471a3e15b21725f682a5a011 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Thu, 31 Oct 2019 19:21:57 +0100 Subject: [PATCH 6/7] address feedback --- .../Resources/xlf/Resources.cs.xlf | 2 +- .../Resources/xlf/Resources.de.xlf | 2 +- .../Resources/xlf/Resources.es.xlf | 2 +- .../Resources/xlf/Resources.fr.xlf | 2 +- .../Resources/xlf/Resources.it.xlf | 2 +- .../Resources/xlf/Resources.ja.xlf | 2 +- .../Resources/xlf/Resources.ko.xlf | 2 +- .../Resources/xlf/Resources.pl.xlf | 2 +- .../Resources/xlf/Resources.pt-BR.xlf | 2 +- .../Resources/xlf/Resources.ru.xlf | 2 +- .../Resources/xlf/Resources.tr.xlf | 2 +- src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.xlf | 2 +- .../Resources/xlf/Resources.zh-Hans.xlf | 2 +- .../Resources/xlf/Resources.zh-Hant.xlf | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf index 0a40701b47..ed7fa32d4b 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.cs.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.de.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.de.xlf index 6db0433be0..a5d5f3fd62 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.de.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.de.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.es.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.es.xlf index 98f15d6c4b..70b2c90488 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.es.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.es.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.fr.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.fr.xlf index 319ebb94eb..7c2b84f96c 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.fr.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.fr.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.it.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.it.xlf index 80597c87d4..0791feb5ac 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.it.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.it.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ja.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ja.xlf index 14fcbd4bbb..155de1746a 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ja.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ja.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ko.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ko.xlf index 18f4f67a12..d85adad43d 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ko.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ko.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pl.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pl.xlf index 2c173f3ef1..6caf6ee80c 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pl.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pl.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pt-BR.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pt-BR.xlf index 2cc9892273..304f158b87 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pt-BR.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.pt-BR.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ru.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ru.xlf index 0e96e091d8..40a1a8a097 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ru.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.ru.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.tr.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.tr.xlf index c72c287170..c5675bbb55 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.tr.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.tr.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.xlf index 0fb8c3f172..4e6a67d1be 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.xlf @@ -147,7 +147,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hans.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hans.xlf index e7e194c650..bc11395f5e 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hans.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hans.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. diff --git a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hant.xlf b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hant.xlf index fd8cb4981f..8f56f1f738 100644 --- a/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hant.xlf +++ b/src/Microsoft.TestPlatform.Common/Resources/xlf/Resources.zh-Hant.xlf @@ -270,7 +270,7 @@ - Unable to find a datacollector with friendly name '[0}'. + Unable to find a datacollector with friendly name '{0}'. Unable to find a datacollector with friendly name '[0}'. From d72bbebf51bec1cbc70df7c6a5ba72ddb28670c6 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Thu, 31 Oct 2019 19:27:46 +0100 Subject: [PATCH 7/7] Improve test --- .../coverlet.collector/CoverletInProcDataCollector.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs b/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs index 422505b53a..844e681ce6 100644 --- a/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs +++ b/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs @@ -1,4 +1,7 @@ -using System.Reflection; +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Reflection; using System; using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection; @@ -10,6 +13,9 @@ namespace Coverlet.Collector.DataCollection { + // This class MUST have the same full name as + // https://github.com/tonerdo/coverlet/blob/master/src/coverlet.collector/InProcDataCollection/CoverletInProcDataCollector.cs + // to mimic real behaviour public class CoverletInProcDataCollector : InProcDataCollection { public void Initialize(IDataCollectionSink dataCollectionSink)