From afd1066b5fc44c405b89d4561998492da53dbf7a Mon Sep 17 00:00:00 2001 From: nohwnd Date: Tue, 18 Feb 2020 08:30:50 +0100 Subject: [PATCH 01/33] Fixing acceptance tests --- NuGet.config | 2 +- TestPlatform.sln | 183 +---------- global.json | 3 + scripts/build.ps1 | 29 +- scripts/build/TestPlatform.Dependencies.props | 13 +- scripts/build/TestPlatform.Settings.targets | 4 +- src/testhost.x86/Program.cs | 3 + src/testhost.x86/TestPlatformTraceListener.cs | 114 +++++++ src/testhost/testhost.csproj | 1 + .../AcceptanceTestBase.cs | 8 +- .../DebugAssertTests.cs | 27 ++ .../TranslationLayerTests/RunTests.cs | 2 +- ...tPlatform.CrossPlatEngine.UnitTests.csproj | 2 +- ...tPlatform.ObjectModel.PlatformTests.csproj | 3 - .../IntegrationTestBase.cs | 4 +- .../IntegrationTestEnvironment.cs | 9 +- .../Debug/ConsoleNativeApp.log | 1 + ...soleNativeApp.vcxproj.FileListAbsolute.txt | 0 ...tAsset.ConsoleNativeApp.Build.CppClean.log | 0 .../CrashingOnDebugAssertTestProject.csproj | Bin 0 -> 1692 bytes .../DebugTests.cs | 15 + test/TestAssets/NuGet.config | 16 + .../SimpleTestProject3.csproj | 13 +- test/TestAssets/TestAssets.sln/TestAssets.sln | 285 ++++++++++++++++++ .../CoverletInProcDataCollector.cs | 0 .../coverlet.collector.csproj | 3 +- .../coverlet.collector/key.snk | Bin 27 files changed, 549 insertions(+), 191 deletions(-) create mode 100644 src/testhost.x86/TestPlatformTraceListener.cs create mode 100644 test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs create mode 100644 test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.log create mode 100644 test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.vcxproj.FileListAbsolute.txt create mode 100644 test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/Microsoft.TestPlatform.TestAsset.ConsoleNativeApp.Build.CppClean.log create mode 100644 test/TestAssets/CrashingOnDebugAssertTestProject/CrashingOnDebugAssertTestProject.csproj create mode 100644 test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs create mode 100644 test/TestAssets/NuGet.config rename test/{TestAssets => }/coverlet.collector/CoverletInProcDataCollector.cs (100%) rename test/{TestAssets => }/coverlet.collector/coverlet.collector.csproj (64%) rename test/{TestAssets => }/coverlet.collector/key.snk (100%) diff --git a/NuGet.config b/NuGet.config index abef7d7e43..5c36dcbf71 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + diff --git a/TestPlatform.sln b/TestPlatform.sln index b592e87249..1fc804afa4 100644 --- a/TestPlatform.sln +++ b/TestPlatform.sln @@ -68,14 +68,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "vstest.console.UnitTests", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests", "test\Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests\Microsoft.TestPlatform.Extensions.TrxLogger.UnitTests.csproj", "{BFF7714C-E5A3-4EEB-B04B-5FA47F29AD03}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{B9AB7A3D-4F63-48D2-86C0-70F52F6509AB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.E2ETest", "samples\Microsoft.TestPlatform.E2ETest\Microsoft.TestPlatform.E2ETest.csproj", "{B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.TranslationLayer.E2ETest", "samples\Microsoft.TestPlatform.TranslationLayer.E2ETest\Microsoft.TestPlatform.TranslationLayer.E2ETest.csproj", "{0DD55440-38DC-4580-879C-70B043F77B1C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTestProject", "samples\UnitTestProject\UnitTestProject.csproj", "{4514113D-07C0-4062-A673-04F188A79B7D}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{EE49F5DC-5835-4AE3-B3BA-8BDE0AD56330}" ProjectSection(SolutionItems) = preProject scripts\build.ps1 = scripts\build.ps1 @@ -101,16 +93,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Obje EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{D27E1CB4-C641-4C6C-A140-EF5F6215AE29}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestAssets", "TestAssets", "{8DA7CBD9-F17E-41B6-90C4-CFF55848A25A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Protocol", "samples\Microsoft.TestPlatform.Protocol\Microsoft.TestPlatform.Protocol.csproj", "{97DD9467-B011-4736-AAC4-2C21BF554349}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Build.UnitTests", "test\Microsoft.TestPlatform.Build.UnitTests\Microsoft.TestPlatform.Build.UnitTests.csproj", "{EFA38DEF-C2BB-42AE-8B68-B31D79F3107E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleClassLibrary", "test\TestAssets\SimpleClassLibrary\SimpleClassLibrary.csproj", "{0D85D957-6FF2-4620-B766-B708801D97F3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleTestProject3", "test\TestAssets\SimpleTestProject3\SimpleTestProject3.csproj", "{9549C1A4-CB57-4689-B3EB-F752F65F863F}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "datacollector.UnitTests", "test\datacollector.UnitTests\datacollector.UnitTests.csproj", "{0C6EFAF9-CE3E-4C11-8DD8-D7DABB206E5C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.PlatformAbstractions", "src\Microsoft.TestPlatform.PlatformAbstractions\Microsoft.TestPlatform.PlatformAbstractions.csproj", "{CAE652AF-6801-425E-AAF3-AB20DE7DF88E}" @@ -143,8 +127,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Exte EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests", "test\Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests\Microsoft.TestPlatform.Extensions.BlameDataCollector.UnitTests.csproj", "{488675EC-C8BB-40E0-AD4F-91F623D548B3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleProjectWithOldTestHost", "test\TestAssets\SampleProjectWithOldTestHost\SampleProjectWithOldTestHost.csproj", "{DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataCollectors", "DataCollectors", "{B705537C-B82C-4A30-AFA5-6244D9A7DAEB}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Extensions.EventLogCollector", "src\DataCollectors\Microsoft.TestPlatform.Extensions.EventLogCollector\Microsoft.TestPlatform.Extensions.EventLogCollector.csproj", "{65A25D6E-C9CC-4F45-8925-04087AC82634}" @@ -153,8 +135,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataCollectors", "DataColle EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests", "test\DataCollectors\Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests\Microsoft.TestPlatform.Extensions.EventLogCollector.UnitTests.csproj", "{21DB138B-85B7-479E-91FE-01E0F972EC56}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventLogUnitTestProject", "test\TestAssets\EventLogUnitTestProject\EventLogUnitTestProject.csproj", "{826CD5AF-44FA-40F6-B731-3980CADED8C0}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "perf", "perf", "{0D4DF78D-7E5F-4516-B19F-E6AA71A1DBF4}" ProjectSection(SolutionItems) = preProject scripts\perf\perf.ps1 = scripts\perf\perf.ps1 @@ -173,15 +153,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SettingsMigrator", "src\Set EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SettingsMigrator.UnitTests", "test\SettingsMigrator.UnitTests\SettingsMigrator.UnitTests.csproj", "{E7D4921C-F12D-4E1C-85AC-8B7F91C59B0E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DiscoveryTestProject", "test\TestAssets\DiscoveryTestProject\DiscoveryTestProject.csproj", "{D16ACC60-52F8-4912-8870-5733A9F6852D}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.TestPlatform.Extensions.HtmlLogger", "src\Microsoft.TestPlatform.Extensions.HtmlLogger\Microsoft.TestPlatform.Extensions.HtmlLogger.csproj", "{236A71E3-01DA-4679-9DFF-16A8E079ACFF}" 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("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.collector", "test\TestAssets\coverlet.collector\coverlet.collector.csproj", "{F1D8630D-97D5-4CD7-BC18-A5E1779FA6E3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectFileRunSettingsTestProject", "test\TestAssets\ProjectFileRunSettingsTestProject\ProjectFileRunSettingsTestProject.csproj", "{8E87F6E4-E884-4404-B2E5-CBFB28038AE5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "coverlet.collector", "test\coverlet.collector\coverlet.collector.csproj", "{074F5BD6-DC05-460B-B78F-044D125FD787}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -493,42 +469,6 @@ Global {BFF7714C-E5A3-4EEB-B04B-5FA47F29AD03}.Release|x64.Build.0 = Release|Any CPU {BFF7714C-E5A3-4EEB-B04B-5FA47F29AD03}.Release|x86.ActiveCfg = Release|Any CPU {BFF7714C-E5A3-4EEB-B04B-5FA47F29AD03}.Release|x86.Build.0 = Release|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Debug|x64.ActiveCfg = Debug|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Debug|x64.Build.0 = Debug|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Debug|x86.ActiveCfg = Debug|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Debug|x86.Build.0 = Debug|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Release|Any CPU.Build.0 = Release|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Release|x64.ActiveCfg = Release|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Release|x64.Build.0 = Release|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Release|x86.ActiveCfg = Release|Any CPU - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD}.Release|x86.Build.0 = Release|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Debug|x64.ActiveCfg = Debug|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Debug|x64.Build.0 = Debug|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Debug|x86.ActiveCfg = Debug|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Debug|x86.Build.0 = Debug|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Release|Any CPU.Build.0 = Release|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Release|x64.ActiveCfg = Release|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Release|x64.Build.0 = Release|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Release|x86.ActiveCfg = Release|Any CPU - {0DD55440-38DC-4580-879C-70B043F77B1C}.Release|x86.Build.0 = Release|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Debug|x64.ActiveCfg = Debug|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Debug|x64.Build.0 = Debug|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Debug|x86.ActiveCfg = Debug|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Debug|x86.Build.0 = Debug|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Release|Any CPU.Build.0 = Release|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Release|x64.ActiveCfg = Release|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Release|x64.Build.0 = Release|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Release|x86.ActiveCfg = Release|Any CPU - {4514113D-07C0-4062-A673-04F188A79B7D}.Release|x86.Build.0 = Release|Any CPU {DD9382B5-5EC4-4B3D-BEB7-95423731AE29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DD9382B5-5EC4-4B3D-BEB7-95423731AE29}.Debug|Any CPU.Build.0 = Debug|Any CPU {DD9382B5-5EC4-4B3D-BEB7-95423731AE29}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -577,18 +517,6 @@ Global {107F28E1-6E91-4A06-8943-E5E5A7E4CA66}.Release|x64.Build.0 = Release|Any CPU {107F28E1-6E91-4A06-8943-E5E5A7E4CA66}.Release|x86.ActiveCfg = Release|Any CPU {107F28E1-6E91-4A06-8943-E5E5A7E4CA66}.Release|x86.Build.0 = Release|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Debug|x64.ActiveCfg = Debug|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Debug|x64.Build.0 = Debug|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Debug|x86.ActiveCfg = Debug|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Debug|x86.Build.0 = Debug|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Release|Any CPU.ActiveCfg = Release|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Release|Any CPU.Build.0 = Release|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Release|x64.ActiveCfg = Release|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Release|x64.Build.0 = Release|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Release|x86.ActiveCfg = Release|Any CPU - {97DD9467-B011-4736-AAC4-2C21BF554349}.Release|x86.Build.0 = Release|Any CPU {EFA38DEF-C2BB-42AE-8B68-B31D79F3107E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EFA38DEF-C2BB-42AE-8B68-B31D79F3107E}.Debug|Any CPU.Build.0 = Debug|Any CPU {EFA38DEF-C2BB-42AE-8B68-B31D79F3107E}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -601,30 +529,6 @@ Global {EFA38DEF-C2BB-42AE-8B68-B31D79F3107E}.Release|x64.Build.0 = Release|Any CPU {EFA38DEF-C2BB-42AE-8B68-B31D79F3107E}.Release|x86.ActiveCfg = Release|Any CPU {EFA38DEF-C2BB-42AE-8B68-B31D79F3107E}.Release|x86.Build.0 = Release|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Debug|x64.ActiveCfg = Debug|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Debug|x64.Build.0 = Debug|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Debug|x86.ActiveCfg = Debug|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Debug|x86.Build.0 = Debug|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Release|Any CPU.Build.0 = Release|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Release|x64.ActiveCfg = Release|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Release|x64.Build.0 = Release|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Release|x86.ActiveCfg = Release|Any CPU - {0D85D957-6FF2-4620-B766-B708801D97F3}.Release|x86.Build.0 = Release|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Debug|x64.ActiveCfg = Debug|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Debug|x64.Build.0 = Debug|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Debug|x86.ActiveCfg = Debug|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Debug|x86.Build.0 = Debug|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Release|Any CPU.Build.0 = Release|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Release|x64.ActiveCfg = Release|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Release|x64.Build.0 = Release|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Release|x86.ActiveCfg = Release|Any CPU - {9549C1A4-CB57-4689-B3EB-F752F65F863F}.Release|x86.Build.0 = Release|Any CPU {0C6EFAF9-CE3E-4C11-8DD8-D7DABB206E5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0C6EFAF9-CE3E-4C11-8DD8-D7DABB206E5C}.Debug|Any CPU.Build.0 = Debug|Any CPU {0C6EFAF9-CE3E-4C11-8DD8-D7DABB206E5C}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -745,18 +649,6 @@ Global {488675EC-C8BB-40E0-AD4F-91F623D548B3}.Release|x64.Build.0 = Release|Any CPU {488675EC-C8BB-40E0-AD4F-91F623D548B3}.Release|x86.ActiveCfg = Release|Any CPU {488675EC-C8BB-40E0-AD4F-91F623D548B3}.Release|x86.Build.0 = Release|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Debug|x64.ActiveCfg = Debug|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Debug|x64.Build.0 = Debug|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Debug|x86.ActiveCfg = Debug|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Debug|x86.Build.0 = Debug|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Release|Any CPU.Build.0 = Release|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Release|x64.ActiveCfg = Release|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Release|x64.Build.0 = Release|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Release|x86.ActiveCfg = Release|Any CPU - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46}.Release|x86.Build.0 = Release|Any CPU {65A25D6E-C9CC-4F45-8925-04087AC82634}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {65A25D6E-C9CC-4F45-8925-04087AC82634}.Debug|Any CPU.Build.0 = Debug|Any CPU {65A25D6E-C9CC-4F45-8925-04087AC82634}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -781,18 +673,6 @@ Global {21DB138B-85B7-479E-91FE-01E0F972EC56}.Release|x64.Build.0 = Release|Any CPU {21DB138B-85B7-479E-91FE-01E0F972EC56}.Release|x86.ActiveCfg = Release|Any CPU {21DB138B-85B7-479E-91FE-01E0F972EC56}.Release|x86.Build.0 = Release|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Debug|x64.ActiveCfg = Debug|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Debug|x64.Build.0 = Debug|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Debug|x86.ActiveCfg = Debug|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Debug|x86.Build.0 = Debug|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Release|Any CPU.Build.0 = Release|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Release|x64.ActiveCfg = Release|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Release|x64.Build.0 = Release|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Release|x86.ActiveCfg = Release|Any CPU - {826CD5AF-44FA-40F6-B731-3980CADED8C0}.Release|x86.Build.0 = Release|Any CPU {8C068694-23A2-47A2-A0DD-DB82D0AF0142}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8C068694-23A2-47A2-A0DD-DB82D0AF0142}.Debug|Any CPU.Build.0 = Debug|Any CPU {8C068694-23A2-47A2-A0DD-DB82D0AF0142}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -865,18 +745,6 @@ Global {E7D4921C-F12D-4E1C-85AC-8B7F91C59B0E}.Release|x64.Build.0 = Release|Any CPU {E7D4921C-F12D-4E1C-85AC-8B7F91C59B0E}.Release|x86.ActiveCfg = Release|Any CPU {E7D4921C-F12D-4E1C-85AC-8B7F91C59B0E}.Release|x86.Build.0 = Release|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Debug|x64.ActiveCfg = Debug|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Debug|x64.Build.0 = Debug|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Debug|x86.ActiveCfg = Debug|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Debug|x86.Build.0 = Debug|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Release|Any CPU.Build.0 = Release|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Release|x64.ActiveCfg = Release|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Release|x64.Build.0 = Release|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Release|x86.ActiveCfg = Release|Any CPU - {D16ACC60-52F8-4912-8870-5733A9F6852D}.Release|x86.Build.0 = Release|Any CPU {236A71E3-01DA-4679-9DFF-16A8E079ACFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {236A71E3-01DA-4679-9DFF-16A8E079ACFF}.Debug|Any CPU.Build.0 = Debug|Any CPU {236A71E3-01DA-4679-9DFF-16A8E079ACFF}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -901,30 +769,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 - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Debug|x64.ActiveCfg = Debug|Any CPU - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Debug|x64.Build.0 = Debug|Any CPU - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Debug|x86.ActiveCfg = Debug|Any CPU - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Debug|x86.Build.0 = Debug|Any CPU - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Release|Any CPU.Build.0 = Release|Any CPU - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Release|x64.ActiveCfg = Release|Any CPU - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Release|x64.Build.0 = Release|Any CPU - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Release|x86.ActiveCfg = Release|Any CPU - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5}.Release|x86.Build.0 = Release|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Debug|Any CPU.Build.0 = Debug|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Debug|x64.ActiveCfg = Debug|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Debug|x64.Build.0 = Debug|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Debug|x86.ActiveCfg = Debug|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Debug|x86.Build.0 = Debug|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Release|Any CPU.ActiveCfg = Release|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Release|Any CPU.Build.0 = Release|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Release|x64.ActiveCfg = Release|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Release|x64.Build.0 = Release|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Release|x86.ActiveCfg = Release|Any CPU + {074F5BD6-DC05-460B-B78F-044D125FD787}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -959,19 +815,12 @@ Global {9EFCEFB5-253E-4DE2-8A70-821D7B8189DF} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6} {3A8080FB-9C93-45B9-8EB5-828DDC31FDF0} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6} {BFF7714C-E5A3-4EEB-B04B-5FA47F29AD03} = {020E15EA-731F-4667-95AF-226671E0C3AE} - {B2C2FFD5-3C7D-42A3-B9B6-DEF63DE969AD} = {B9AB7A3D-4F63-48D2-86C0-70F52F6509AB} - {0DD55440-38DC-4580-879C-70B043F77B1C} = {B9AB7A3D-4F63-48D2-86C0-70F52F6509AB} - {4514113D-07C0-4062-A673-04F188A79B7D} = {B9AB7A3D-4F63-48D2-86C0-70F52F6509AB} {DD9382B5-5EC4-4B3D-BEB7-95423731AE29} = {46250E12-4CF1-4051-B4A7-80C8C06E0068} {156F8811-28BB-4EC7-87D9-434F10FB7DBE} = {46250E12-4CF1-4051-B4A7-80C8C06E0068} {A5B167ED-873A-4762-9326-5F43B8D3AFF6} = {595BE9C1-E10F-4E50-938A-E6C248D3F950} {107F28E1-6E91-4A06-8943-E5E5A7E4CA66} = {376C19DE-31E2-4FF6-88FC-0D0D6233C999} {D27E1CB4-C641-4C6C-A140-EF5F6215AE29} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959} - {8DA7CBD9-F17E-41B6-90C4-CFF55848A25A} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6} - {97DD9467-B011-4736-AAC4-2C21BF554349} = {B9AB7A3D-4F63-48D2-86C0-70F52F6509AB} {EFA38DEF-C2BB-42AE-8B68-B31D79F3107E} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6} - {0D85D957-6FF2-4620-B766-B708801D97F3} = {8DA7CBD9-F17E-41B6-90C4-CFF55848A25A} - {9549C1A4-CB57-4689-B3EB-F752F65F863F} = {8DA7CBD9-F17E-41B6-90C4-CFF55848A25A} {0C6EFAF9-CE3E-4C11-8DD8-D7DABB206E5C} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6} {CAE652AF-6801-425E-AAF3-AB20DE7DF88E} = {7D4082EA-7AC9-4DFB-98E8-C5E08BDC0EC3} {FF80D706-8309-4E02-BAC0-D28B4CBCF600} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6} @@ -985,12 +834,10 @@ Global {11ECCB8B-6958-42A7-BD58-88C09CB149B2} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959} {76D4BB7E-D981-42D5-BE96-6FAD8DEF9A4A} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959} {488675EC-C8BB-40E0-AD4F-91F623D548B3} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6} - {DFF82C76-9498-4E8B-8B5E-D12E2B92FA46} = {8DA7CBD9-F17E-41B6-90C4-CFF55848A25A} {B705537C-B82C-4A30-AFA5-6244D9A7DAEB} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959} {65A25D6E-C9CC-4F45-8925-04087AC82634} = {B705537C-B82C-4A30-AFA5-6244D9A7DAEB} {D9A30E32-D466-4EC5-B4F2-62E17562279B} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6} {21DB138B-85B7-479E-91FE-01E0F972EC56} = {D9A30E32-D466-4EC5-B4F2-62E17562279B} - {826CD5AF-44FA-40F6-B731-3980CADED8C0} = {8DA7CBD9-F17E-41B6-90C4-CFF55848A25A} {0D4DF78D-7E5F-4516-B19F-E6AA71A1DBF4} = {EE49F5DC-5835-4AE3-B3BA-8BDE0AD56330} {8C068694-23A2-47A2-A0DD-DB82D0AF0142} = {376C19DE-31E2-4FF6-88FC-0D0D6233C999} {24C7683D-2607-4901-B8EB-83A57E49E93D} = {376C19DE-31E2-4FF6-88FC-0D0D6233C999} @@ -998,11 +845,9 @@ Global {A7E2261B-B2E6-4CBF-983F-E3A3FF8E52E3} = {D9A30E32-D466-4EC5-B4F2-62E17562279B} {69F5FF81-5615-4F06-B83C-FCF979BB84CA} = {ED0C35EB-7F31-4841-A24F-8EB708FFA959} {E7D4921C-F12D-4E1C-85AC-8B7F91C59B0E} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6} - {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} - {8E87F6E4-E884-4404-B2E5-CBFB28038AE5} = {8DA7CBD9-F17E-41B6-90C4-CFF55848A25A} + {074F5BD6-DC05-460B-B78F-044D125FD787} = {B27FAFDF-2DBA-4AB0-BA85-FD5F21D359D6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0541B30C-FF51-4E28-B172-83F5F3934BCD} diff --git a/global.json b/global.json index 1321affc3d..4a95625d63 100644 --- a/global.json +++ b/global.json @@ -5,5 +5,8 @@ "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20052.1", "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20052.1" + }, + "sdk": { + "version": "3.1.100" } } \ No newline at end of file diff --git a/scripts/build.ps1 b/scripts/build.ps1 index c424f75357..26ee6ad4aa 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -207,6 +207,19 @@ function Invoke-Build Set-ScriptFailedOnError + Write-Log "Invoke-Build: Complete. {$(Get-ElapsedTime($timer))}" +} + +function Invoke-TestAssetsBuild +{ + $timer = Start-Timer + Write-Log "Invoke-TestAssetsBuild: Start test assets build." + $dotnetExe = Get-DotNetPath + + # clean up packages that we built from the cache so we grab them from the source + $packages = $TPB_TestAssets_Solution | Split-Path | Join-Path -ChildPath packages + Get-ChildItem $packages -Filter "Microsoft.*" | Remove-Item -Recurse -Force -Confirm:$false -Verbose + Write-Log ".. .. Build: Source: $TPB_TestAssets_Solution" Write-Verbose "$dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild" & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild @@ -214,7 +227,17 @@ function Invoke-Build Set-ScriptFailedOnError - Write-Log "Invoke-Build: Complete. {$(Get-ElapsedTime($timer))}" + Write-Log "Invoke-TestAssetsBuild: Complete. {$(Get-ElapsedTime($timer))}" +} + +function Copy-PackageIntoStaticDirectory { + # packages are published into folder based on configuration, but + # nuget does not understand that, and does not support wildcards in paths + # in order to be able to use the produced packages for acceptance tests we + # need to put them in folder that is not changing it's name based on config + $tpPackagesPath = "$env:TP_OUT_DIR\$TPB_Configuration\packages\" + $tpPackagesDestination = "$env:TP_TESTARTIFACTS" + Copy-Item $tpPackagesPath $tpPackagesDestination -Force -Filter *.nupkg -Verbose -Recurse } function Publish-PatchedDotnet { @@ -926,11 +949,13 @@ Restore-Package Update-LocalizedResources Invoke-Build Publish-Package -Publish-PatchedDotnet Publish-Tests Create-VsixPackage Create-NugetPackages Generate-Manifest +Publish-PatchedDotnet +Copy-PackageIntoStaticDirectory +Invoke-TestAssetsBuild Write-Log "Build complete. {$(Get-ElapsedTime($timer))}" if ($Script:ScriptFailed) { Exit 1 } else { Exit 0 } \ No newline at end of file diff --git a/scripts/build/TestPlatform.Dependencies.props b/scripts/build/TestPlatform.Dependencies.props index 50026c9a5a..6dc5fb11fe 100644 --- a/scripts/build/TestPlatform.Dependencies.props +++ b/scripts/build/TestPlatform.Dependencies.props @@ -4,10 +4,17 @@ 15.8.3247 - 15.5.0 - 1.4.0 - 1.4.0 + + $(Version) + 16.6.0-dev + + + 99.99.99-dev + + 2.1.0 + 2.1.0 1.0.3-preview 2.3.1 diff --git a/scripts/build/TestPlatform.Settings.targets b/scripts/build/TestPlatform.Settings.targets index f53e540520..253dd27ec5 100644 --- a/scripts/build/TestPlatform.Settings.targets +++ b/scripts/build/TestPlatform.Settings.targets @@ -2,7 +2,9 @@ $(MSBuildThisFileDirectory)../../ - 16.5.0 + + 16.6.0 - - true - diff --git a/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs b/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs index 9aa4880d2b..b31fe12574 100644 --- a/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs +++ b/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestBase.cs @@ -112,7 +112,7 @@ public void InvokeVsTest(string arguments) /// - /// Invokes vstest.console with specified arguments. + /// Invokes our local copy of dotnet that is patched with artifacts from the build with specified arguments. /// /// Arguments provided to vstest.console.exe public void InvokeDotnetTest(string arguments) @@ -527,7 +527,7 @@ private void ExecutePatchedDotnet(string command, string args, out string stdOut ["DOTNET_MULTILEVEL_LOOKUP"] = "0" }; - var patchedDotnetPath = Path.Combine(this.testEnvironment.TestArtifactsDirectory, @"dotnet\dotnet.exe"); ; + var patchedDotnetPath = Path.Combine(this.testEnvironment.TestArtifactsDirectory, @"dotnet\dotnet.exe"); this.ExecuteApplication(patchedDotnetPath, string.Join(" ", command, args), out stdOut, out stdError, out exitCode, environmentVariables); } diff --git a/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestEnvironment.cs b/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestEnvironment.cs index af9389c9e5..98be4f33b8 100644 --- a/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestEnvironment.cs +++ b/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestEnvironment.cs @@ -294,7 +294,14 @@ private static Dictionary GetDependencies(string testPlatformRoo { if (props.IsStartElement() && !string.IsNullOrEmpty(props.Name)) { - dependencyProps.Add(props.Name, props.ReadElementContentAsString()); + if (!dependencyProps.ContainsKey(props.Name)) + { + dependencyProps.Add(props.Name, props.ReadElementContentAsString()); + } + else + { + dependencyProps[props.Name] = string.Join(", ", dependencyProps[props.Name], props.ReadElementContentAsString()); + } } props.Read(); } diff --git a/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.log b/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.log new file mode 100644 index 0000000000..3dbfe80b92 --- /dev/null +++ b/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.log @@ -0,0 +1 @@ +C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.16299.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". diff --git a/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.vcxproj.FileListAbsolute.txt b/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/Microsoft.TestPlatform.TestAsset.ConsoleNativeApp.Build.CppClean.log b/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/Microsoft.TestPlatform.TestAsset.ConsoleNativeApp.Build.CppClean.log new file mode 100644 index 0000000000..e69de29bb2 diff --git a/test/TestAssets/CrashingOnDebugAssertTestProject/CrashingOnDebugAssertTestProject.csproj b/test/TestAssets/CrashingOnDebugAssertTestProject/CrashingOnDebugAssertTestProject.csproj new file mode 100644 index 0000000000000000000000000000000000000000..c850afaf4595fe71fb4f377b3c1b743a06de6dae GIT binary patch literal 1692 zcmd6oOHTqp5QOV&;(u6;2R*Q;2TzDGzQRF6)Og~8xDeza*##eeUj2H86^0e{qA?q0 zo0+bj>gt}^x7Uge^sIsUiu9;NsWNr-prQ7)t{uhN<{hyzREzmLR)^}i)rrPxtAy7c zJ_o95RV%8fPLv1TgK6Or=?YZOAqW8Q^_#c$|V z6SC=(TjNs(F`lM_F)#(o!Txz>bv23GW9+~@B3c5%)HcgBe_=MPj4ALp`P9j;Nxp5T z{Qy0V3;epwn8u%HYaQVg_g!JRSruP&=G2*ho7Kg8UbAQF^cd?Dt4XC3Jvk0N_Nt3e#X%%Y4xo+t55G( zeXY~Z>HNHd;}5Ht_x#B)oxD~zE`EMytJ=_J5V061L~J?5!nwtIm`3wmTFh$^@tyzA zbvQ&PtFI}aqE@)m&ol^Qgt`8w{FmR2v;HXFl3(|Nzg=^@N83qExKr$&pKzXjR}njr R%TA8}UgT#m|6=$WzXJ>A5^Vqg literal 0 HcmV?d00001 diff --git a/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs b/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs new file mode 100644 index 0000000000..152826a596 --- /dev/null +++ b/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs @@ -0,0 +1,15 @@ +using System.Diagnostics; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace CrashingOnDebugAssertTestProject +{ + [TestClass] + public class DebugTests + { + [TestMethod] + public void AssertDebug() + { + Debug.Assert(true == false); + } + } +} diff --git a/test/TestAssets/NuGet.config b/test/TestAssets/NuGet.config new file mode 100644 index 0000000000..527b4697ae --- /dev/null +++ b/test/TestAssets/NuGet.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj b/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj index ab9ac3103a..1f013e707c 100644 --- a/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj +++ b/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj @@ -1,15 +1,20 @@  + + + ..\..\..\ + true + - - + - SimpleTestProject3 - netcoreapp1.0;netcoreapp1.1;netcoreapp2.1;net451 + netcoreapp2.1;net451 + Exe x64 + $(MSTestFrameworkVersion) diff --git a/test/TestAssets/TestAssets.sln/TestAssets.sln b/test/TestAssets/TestAssets.sln/TestAssets.sln index cf291b0444..e09a9e28e7 100644 --- a/test/TestAssets/TestAssets.sln/TestAssets.sln +++ b/test/TestAssets/TestAssets.sln/TestAssets.sln @@ -51,108 +51,393 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EnvironmentVariablesTestPro EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjectFileRunSettingsTestProject", "..\ProjectFileRunSettingsTestProject\ProjectFileRunSettingsTestProject.csproj", "{A0113409-56D3-4060-BD94-A4BA4739712D}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CrashingOnDebugAssertTestProject", "..\CrashingOnDebugAssertTestProject\CrashingOnDebugAssertTestProject.csproj", "{7A04F7AC-09E4-426C-A599-110DFA693200}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DCD7C4DA-B8CC-46D0-AA21-1340DD1EB5ED}" + ProjectSection(SolutionItems) = preProject + ..\NuGet.config = ..\NuGet.config + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleTestProject3", "..\SimpleTestProject3\SimpleTestProject3.csproj", "{1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DiscoveryTestProject", "..\DiscoveryTestProject\DiscoveryTestProject.csproj", "{4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventLogUnitTestProject", "..\EventLogUnitTestProject\EventLogUnitTestProject.csproj", "{40DA6965-C3C3-46BC-BA56-6D457C097F3C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleProjectWithOldTestHost", "..\SampleProjectWithOldTestHost\SampleProjectWithOldTestHost.csproj", "{D7869421-F18B-4BEF-AECD-71485136808C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleClassLibrary", "..\SimpleClassLibrary\SimpleClassLibrary.csproj", "{F37144D7-2C6D-42AF-9E85-EF10E5244A7B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Debug|x64.ActiveCfg = Debug|Any CPU + {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Debug|x64.Build.0 = Debug|Any CPU + {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Debug|x86.ActiveCfg = Debug|Any CPU + {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Debug|x86.Build.0 = Debug|Any CPU {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Release|Any CPU.ActiveCfg = Release|Any CPU {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Release|Any CPU.Build.0 = Release|Any CPU + {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Release|x64.ActiveCfg = Release|Any CPU + {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Release|x64.Build.0 = Release|Any CPU + {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Release|x86.ActiveCfg = Release|Any CPU + {F22A8D65-0581-4CC7-9C1C-9BC9F9E80DA4}.Release|x86.Build.0 = Release|Any CPU {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Debug|x64.ActiveCfg = Debug|Any CPU + {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Debug|x64.Build.0 = Debug|Any CPU + {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Debug|x86.ActiveCfg = Debug|Any CPU + {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Debug|x86.Build.0 = Debug|Any CPU {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Release|Any CPU.ActiveCfg = Release|Any CPU {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Release|Any CPU.Build.0 = Release|Any CPU + {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Release|x64.ActiveCfg = Release|Any CPU + {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Release|x64.Build.0 = Release|Any CPU + {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Release|x86.ActiveCfg = Release|Any CPU + {C1A621CF-8FA8-437C-98E8-C6C6418FEBEF}.Release|x86.Build.0 = Release|Any CPU {52CAF89F-2309-4597-B531-79D6A96902BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {52CAF89F-2309-4597-B531-79D6A96902BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {52CAF89F-2309-4597-B531-79D6A96902BE}.Debug|x64.ActiveCfg = Debug|Any CPU + {52CAF89F-2309-4597-B531-79D6A96902BE}.Debug|x64.Build.0 = Debug|Any CPU + {52CAF89F-2309-4597-B531-79D6A96902BE}.Debug|x86.ActiveCfg = Debug|Any CPU + {52CAF89F-2309-4597-B531-79D6A96902BE}.Debug|x86.Build.0 = Debug|Any CPU {52CAF89F-2309-4597-B531-79D6A96902BE}.Release|Any CPU.ActiveCfg = Release|Any CPU {52CAF89F-2309-4597-B531-79D6A96902BE}.Release|Any CPU.Build.0 = Release|Any CPU + {52CAF89F-2309-4597-B531-79D6A96902BE}.Release|x64.ActiveCfg = Release|Any CPU + {52CAF89F-2309-4597-B531-79D6A96902BE}.Release|x64.Build.0 = Release|Any CPU + {52CAF89F-2309-4597-B531-79D6A96902BE}.Release|x86.ActiveCfg = Release|Any CPU + {52CAF89F-2309-4597-B531-79D6A96902BE}.Release|x86.Build.0 = Release|Any CPU {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Debug|x64.ActiveCfg = Debug|Any CPU + {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Debug|x64.Build.0 = Debug|Any CPU + {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Debug|x86.ActiveCfg = Debug|Any CPU + {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Debug|x86.Build.0 = Debug|Any CPU {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Release|Any CPU.ActiveCfg = Release|Any CPU {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Release|Any CPU.Build.0 = Release|Any CPU + {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Release|x64.ActiveCfg = Release|Any CPU + {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Release|x64.Build.0 = Release|Any CPU + {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Release|x86.ActiveCfg = Release|Any CPU + {1ADE5795-2365-4790-8ACB-2EF0C2613D61}.Release|x86.Build.0 = Release|Any CPU {29294E06-3998-4FF4-910F-EE93A915C3A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {29294E06-3998-4FF4-910F-EE93A915C3A1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29294E06-3998-4FF4-910F-EE93A915C3A1}.Debug|x64.ActiveCfg = Debug|Any CPU + {29294E06-3998-4FF4-910F-EE93A915C3A1}.Debug|x64.Build.0 = Debug|Any CPU + {29294E06-3998-4FF4-910F-EE93A915C3A1}.Debug|x86.ActiveCfg = Debug|Any CPU + {29294E06-3998-4FF4-910F-EE93A915C3A1}.Debug|x86.Build.0 = Debug|Any CPU {29294E06-3998-4FF4-910F-EE93A915C3A1}.Release|Any CPU.ActiveCfg = Release|Any CPU {29294E06-3998-4FF4-910F-EE93A915C3A1}.Release|Any CPU.Build.0 = Release|Any CPU + {29294E06-3998-4FF4-910F-EE93A915C3A1}.Release|x64.ActiveCfg = Release|Any CPU + {29294E06-3998-4FF4-910F-EE93A915C3A1}.Release|x64.Build.0 = Release|Any CPU + {29294E06-3998-4FF4-910F-EE93A915C3A1}.Release|x86.ActiveCfg = Release|Any CPU + {29294E06-3998-4FF4-910F-EE93A915C3A1}.Release|x86.Build.0 = Release|Any CPU {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Debug|x64.ActiveCfg = Debug|Any CPU + {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Debug|x64.Build.0 = Debug|Any CPU + {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Debug|x86.ActiveCfg = Debug|Any CPU + {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Debug|x86.Build.0 = Debug|Any CPU {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Release|Any CPU.ActiveCfg = Release|Any CPU {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Release|Any CPU.Build.0 = Release|Any CPU + {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Release|x64.ActiveCfg = Release|Any CPU + {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Release|x64.Build.0 = Release|Any CPU + {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Release|x86.ActiveCfg = Release|Any CPU + {C8AB532E-28E9-4C5E-9F2D-06B6690FCB72}.Release|x86.Build.0 = Release|Any CPU {7E79BDC2-49BA-403A-BE07-212C463A279B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7E79BDC2-49BA-403A-BE07-212C463A279B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E79BDC2-49BA-403A-BE07-212C463A279B}.Debug|x64.ActiveCfg = Debug|Any CPU + {7E79BDC2-49BA-403A-BE07-212C463A279B}.Debug|x64.Build.0 = Debug|Any CPU + {7E79BDC2-49BA-403A-BE07-212C463A279B}.Debug|x86.ActiveCfg = Debug|Any CPU + {7E79BDC2-49BA-403A-BE07-212C463A279B}.Debug|x86.Build.0 = Debug|Any CPU {7E79BDC2-49BA-403A-BE07-212C463A279B}.Release|Any CPU.ActiveCfg = Release|Any CPU {7E79BDC2-49BA-403A-BE07-212C463A279B}.Release|Any CPU.Build.0 = Release|Any CPU + {7E79BDC2-49BA-403A-BE07-212C463A279B}.Release|x64.ActiveCfg = Release|Any CPU + {7E79BDC2-49BA-403A-BE07-212C463A279B}.Release|x64.Build.0 = Release|Any CPU + {7E79BDC2-49BA-403A-BE07-212C463A279B}.Release|x86.ActiveCfg = Release|Any CPU + {7E79BDC2-49BA-403A-BE07-212C463A279B}.Release|x86.Build.0 = Release|Any CPU {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Debug|x64.ActiveCfg = Debug|Any CPU + {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Debug|x64.Build.0 = Debug|Any CPU + {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Debug|x86.ActiveCfg = Debug|Any CPU + {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Debug|x86.Build.0 = Debug|Any CPU {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Release|Any CPU.ActiveCfg = Release|Any CPU {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Release|Any CPU.Build.0 = Release|Any CPU + {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Release|x64.ActiveCfg = Release|Any CPU + {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Release|x64.Build.0 = Release|Any CPU + {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Release|x86.ActiveCfg = Release|Any CPU + {E0042DCD-0C90-4736-B673-BC6CBDA04834}.Release|x86.Build.0 = Release|Any CPU {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Debug|x64.ActiveCfg = Debug|Any CPU + {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Debug|x64.Build.0 = Debug|Any CPU + {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Debug|x86.ActiveCfg = Debug|Any CPU + {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Debug|x86.Build.0 = Debug|Any CPU {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Release|Any CPU.ActiveCfg = Release|Any CPU {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Release|Any CPU.Build.0 = Release|Any CPU + {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Release|x64.ActiveCfg = Release|Any CPU + {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Release|x64.Build.0 = Release|Any CPU + {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Release|x86.ActiveCfg = Release|Any CPU + {2B0F911C-5864-4EF7-A1F4-6923F7963D74}.Release|x86.Build.0 = Release|Any CPU {1266AB9D-94D9-496D-8AE5-73612D097A09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1266AB9D-94D9-496D-8AE5-73612D097A09}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1266AB9D-94D9-496D-8AE5-73612D097A09}.Debug|x64.ActiveCfg = Debug|Any CPU + {1266AB9D-94D9-496D-8AE5-73612D097A09}.Debug|x64.Build.0 = Debug|Any CPU + {1266AB9D-94D9-496D-8AE5-73612D097A09}.Debug|x86.ActiveCfg = Debug|Any CPU + {1266AB9D-94D9-496D-8AE5-73612D097A09}.Debug|x86.Build.0 = Debug|Any CPU {1266AB9D-94D9-496D-8AE5-73612D097A09}.Release|Any CPU.ActiveCfg = Release|Any CPU {1266AB9D-94D9-496D-8AE5-73612D097A09}.Release|Any CPU.Build.0 = Release|Any CPU + {1266AB9D-94D9-496D-8AE5-73612D097A09}.Release|x64.ActiveCfg = Release|Any CPU + {1266AB9D-94D9-496D-8AE5-73612D097A09}.Release|x64.Build.0 = Release|Any CPU + {1266AB9D-94D9-496D-8AE5-73612D097A09}.Release|x86.ActiveCfg = Release|Any CPU + {1266AB9D-94D9-496D-8AE5-73612D097A09}.Release|x86.Build.0 = Release|Any CPU {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Debug|x64.ActiveCfg = Debug|Any CPU + {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Debug|x64.Build.0 = Debug|Any CPU + {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Debug|x86.ActiveCfg = Debug|Any CPU + {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Debug|x86.Build.0 = Debug|Any CPU {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Release|Any CPU.ActiveCfg = Release|Any CPU {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Release|Any CPU.Build.0 = Release|Any CPU + {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Release|x64.ActiveCfg = Release|Any CPU + {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Release|x64.Build.0 = Release|Any CPU + {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Release|x86.ActiveCfg = Release|Any CPU + {1D1FDCD9-10B5-4C54-8A95-AD0C941F41C6}.Release|x86.Build.0 = Release|Any CPU {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Debug|x64.ActiveCfg = Debug|Any CPU + {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Debug|x64.Build.0 = Debug|Any CPU + {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Debug|x86.ActiveCfg = Debug|Any CPU + {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Debug|x86.Build.0 = Debug|Any CPU {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Release|Any CPU.ActiveCfg = Release|Any CPU {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Release|Any CPU.Build.0 = Release|Any CPU + {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Release|x64.ActiveCfg = Release|Any CPU + {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Release|x64.Build.0 = Release|Any CPU + {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Release|x86.ActiveCfg = Release|Any CPU + {FBDB7A61-C1DB-4B24-B568-DA96AAD0DB8A}.Release|x86.Build.0 = Release|Any CPU {E28DD78A-E4C1-48C1-B027-88576F669C73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E28DD78A-E4C1-48C1-B027-88576F669C73}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E28DD78A-E4C1-48C1-B027-88576F669C73}.Debug|x64.ActiveCfg = Debug|Any CPU + {E28DD78A-E4C1-48C1-B027-88576F669C73}.Debug|x64.Build.0 = Debug|Any CPU + {E28DD78A-E4C1-48C1-B027-88576F669C73}.Debug|x86.ActiveCfg = Debug|Any CPU + {E28DD78A-E4C1-48C1-B027-88576F669C73}.Debug|x86.Build.0 = Debug|Any CPU {E28DD78A-E4C1-48C1-B027-88576F669C73}.Release|Any CPU.ActiveCfg = Release|Any CPU {E28DD78A-E4C1-48C1-B027-88576F669C73}.Release|Any CPU.Build.0 = Release|Any CPU + {E28DD78A-E4C1-48C1-B027-88576F669C73}.Release|x64.ActiveCfg = Release|Any CPU + {E28DD78A-E4C1-48C1-B027-88576F669C73}.Release|x64.Build.0 = Release|Any CPU + {E28DD78A-E4C1-48C1-B027-88576F669C73}.Release|x86.ActiveCfg = Release|Any CPU + {E28DD78A-E4C1-48C1-B027-88576F669C73}.Release|x86.Build.0 = Release|Any CPU {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Debug|x64.ActiveCfg = Debug|Any CPU + {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Debug|x64.Build.0 = Debug|Any CPU + {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Debug|x86.ActiveCfg = Debug|Any CPU + {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Debug|x86.Build.0 = Debug|Any CPU {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Release|Any CPU.ActiveCfg = Release|Any CPU {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Release|Any CPU.Build.0 = Release|Any CPU + {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Release|x64.ActiveCfg = Release|Any CPU + {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Release|x64.Build.0 = Release|Any CPU + {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Release|x86.ActiveCfg = Release|Any CPU + {C4369F97-5D81-4D1A-BAE1-2AE3B2408D44}.Release|x86.Build.0 = Release|Any CPU {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Debug|x64.ActiveCfg = Debug|Any CPU + {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Debug|x64.Build.0 = Debug|Any CPU + {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Debug|x86.ActiveCfg = Debug|Any CPU + {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Debug|x86.Build.0 = Debug|Any CPU {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Release|Any CPU.ActiveCfg = Release|Any CPU {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Release|Any CPU.Build.0 = Release|Any CPU + {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Release|x64.ActiveCfg = Release|Any CPU + {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Release|x64.Build.0 = Release|Any CPU + {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Release|x86.ActiveCfg = Release|Any CPU + {7C865EAA-C6C2-4CAF-A6AD-D9CF29577A36}.Release|x86.Build.0 = Release|Any CPU {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Debug|x64.ActiveCfg = Debug|Any CPU + {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Debug|x64.Build.0 = Debug|Any CPU + {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Debug|x86.ActiveCfg = Debug|Any CPU + {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Debug|x86.Build.0 = Debug|Any CPU {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Release|Any CPU.ActiveCfg = Release|Any CPU {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Release|Any CPU.Build.0 = Release|Any CPU + {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Release|x64.ActiveCfg = Release|Any CPU + {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Release|x64.Build.0 = Release|Any CPU + {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Release|x86.ActiveCfg = Release|Any CPU + {CF46C8A0-E9FA-40E9-96CA-DCD3797546D8}.Release|x86.Build.0 = Release|Any CPU {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Debug|x64.ActiveCfg = Debug|Any CPU + {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Debug|x64.Build.0 = Debug|Any CPU + {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Debug|x86.ActiveCfg = Debug|Any CPU + {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Debug|x86.Build.0 = Debug|Any CPU {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Release|Any CPU.ActiveCfg = Release|Any CPU {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Release|Any CPU.Build.0 = Release|Any CPU + {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Release|x64.ActiveCfg = Release|Any CPU + {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Release|x64.Build.0 = Release|Any CPU + {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Release|x86.ActiveCfg = Release|Any CPU + {36C7990F-0A36-47CE-8E10-7887D24E2F9A}.Release|x86.Build.0 = Release|Any CPU {A09B21CC-F726-413A-B185-3AE1172BAED0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A09B21CC-F726-413A-B185-3AE1172BAED0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A09B21CC-F726-413A-B185-3AE1172BAED0}.Debug|x64.ActiveCfg = Debug|Any CPU + {A09B21CC-F726-413A-B185-3AE1172BAED0}.Debug|x64.Build.0 = Debug|Any CPU + {A09B21CC-F726-413A-B185-3AE1172BAED0}.Debug|x86.ActiveCfg = Debug|Any CPU + {A09B21CC-F726-413A-B185-3AE1172BAED0}.Debug|x86.Build.0 = Debug|Any CPU {A09B21CC-F726-413A-B185-3AE1172BAED0}.Release|Any CPU.ActiveCfg = Release|Any CPU {A09B21CC-F726-413A-B185-3AE1172BAED0}.Release|Any CPU.Build.0 = Release|Any CPU + {A09B21CC-F726-413A-B185-3AE1172BAED0}.Release|x64.ActiveCfg = Release|Any CPU + {A09B21CC-F726-413A-B185-3AE1172BAED0}.Release|x64.Build.0 = Release|Any CPU + {A09B21CC-F726-413A-B185-3AE1172BAED0}.Release|x86.ActiveCfg = Release|Any CPU + {A09B21CC-F726-413A-B185-3AE1172BAED0}.Release|x86.Build.0 = Release|Any CPU {132E4690-DE43-4684-BA05-6942155EEAB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {132E4690-DE43-4684-BA05-6942155EEAB5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {132E4690-DE43-4684-BA05-6942155EEAB5}.Debug|x64.ActiveCfg = Debug|Any CPU + {132E4690-DE43-4684-BA05-6942155EEAB5}.Debug|x64.Build.0 = Debug|Any CPU + {132E4690-DE43-4684-BA05-6942155EEAB5}.Debug|x86.ActiveCfg = Debug|Any CPU + {132E4690-DE43-4684-BA05-6942155EEAB5}.Debug|x86.Build.0 = Debug|Any CPU {132E4690-DE43-4684-BA05-6942155EEAB5}.Release|Any CPU.ActiveCfg = Release|Any CPU {132E4690-DE43-4684-BA05-6942155EEAB5}.Release|Any CPU.Build.0 = Release|Any CPU + {132E4690-DE43-4684-BA05-6942155EEAB5}.Release|x64.ActiveCfg = Release|Any CPU + {132E4690-DE43-4684-BA05-6942155EEAB5}.Release|x64.Build.0 = Release|Any CPU + {132E4690-DE43-4684-BA05-6942155EEAB5}.Release|x86.ActiveCfg = Release|Any CPU + {132E4690-DE43-4684-BA05-6942155EEAB5}.Release|x86.Build.0 = Release|Any CPU {8C38E692-FBE3-41A4-A008-4CA79B203985}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8C38E692-FBE3-41A4-A008-4CA79B203985}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C38E692-FBE3-41A4-A008-4CA79B203985}.Debug|x64.ActiveCfg = Debug|Any CPU + {8C38E692-FBE3-41A4-A008-4CA79B203985}.Debug|x64.Build.0 = Debug|Any CPU + {8C38E692-FBE3-41A4-A008-4CA79B203985}.Debug|x86.ActiveCfg = Debug|Any CPU + {8C38E692-FBE3-41A4-A008-4CA79B203985}.Debug|x86.Build.0 = Debug|Any CPU {8C38E692-FBE3-41A4-A008-4CA79B203985}.Release|Any CPU.ActiveCfg = Release|Any CPU {8C38E692-FBE3-41A4-A008-4CA79B203985}.Release|Any CPU.Build.0 = Release|Any CPU + {8C38E692-FBE3-41A4-A008-4CA79B203985}.Release|x64.ActiveCfg = Release|Any CPU + {8C38E692-FBE3-41A4-A008-4CA79B203985}.Release|x64.Build.0 = Release|Any CPU + {8C38E692-FBE3-41A4-A008-4CA79B203985}.Release|x86.ActiveCfg = Release|Any CPU + {8C38E692-FBE3-41A4-A008-4CA79B203985}.Release|x86.Build.0 = Release|Any CPU {79EDA259-5EA0-45F0-990A-F078427E198A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {79EDA259-5EA0-45F0-990A-F078427E198A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79EDA259-5EA0-45F0-990A-F078427E198A}.Debug|x64.ActiveCfg = Debug|Any CPU + {79EDA259-5EA0-45F0-990A-F078427E198A}.Debug|x64.Build.0 = Debug|Any CPU + {79EDA259-5EA0-45F0-990A-F078427E198A}.Debug|x86.ActiveCfg = Debug|Any CPU + {79EDA259-5EA0-45F0-990A-F078427E198A}.Debug|x86.Build.0 = Debug|Any CPU {79EDA259-5EA0-45F0-990A-F078427E198A}.Release|Any CPU.ActiveCfg = Release|Any CPU {79EDA259-5EA0-45F0-990A-F078427E198A}.Release|Any CPU.Build.0 = Release|Any CPU + {79EDA259-5EA0-45F0-990A-F078427E198A}.Release|x64.ActiveCfg = Release|Any CPU + {79EDA259-5EA0-45F0-990A-F078427E198A}.Release|x64.Build.0 = Release|Any CPU + {79EDA259-5EA0-45F0-990A-F078427E198A}.Release|x86.ActiveCfg = Release|Any CPU + {79EDA259-5EA0-45F0-990A-F078427E198A}.Release|x86.Build.0 = Release|Any CPU {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Debug|x64.ActiveCfg = Debug|Any CPU + {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Debug|x64.Build.0 = Debug|Any CPU + {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Debug|x86.ActiveCfg = Debug|Any CPU + {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Debug|x86.Build.0 = Debug|Any CPU {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Release|Any CPU.ActiveCfg = Release|Any CPU {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Release|Any CPU.Build.0 = Release|Any CPU + {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Release|x64.ActiveCfg = Release|Any CPU + {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Release|x64.Build.0 = Release|Any CPU + {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Release|x86.ActiveCfg = Release|Any CPU + {BF090BCE-CC7D-4359-93E2-30F2B454F751}.Release|x86.Build.0 = Release|Any CPU {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Debug|x64.ActiveCfg = Debug|Any CPU + {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Debug|x64.Build.0 = Debug|Any CPU + {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Debug|x86.ActiveCfg = Debug|Any CPU + {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Debug|x86.Build.0 = Debug|Any CPU {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Release|Any CPU.ActiveCfg = Release|Any CPU {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Release|Any CPU.Build.0 = Release|Any CPU + {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Release|x64.ActiveCfg = Release|Any CPU + {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Release|x64.Build.0 = Release|Any CPU + {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Release|x86.ActiveCfg = Release|Any CPU + {BA53C202-55D6-4BBC-A24A-444B2D5F6309}.Release|x86.Build.0 = Release|Any CPU {A0113409-56D3-4060-BD94-A4BA4739712D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A0113409-56D3-4060-BD94-A4BA4739712D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0113409-56D3-4060-BD94-A4BA4739712D}.Debug|x64.ActiveCfg = Debug|Any CPU + {A0113409-56D3-4060-BD94-A4BA4739712D}.Debug|x64.Build.0 = Debug|Any CPU + {A0113409-56D3-4060-BD94-A4BA4739712D}.Debug|x86.ActiveCfg = Debug|Any CPU + {A0113409-56D3-4060-BD94-A4BA4739712D}.Debug|x86.Build.0 = Debug|Any CPU {A0113409-56D3-4060-BD94-A4BA4739712D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A0113409-56D3-4060-BD94-A4BA4739712D}.Release|Any CPU.Build.0 = Release|Any CPU + {A0113409-56D3-4060-BD94-A4BA4739712D}.Release|x64.ActiveCfg = Release|Any CPU + {A0113409-56D3-4060-BD94-A4BA4739712D}.Release|x64.Build.0 = Release|Any CPU + {A0113409-56D3-4060-BD94-A4BA4739712D}.Release|x86.ActiveCfg = Release|Any CPU + {A0113409-56D3-4060-BD94-A4BA4739712D}.Release|x86.Build.0 = Release|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Debug|x64.ActiveCfg = Debug|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Debug|x64.Build.0 = Debug|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Debug|x86.ActiveCfg = Debug|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Debug|x86.Build.0 = Debug|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Release|Any CPU.Build.0 = Release|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Release|x64.ActiveCfg = Release|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Release|x64.Build.0 = Release|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Release|x86.ActiveCfg = Release|Any CPU + {7A04F7AC-09E4-426C-A599-110DFA693200}.Release|x86.Build.0 = Release|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Debug|x64.ActiveCfg = Debug|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Debug|x64.Build.0 = Debug|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Debug|x86.ActiveCfg = Debug|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Debug|x86.Build.0 = Debug|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Release|Any CPU.Build.0 = Release|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Release|x64.ActiveCfg = Release|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Release|x64.Build.0 = Release|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Release|x86.ActiveCfg = Release|Any CPU + {1FF723F6-3A09-41F6-B85C-C4BE9C4374F0}.Release|x86.Build.0 = Release|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Debug|x64.ActiveCfg = Debug|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Debug|x64.Build.0 = Debug|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Debug|x86.ActiveCfg = Debug|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Debug|x86.Build.0 = Debug|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Release|Any CPU.Build.0 = Release|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Release|x64.ActiveCfg = Release|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Release|x64.Build.0 = Release|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Release|x86.ActiveCfg = Release|Any CPU + {4BAA0E81-FB31-4BAB-BD75-0CA315245BD8}.Release|x86.Build.0 = Release|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Debug|x64.ActiveCfg = Debug|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Debug|x64.Build.0 = Debug|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Debug|x86.ActiveCfg = Debug|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Debug|x86.Build.0 = Debug|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Release|Any CPU.Build.0 = Release|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Release|x64.ActiveCfg = Release|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Release|x64.Build.0 = Release|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Release|x86.ActiveCfg = Release|Any CPU + {40DA6965-C3C3-46BC-BA56-6D457C097F3C}.Release|x86.Build.0 = Release|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Debug|x64.ActiveCfg = Debug|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Debug|x64.Build.0 = Debug|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Debug|x86.ActiveCfg = Debug|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Debug|x86.Build.0 = Debug|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Release|Any CPU.Build.0 = Release|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Release|x64.ActiveCfg = Release|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Release|x64.Build.0 = Release|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Release|x86.ActiveCfg = Release|Any CPU + {D7869421-F18B-4BEF-AECD-71485136808C}.Release|x86.Build.0 = Release|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Debug|x64.ActiveCfg = Debug|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Debug|x64.Build.0 = Debug|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Debug|x86.ActiveCfg = Debug|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Debug|x86.Build.0 = Debug|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Release|Any CPU.Build.0 = Release|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Release|x64.ActiveCfg = Release|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Release|x64.Build.0 = Release|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Release|x86.ActiveCfg = Release|Any CPU + {F37144D7-2C6D-42AF-9E85-EF10E5244A7B}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs b/test/coverlet.collector/CoverletInProcDataCollector.cs similarity index 100% rename from test/TestAssets/coverlet.collector/CoverletInProcDataCollector.cs rename to test/coverlet.collector/CoverletInProcDataCollector.cs diff --git a/test/TestAssets/coverlet.collector/coverlet.collector.csproj b/test/coverlet.collector/coverlet.collector.csproj similarity index 64% rename from test/TestAssets/coverlet.collector/coverlet.collector.csproj rename to test/coverlet.collector/coverlet.collector.csproj index 74bce9aef6..a881df2bb4 100644 --- a/test/TestAssets/coverlet.collector/coverlet.collector.csproj +++ b/test/coverlet.collector/coverlet.collector.csproj @@ -6,7 +6,6 @@ - + - diff --git a/test/TestAssets/coverlet.collector/key.snk b/test/coverlet.collector/key.snk similarity index 100% rename from test/TestAssets/coverlet.collector/key.snk rename to test/coverlet.collector/key.snk From feb982245bb28565a5d04bbb153905c4f54ddf17 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Tue, 18 Feb 2020 13:02:23 +0100 Subject: [PATCH 02/33] wip --- global.json | 5 ++- .../Helpers/CommandLineArgumentsHelper.cs | 27 ++++++++++-- src/testhost.x86/DefaultEngineInvoker.cs | 43 ++++++++++++------- .../IntegrationTestEnvironment.cs | 34 +++++---------- 4 files changed, 67 insertions(+), 42 deletions(-) diff --git a/global.json b/global.json index 1321affc3d..72b58c2f07 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,12 @@ { "tools": { - "dotnet": "3.1.100" + "dotnet": "3.1.101" }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20052.1", "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20052.1" + }, + "sdk": { + "version" : "3.1.101" } } \ No newline at end of file diff --git a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/CommandLineArgumentsHelper.cs b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/CommandLineArgumentsHelper.cs index 9ed850a0d4..b71f47cac3 100644 --- a/src/Microsoft.TestPlatform.CoreUtilities/Helpers/CommandLineArgumentsHelper.cs +++ b/src/Microsoft.TestPlatform.CoreUtilities/Helpers/CommandLineArgumentsHelper.cs @@ -52,12 +52,33 @@ public static IDictionary GetArgumentsDictionary(string[] args) /// Thrown if value of an argument is not an integer. public static int GetIntArgFromDict(IDictionary argsDictionary, string fullname) { - string optionValue; - return argsDictionary.TryGetValue(fullname, out optionValue) ? int.Parse(optionValue) : 0; + var found = TryGetIntArgFromDict(argsDictionary, fullname, out var value); + return found ? value : 0; } /// - /// Parse the value of an argument as an integer. + /// Try get the argument and parse the value of an argument as an integer. + /// + /// Dictionary of all arguments Ex: { "--port":"12312", "--parentprocessid":"2312" } + /// The full name for required argument. Ex: "--port" + /// Value of the argument. + /// Thrown if value of an argument is not an integer. + public static bool TryGetIntArgFromDict(IDictionary argsDictionary, string fullname, out int value) + { + var found = argsDictionary.TryGetValue(fullname, out var optionValue); + if (!found) + { + value = default; + return false; + } + + value = int.Parse(optionValue); + return true; + } + + + /// + /// Parse the value of an argument as a string. /// /// Dictionary of all arguments Ex: { "--port":"12312", "--parentprocessid":"2312" } /// The full name for required argument. Ex: "--port" diff --git a/src/testhost.x86/DefaultEngineInvoker.cs b/src/testhost.x86/DefaultEngineInvoker.cs index 24f8c5be5d..ce3b5702fa 100644 --- a/src/testhost.x86/DefaultEngineInvoker.cs +++ b/src/testhost.x86/DefaultEngineInvoker.cs @@ -93,8 +93,8 @@ public void Invoke(IDictionary argsDictionary) this.requestHandler.InitializeCommunication(); // Initialize DataCollection Communication if data collection port is provided. - var dcPort = CommandLineArgumentsHelper.GetIntArgFromDict(argsDictionary, DataCollectionPortArgument); - if (dcPort > 0) + var hasDataCollectionPortArgument = CommandLineArgumentsHelper.TryGetIntArgFromDict(argsDictionary, DataCollectionPortArgument, out var dcPort); + if (hasDataCollectionPortArgument) { this.ConnectToDatacollector(dcPort); } @@ -176,22 +176,35 @@ private void ConnectToDatacollector(int dcPort) private void SetParentProcessExitCallback(IDictionary argsDictionary) { // Attach to exit of parent process - var parentProcessId = CommandLineArgumentsHelper.GetIntArgFromDict(argsDictionary, ParentProcessIdArgument); - EqtTrace.Info("DefaultEngineInvoker.SetParentProcessExitCallback: Monitoring parent process with id: '{0}'", - parentProcessId); + var hasParentProcessArgument = CommandLineArgumentsHelper.TryGetIntArgFromDict(argsDictionary, ParentProcessIdArgument, out var parentProcessId); - // In remote scenario we cannot monitor parent process, so we expect user to pass parentProcessId as -1 - if (parentProcessId != -1) + if (!hasParentProcessArgument) { - this.processHelper.SetExitCallback( - parentProcessId, - (obj) => - { - EqtTrace.Info("DefaultEngineInvoker.SetParentProcessExitCallback: ParentProcess '{0}' Exited.", - parentProcessId); - new PlatformEnvironment().Exit(1); - }); + throw new ArgumentException($"Argument {ParentProcessIdArgument} was not specified."); + } + + EqtTrace.Info("DefaultEngineInvoker.SetParentProcessExitCallback: Monitoring parent process with id: '{0}'", parentProcessId); + + if (parentProcessId == -1) + { + // In remote scenario we cannot monitor parent process, so we expect user to pass parentProcessId as -1 + return; } + + if (parentProcessId == 0) + { + //TODO: should there be a warning / error in this case, on windows and linux we are most likely not started by this PID 0, because it's Idle process on Windows, and Swapper on Linux, and similarly in docker + // Trying to attach to 0 will cause access denied error on Windows + } + + this.processHelper.SetExitCallback( + parentProcessId, + (obj) => + { + EqtTrace.Info("DefaultEngineInvoker.SetParentProcessExitCallback: ParentProcess '{0}' Exited.", + parentProcessId); + new PlatformEnvironment().Exit(1); + }); } private static TestHostConnectionInfo GetConnectionInfo(IDictionary argsDictionary) diff --git a/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestEnvironment.cs b/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestEnvironment.cs index af9389c9e5..a9fb9ca65d 100644 --- a/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestEnvironment.cs +++ b/test/Microsoft.TestPlatform.TestUtilities/IntegrationTestEnvironment.cs @@ -21,7 +21,6 @@ public class IntegrationTestEnvironment private static Dictionary dependencyVersions; - private readonly bool runningInCli; private string targetRuntime; public IntegrationTestEnvironment() @@ -40,16 +39,9 @@ public IntegrationTestEnvironment() if (string.IsNullOrEmpty(TestPlatformRootDirectory)) { // Running in VS/IDE. Use artifacts directory as root. - this.runningInCli = false; - // Get root directory from test assembly output directory TestPlatformRootDirectory = Path.GetFullPath(@"..\..\..\..\.."); } - else - { - // Running in command line/CI - this.runningInCli = true; - } this.TestAssetsPath = Path.Combine(TestPlatformRootDirectory, @"test\TestAssets"); @@ -105,27 +97,23 @@ public string PublishDirectory { get { - string value = string.Empty; - if (this.runningInCli) - { - value = Path.Combine( - TestPlatformRootDirectory, - "artifacts", - BuildConfiguration, - this.RunnerFramework, - this.TargetRuntime); - } - else - { - value = Path.Combine( + + // this used to switch to src\package\package\bin\based on whether + // this is running in cli, but that's a bad idea, the console there does not have + // a runtime config and will fail to start with error testhostpolicy.dll not found + var publishDirectory = Path.Combine( TestPlatformRootDirectory, - @"src\package\package\bin", + "artifacts", BuildConfiguration, this.RunnerFramework, this.TargetRuntime); + + if (!Directory.Exists(publishDirectory)) + { + throw new InvalidOperationException($"Path '{publishDirectory}' does not exist, did you build the solution via build.cmd?"); } - return value; + return publishDirectory; } } From fde83d25ed3790da92ecd552dcbfec57f605c484 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Tue, 18 Feb 2020 13:03:15 +0100 Subject: [PATCH 03/33] check packages path --- scripts/build.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 26ee6ad4aa..f16396d10f 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -216,9 +216,14 @@ function Invoke-TestAssetsBuild Write-Log "Invoke-TestAssetsBuild: Start test assets build." $dotnetExe = Get-DotNetPath - # clean up packages that we built from the cache so we grab them from the source + $packages = $TPB_TestAssets_Solution | Split-Path | Join-Path -ChildPath packages - Get-ChildItem $packages -Filter "Microsoft.*" | Remove-Item -Recurse -Force -Confirm:$false -Verbose + if (Test-Path $packages) { + # remove all microsoft packages from our packages folder so we + # get the ones that we've just built instead of taking them from the cache + # on package restore + Get-ChildItem $packages -Filter "Microsoft.*" | Remove-Item -Recurse -Force -Confirm:$false + } Write-Log ".. .. Build: Source: $TPB_TestAssets_Solution" Write-Verbose "$dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild" From 1c3bf90d7fb74fefdf79630087091abe729ece85 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Tue, 18 Feb 2020 19:44:39 +0100 Subject: [PATCH 04/33] Cause stack overflow faster --- test/TestAssets/BlameUnitTestProject/UnitTest1.cs | 10 ++-------- .../SimpleTestProject3/SimpleTestProject3.csproj | 3 +++ test/TestAssets/SimpleTestProject3/UnitTest1.cs | 3 ++- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/test/TestAssets/BlameUnitTestProject/UnitTest1.cs b/test/TestAssets/BlameUnitTestProject/UnitTest1.cs index ed4938f63f..9e8f7c5f33 100644 --- a/test/TestAssets/BlameUnitTestProject/UnitTest1.cs +++ b/test/TestAssets/BlameUnitTestProject/UnitTest1.cs @@ -4,7 +4,7 @@ namespace BlameUnitTestProject { using Microsoft.VisualStudio.TestTools.UnitTesting; - using System.Runtime.CompilerServices; + using System; [TestClass] public class UnitTest1 @@ -17,13 +17,7 @@ public void TestMethod1() [TestMethod] public void TestMethod2() { - StackOverflowMethod(); - } - - [MethodImpl(MethodImplOptions.NoOptimization)] - void StackOverflowMethod() - { - StackOverflowMethod(); + Environment.FailFast("Crash the process on purpose."); } } } diff --git a/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj b/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj index 8d3a8688fe..5928a5a0f5 100644 --- a/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj +++ b/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj @@ -26,6 +26,9 @@ + + + diff --git a/test/TestAssets/SimpleTestProject3/UnitTest1.cs b/test/TestAssets/SimpleTestProject3/UnitTest1.cs index 1331580f7b..1e3ad8f003 100644 --- a/test/TestAssets/SimpleTestProject3/UnitTest1.cs +++ b/test/TestAssets/SimpleTestProject3/UnitTest1.cs @@ -32,7 +32,8 @@ public void ExitwithUnhandleException() [TestMethod] public void ExitWithStackoverFlow() { - ExitWithStackoverFlow(); + // a fast way to cause stack overflow, takes one method call instead of 9k that you need when calling a method recursively + Span s = stackalloc byte[int.MaxValue]; } #if NET451 From 3059f68a741a281b984901095c8652e0bbf17566 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Wed, 19 Feb 2020 12:53:32 +0100 Subject: [PATCH 05/33] add tests --- .../SocketCommunicationManager.cs | 17 ++++++- src/testhost.x86/DefaultEngineInvoker.cs | 7 +-- .../CodeCoverageTests.cs | 4 ++ .../CommandLineArgumentsHelperTests.cs | 45 +++++++++++++++++++ 4 files changed, 68 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs index 411dcaf88b..a8c42cb04a 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs @@ -8,6 +8,7 @@ namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities using System.IO; using System.Net; using System.Net.Sockets; + using System.Reflection; using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces; @@ -177,7 +178,7 @@ public async Task SetupClientAsync(IPEndPoint endpoint) { try { - EqtTrace.Verbose("SocketCommunicationManager : SetupClientAsync : Attempting to connect to the server."); + EqtTrace.Verbose("SocketCommunicationManager : SetupClientAsync : Attempting to connect to the server {0}:{1}.", endpoint.Address, endpoint.Port); await this.tcpClient.ConnectAsync(endpoint.Address, endpoint.Port); if (this.tcpClient.Connected) @@ -199,7 +200,19 @@ public async Task SetupClientAsync(IPEndPoint endpoint) } catch (Exception ex) { - EqtTrace.Error("Connection Failed with error {0}, retrying", ex.ToString()); + // a simple backoff policy, otherwise this loop produces and incredible + // amount of error logs when it cannot connect + var delay = watch.ElapsedMilliseconds < 100 + ? 1 + : watch.ElapsedMilliseconds < 1000 + ? 10 + : 100; + + if ((watch.ElapsedMilliseconds + delay) < connectionTimeout) + { + await Task.Delay(delay); + EqtTrace.Error($"Connection Failed with error {0}, retrying in {delay} ms", ex.ToString()); + } } } while ((this.tcpClient != null) && !this.tcpClient.Connected && watch.ElapsedMilliseconds < connectionTimeout); diff --git a/src/testhost.x86/DefaultEngineInvoker.cs b/src/testhost.x86/DefaultEngineInvoker.cs index ce3b5702fa..2d6665f34f 100644 --- a/src/testhost.x86/DefaultEngineInvoker.cs +++ b/src/testhost.x86/DefaultEngineInvoker.cs @@ -92,9 +92,10 @@ public void Invoke(IDictionary argsDictionary) // Initialize Communication with vstest.console this.requestHandler.InitializeCommunication(); - // Initialize DataCollection Communication if data collection port is provided. - var hasDataCollectionPortArgument = CommandLineArgumentsHelper.TryGetIntArgFromDict(argsDictionary, DataCollectionPortArgument, out var dcPort); - if (hasDataCollectionPortArgument) + // skipping because 0 is the default value, and also the value the the callers use when they + // call with the parameter specified, but without providing an actual port + var dcPort = CommandLineArgumentsHelper.GetIntArgFromDict(argsDictionary, DataCollectionPortArgument); + if (dcPort > 0) { this.ConnectToDatacollector(dcPort); } diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs index d57fa665a6..054c3a9d77 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs @@ -61,7 +61,11 @@ private void CollectCodeCoverage(RunnerInfo runnerInfo, string targetPlatform, b var arguments = CreateArguments(runnerInfo, targetPlatform, withRunsettings, out var trxFilePath); + Environment.SetEnvironmentVariable("VSTEST_RUNNER_DEBUG", "0"); + Environment.SetEnvironmentVariable("VSTEST_CONNECTION_TIMEOUT", "20"); this.InvokeVsTest(arguments); + Environment.SetEnvironmentVariable("VSTEST_RUNNER_DEBUG", "0"); + Environment.SetEnvironmentVariable("VSTEST_CONNECTION_TIMEOUT", "10"); this.ValidateSummaryStatus(1, 1, 1); diff --git a/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Helpers/CommandLineArgumentsHelperTests.cs b/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Helpers/CommandLineArgumentsHelperTests.cs index 5723c974e2..4bcf587a01 100644 --- a/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Helpers/CommandLineArgumentsHelperTests.cs +++ b/test/Microsoft.TestPlatform.CoreUtilities.UnitTests/Helpers/CommandLineArgumentsHelperTests.cs @@ -94,5 +94,50 @@ public void GetArgumentsDictionaryShouldTreatValueAsNullIfTwoConsecutiveKeysAreP Assert.AreEqual(null, argsDictionary["--hello"]); Assert.AreEqual(null, argsDictionary["--world"]); } + + [TestMethod] + public void GetIntArgFromDictShouldReturnZeroIfKeyIsNotPresent() + { + var args = new List() { "--hello", "--world" }; + var argsDictionary = CommandLineArgumentsHelper.GetArgumentsDictionary(args.ToArray()); + + int data = CommandLineArgumentsHelper.GetIntArgFromDict(argsDictionary, "--port"); + + Assert.AreEqual(0, data); + } + + [TestMethod] + public void GetIntArgFromDictShouldReturnTheValueIfKeyIsPresent() + { + var args = new List() { "--port", "1000" }; + var argsDictionary = CommandLineArgumentsHelper.GetArgumentsDictionary(args.ToArray()); + + int data = CommandLineArgumentsHelper.GetIntArgFromDict(argsDictionary, "--port"); + + Assert.AreEqual(1000, data); + } + + [TestMethod] + public void TryGetIntArgFromDictShouldReturnTrueIfKeyIsPresentAndTheValue() + { + var args = new List() { "--port", "59870" }; + var argsDictionary = CommandLineArgumentsHelper.GetArgumentsDictionary(args.ToArray()); + + bool found = CommandLineArgumentsHelper.TryGetIntArgFromDict(argsDictionary, "--port", out var data); + + Assert.IsTrue(found); + Assert.AreEqual(59870, data); + } + + [TestMethod] + public void TryGetIntArgFromDictShouldReturnFalseIfKeyIsNotPresent() + { + var args = new List() { "--hello", "--world" }; + var argsDictionary = CommandLineArgumentsHelper.GetArgumentsDictionary(args.ToArray()); + + bool found = CommandLineArgumentsHelper.TryGetIntArgFromDict(argsDictionary, "--port", out var data); + + Assert.IsFalse(found); + } } } From 0f8ea66685622c9f278584c9f622b346a7e98cd6 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Wed, 19 Feb 2020 19:15:22 +0100 Subject: [PATCH 06/33] Add trace listener to prevent the process from crash --- scripts/build.ps1 | 17 +-- .../DebugAssertException.cs | 17 +++ src/testhost.x86/DefaultEngineInvoker.cs | 4 + src/testhost.x86/Program.cs | 3 - src/testhost.x86/TestHostTraceListener.cs | 93 ++++++++++++++ src/testhost.x86/TestPlatformTraceListener.cs | 114 ------------------ src/testhost/testhost.csproj | 2 +- .../CodeCoverageTests.cs | 4 - .../DebugAssertTests.cs | 14 ++- .../DebugTests.cs | 22 +++- test/TestAssets/NuGet.config | 4 - 11 files changed, 153 insertions(+), 141 deletions(-) create mode 100644 src/Microsoft.TestPlatform.ObjectModel/DebugAssertException.cs create mode 100644 src/testhost.x86/TestHostTraceListener.cs delete mode 100644 src/testhost.x86/TestPlatformTraceListener.cs diff --git a/scripts/build.ps1 b/scripts/build.ps1 index f16396d10f..4fce0fb086 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -179,6 +179,14 @@ function Install-DotNetCli Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" } +function Clear-Package { + # find all microsoft packages that have the same version as we specified + # this is cache-busting the nuget packages, so we don't reuse them from cache + # after we built new ones + $devPackages = Get-ChildItem $env:TP_PACKAGES_DIR/microsoft.*/$TPB_Version | Select-Object -ExpandProperty FullName + $devPackages | Remove-Item -Force -Recurse -Confirm:$false +} + function Restore-Package { $timer = Start-Timer @@ -217,14 +225,6 @@ function Invoke-TestAssetsBuild $dotnetExe = Get-DotNetPath - $packages = $TPB_TestAssets_Solution | Split-Path | Join-Path -ChildPath packages - if (Test-Path $packages) { - # remove all microsoft packages from our packages folder so we - # get the ones that we've just built instead of taking them from the cache - # on package restore - Get-ChildItem $packages -Filter "Microsoft.*" | Remove-Item -Recurse -Force -Confirm:$false - } - Write-Log ".. .. Build: Source: $TPB_TestAssets_Solution" Write-Verbose "$dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild" & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild @@ -950,6 +950,7 @@ Get-ChildItem env: | Where-Object -FilterScript { $_.Name.StartsWith("TP_") } | Write-Log "Test platform build variables: " Get-Variable | Where-Object -FilterScript { $_.Name.StartsWith("TPB_") } | Format-Table Install-DotNetCli +Clear-Package Restore-Package Update-LocalizedResources Invoke-Build diff --git a/src/Microsoft.TestPlatform.ObjectModel/DebugAssertException.cs b/src/Microsoft.TestPlatform.ObjectModel/DebugAssertException.cs new file mode 100644 index 0000000000..1e1138ec94 --- /dev/null +++ b/src/Microsoft.TestPlatform.ObjectModel/DebugAssertException.cs @@ -0,0 +1,17 @@ +// 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.ObjectModel +{ + using System; + + public sealed class DebugAssertException : Exception + { + public DebugAssertException(string message, string stackTrace) : base(message) + { + StackTrace = stackTrace; + } + + public override string StackTrace { get; } + } +} diff --git a/src/testhost.x86/DefaultEngineInvoker.cs b/src/testhost.x86/DefaultEngineInvoker.cs index 2d6665f34f..7f7c83507a 100644 --- a/src/testhost.x86/DefaultEngineInvoker.cs +++ b/src/testhost.x86/DefaultEngineInvoker.cs @@ -84,6 +84,10 @@ public void Invoke(IDictionary argsDictionary) #endif } +#if !NET451 + TestHostTraceListener.Setup(); +#endif + this.SetParentProcessExitCallback(argsDictionary); this.requestHandler.ConnectionInfo = diff --git a/src/testhost.x86/Program.cs b/src/testhost.x86/Program.cs index f63c38d65f..b77fbd52a2 100644 --- a/src/testhost.x86/Program.cs +++ b/src/testhost.x86/Program.cs @@ -33,9 +33,6 @@ public static void Main(string[] args) try { TestPlatformEventSource.Instance.TestHostStart(); -#if !NET451 - TestPlatformTraceListener.Setup(); -#endif Run(args); } catch (Exception ex) diff --git a/src/testhost.x86/TestHostTraceListener.cs b/src/testhost.x86/TestHostTraceListener.cs new file mode 100644 index 0000000000..fc4f30b8b3 --- /dev/null +++ b/src/testhost.x86/TestHostTraceListener.cs @@ -0,0 +1,93 @@ +// 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.TestHost +{ +#if !NET451 + using Microsoft.VisualStudio.TestPlatform.ObjectModel; + using System; + using System.Diagnostics; + using System.Linq; + using System.Reflection; + + internal class TestHostTraceListener : TraceListener + { + public static void Setup() + { + EqtTrace.Info("Setting up debug trace listener."); + EqtTrace.Verbose("TestPlatformTraceListener.Setup: Removing listener {0}.", Trace.Listeners[0]); + Trace.Listeners[0] = new TestHostTraceListener(); + EqtTrace.Verbose("TestPlatformTraceListener.Setup: Added test platform trace listener."); + +#if NETCOREAPP2_1 + try + { + // workaround for netcoreapp2.1 where the trace listener api is not called when + // Debug.Assert fails. This method is internal, but the class is on purpose keeping the + // callback settable so tests can set the callback + var field = typeof(Debug).GetField("s_ShowDialog", BindingFlags.Static | BindingFlags.NonPublic); + var value = field.GetValue(null); + field.SetValue(null, (Action)ShowDialog); + } + catch (Exception ex) + { + EqtTrace.Error("TestPlatformTraceListener.Setup: Failed to replace inner callback to ShowDialog in Debug.Assert. Calls to Debug.Assert with crash the test host process. {0}", ex); + } +#endif + } + + public override void Write(string message) + { + throw GetException(message); + } + + public override void WriteLine(string message) + { + throw GetException(message); + } + + public static void ShowDialog(string stackTrace, string message, string detailMessage, string _) + { + var text = !string.IsNullOrEmpty(message) + ? !string.IsNullOrEmpty(detailMessage) + ? (message + Environment.NewLine + detailMessage) + : message + : null; + throw GetException(text); + } + + private static DebugAssertException GetException(string message) + { + var debugTypes = new Type[] { typeof(Debug), typeof(Trace) }; + var stack = new StackTrace(true); + + var debugMethodFound = false; + var frameCount = 0; + MethodBase method = null; + foreach (var f in stack.GetFrames()) + { + var m = f.GetMethod(); + var declaringType = m?.DeclaringType; + if (!debugMethodFound && (declaringType == typeof(Debug) || declaringType == typeof(Trace))) + { + method = m; + debugMethodFound = true; + } + + if (debugMethodFound) + { + frameCount++; + } + } + + var stackTrace = string.Join(Environment.NewLine, stack.ToString().Split(Environment.NewLine).TakeLast(frameCount)); + var methodName = method != null ? $"{method.DeclaringType.Name}.{method.Name}" : ""; + var wholeMessage = $"Method {methodName} failed with '{message}', and was translated to { typeof(DebugAssertException).FullName } to avoid terminating the process hosting the test."; + + return new DebugAssertException(wholeMessage, stackTrace); + } + } + +#endif +} \ No newline at end of file diff --git a/src/testhost.x86/TestPlatformTraceListener.cs b/src/testhost.x86/TestPlatformTraceListener.cs deleted file mode 100644 index 34dc38d438..0000000000 --- a/src/testhost.x86/TestPlatformTraceListener.cs +++ /dev/null @@ -1,114 +0,0 @@ -// 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; -using System.Diagnostics; -using System.IO; -using System.Reflection; - -namespace Microsoft.VisualStudio.TestPlatform.TestHost -{ -#if !NET451 - internal class TestPlatformTraceListener : TraceListener - { - internal static void Setup() - { - Trace.Listeners.RemoveAt(0); - Trace.Listeners.Add(new TestPlatformTraceListener()); - } - - public override void Write(string message) - { - var stack = new StackTrace(true); - throw new DebugAssertException(GetReport(message, stack), stack); - } - - public override void WriteLine(string message) - { - var stack = new StackTrace(true); - throw new DebugAssertException(GetReport(message, stack), stack); - } - - private string GetReport(string message, StackTrace stack) - { - var frames = stack.GetFrames(); - string report = null; - MethodBase debugMethod = null; - StackFrame frame = null; - foreach (var f in frames) - { - if (debugMethod != null) - { - if (f.HasMethod()) - { - frame = f; - break; - } - } - - if (f.HasMethod()) - { - var m = f.GetMethod(); - if (m.DeclaringType == typeof(Debug)) - { - debugMethod = m; - } - } - } - - if (frame != null) - { - if (frame.HasSource()) - { - var fileName = frame.GetFileName(); - var lineNumber = frame.GetFileLineNumber(); - string line = null; - using (var sr = new StreamReader(fileName)) - { - for (int i = 1; i < lineNumber; i++) - sr.ReadLine(); - line = sr.ReadLine(); - } - - var filteredMessage = message == "Fail:" ? null : message; - - report += Environment.NewLine; - report += Environment.NewLine; - - if (filteredMessage != null) - { - report += filteredMessage; - } - - if (line != null) - { - report = string.Join(Environment.NewLine, "Debug failed at:", line.Trim()); - } - } - } - - return report; - } - } - - internal class DebugAssertException : Exception - { - public DebugAssertException(string message, StackTrace stack) : base(message ?? "Debug.Assert failed.") - { - StackTrace = stack.ToString(); - } - - public override string StackTrace { get; } - } - - internal class DebugFailException : Exception - { - public DebugFailException(string message, StackTrace stack) : base(message ?? "Debug.Fail failed.") - { - StackTrace = stack.ToString(); - } - - public override string StackTrace { get; } - } -#endif -} \ No newline at end of file diff --git a/src/testhost/testhost.csproj b/src/testhost/testhost.csproj index 88039f5452..cd9c055e0c 100644 --- a/src/testhost/testhost.csproj +++ b/src/testhost/testhost.csproj @@ -17,7 +17,7 @@ - + diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs index 054c3a9d77..d57fa665a6 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/CodeCoverageTests.cs @@ -61,11 +61,7 @@ private void CollectCodeCoverage(RunnerInfo runnerInfo, string targetPlatform, b var arguments = CreateArguments(runnerInfo, targetPlatform, withRunsettings, out var trxFilePath); - Environment.SetEnvironmentVariable("VSTEST_RUNNER_DEBUG", "0"); - Environment.SetEnvironmentVariable("VSTEST_CONNECTION_TIMEOUT", "20"); this.InvokeVsTest(arguments); - Environment.SetEnvironmentVariable("VSTEST_RUNNER_DEBUG", "0"); - Environment.SetEnvironmentVariable("VSTEST_CONNECTION_TIMEOUT", "10"); this.ValidateSummaryStatus(1, 1, 1); diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs index e1b6bb86cc..ea2c319328 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs @@ -4,6 +4,7 @@ namespace Microsoft.TestPlatform.AcceptanceTests { using Microsoft.VisualStudio.TestTools.UnitTesting; + using System; [TestClass] public class DebugAssertTests : AcceptanceTestBase @@ -13,15 +14,18 @@ public class DebugAssertTests : AcceptanceTestBase [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] public void RunningTestWithAFailingDebugAssertDoesNotCrashTheHostingProcess(RunnerInfo runnerInfo) { + // when debugging this test in case it starts failing, be aware that the default behavior of Debug.Assert + // is to not crash the process when we are running in debug, and debugger is attached AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); - var projectName = "CrashingOnDebugAssertTestProject.csproj"; - var projectPath = this.GetProjectFullPath(projectName); - this.InvokeDotnetTest(projectPath); + var assemblyPath = this.BuildMultipleAssemblyPath("CrashingOnDebugAssertTestProject.dll").Trim('\"'); + var arguments = PrepareArguments(assemblyPath, null, null, this.FrameworkArgValue, runnerInfo.InIsolationValue); + this.InvokeVsTest(arguments); // this will have failed tests when it works and crash the process when it does not - // because crashin processes is what a failed Debug.Assert does by default - this.ValidateSummaryStatus(1, 0, 0); + // because crashing processes is what a failed Debug.Assert does by default + this.ValidateSummaryStatus(0, failedTestsCount: 4, 0); + StringAssert.Contains(this.StdOut, "Test method CrashingOnDebugAssertTestProject.DebugTests.DebugAssert threw exception: Microsoft.VisualStudio.TestPlatform.ObjectModel.DebugAssertException: Method Debug.Assert failed"); } } } diff --git a/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs b/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs index 152826a596..89515146a4 100644 --- a/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs +++ b/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs @@ -7,9 +7,27 @@ namespace CrashingOnDebugAssertTestProject public class DebugTests { [TestMethod] - public void AssertDebug() + public void DebugAssert() { - Debug.Assert(true == false); + Debug.Assert(false); + } + + [TestMethod] + public void DebugFail() + { + Debug.Fail("fail"); + } + + [TestMethod] + public void TraceAssert() + { + Trace.Assert(false); + } + + [TestMethod] + public void TraceFail() + { + Trace.Fail("fail"); } } } diff --git a/test/TestAssets/NuGet.config b/test/TestAssets/NuGet.config index 527b4697ae..8cd696ed80 100644 --- a/test/TestAssets/NuGet.config +++ b/test/TestAssets/NuGet.config @@ -9,8 +9,4 @@ - - - - From 9a3cc8db8ef9e703d62ec89e2fc145be2e760a1d Mon Sep 17 00:00:00 2001 From: nohwnd Date: Thu, 20 Feb 2020 07:47:57 +0100 Subject: [PATCH 07/33] add test to make sure the exception type is public --- .../DebugAssertTests.cs | 6 +++--- .../CrashingOnDebugAssertTestProject/DebugTests.cs | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs index ea2c319328..2b8a2e9ed9 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs @@ -22,9 +22,9 @@ public void RunningTestWithAFailingDebugAssertDoesNotCrashTheHostingProcess(Runn var arguments = PrepareArguments(assemblyPath, null, null, this.FrameworkArgValue, runnerInfo.InIsolationValue); this.InvokeVsTest(arguments); - // this will have failed tests when it works and crash the process when it does not - // because crashing processes is what a failed Debug.Assert does by default - this.ValidateSummaryStatus(0, failedTestsCount: 4, 0); + // this will have failed tests when our trace listener works and crash the testhost process when it does not + // because crashing processes is what a failed Debug.Assert does by default, unless you have a debugger attached + this.ValidateSummaryStatus(passedTestsCount: 1, failedTestsCount: 4, 0); StringAssert.Contains(this.StdOut, "Test method CrashingOnDebugAssertTestProject.DebugTests.DebugAssert threw exception: Microsoft.VisualStudio.TestPlatform.ObjectModel.DebugAssertException: Method Debug.Assert failed"); } } diff --git a/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs b/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs index 89515146a4..dc8ad3880f 100644 --- a/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs +++ b/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs @@ -1,4 +1,5 @@ using System.Diagnostics; +using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace CrashingOnDebugAssertTestProject @@ -29,5 +30,12 @@ public void TraceFail() { Trace.Fail("fail"); } + + [TestMethod] + [ExpectedException(typeof(DebugAssertException))] + public void CatchingExceptionFromDebugAssert() + { + Debug.Assert(false); + } } } From 870e5f1b2b9324c721856b4b4ad3a7375efbeaf6 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Thu, 20 Feb 2020 08:33:55 +0100 Subject: [PATCH 08/33] Remove hardcoded dependency version --- NuGet.config | 2 +- .../UnitTestProject/UnitTestProject.csproj | 2 +- scripts/build.ps1 | 2 ++ scripts/build/TestPlatform.Dependencies.props | 10 +++++----- .../CrashingOnDebugAssertTestProject.csproj | Bin 1692 -> 1676 bytes .../DiscoveryTestProject.csproj | 2 +- .../NUTestProject/NUTestProject.csproj | 2 +- .../MSTestAdapterPerfTestProject.csproj | 2 +- .../NUnitAdapterPerfTestProject.csproj | 2 +- .../XUnitAdapterPerfTestProject.csproj | 2 +- .../ProjectFileRunSettingsTestProject.csproj | 2 +- .../SimpleTestProject.csproj | Bin 2412 -> 2396 bytes .../SimpleTestProject3.csproj | 2 +- .../XUTestProject/XUTestProject.csproj | 2 +- 14 files changed, 17 insertions(+), 15 deletions(-) diff --git a/NuGet.config b/NuGet.config index 5c36dcbf71..abef7d7e43 100644 --- a/NuGet.config +++ b/NuGet.config @@ -6,7 +6,7 @@ - + diff --git a/samples/UnitTestProject/UnitTestProject.csproj b/samples/UnitTestProject/UnitTestProject.csproj index d87d204740..9a53f820a8 100644 --- a/samples/UnitTestProject/UnitTestProject.csproj +++ b/samples/UnitTestProject/UnitTestProject.csproj @@ -17,7 +17,7 @@ - + diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 4fce0fb086..9d0934dc52 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -183,9 +183,11 @@ function Clear-Package { # find all microsoft packages that have the same version as we specified # this is cache-busting the nuget packages, so we don't reuse them from cache # after we built new ones + if (Test-Path $env:TP_PACKAGES_DIR) { $devPackages = Get-ChildItem $env:TP_PACKAGES_DIR/microsoft.*/$TPB_Version | Select-Object -ExpandProperty FullName $devPackages | Remove-Item -Force -Recurse -Confirm:$false } +} function Restore-Package { diff --git a/scripts/build/TestPlatform.Dependencies.props b/scripts/build/TestPlatform.Dependencies.props index 6dc5fb11fe..3f5064fb6e 100644 --- a/scripts/build/TestPlatform.Dependencies.props +++ b/scripts/build/TestPlatform.Dependencies.props @@ -6,12 +6,12 @@ - $(Version) - 16.6.0-dev + or via vsts-prevbuild.ps1 when running in CI pipeline, a better way would be to specify this version directly in a props file, but that would require chagnes + to both the local build and CI build pipelines, and that's not something I want to do in a single step --> + $(Version) - - 99.99.99-dev + + 99.99.99-dev 2.1.0 2.1.0 diff --git a/test/TestAssets/CrashingOnDebugAssertTestProject/CrashingOnDebugAssertTestProject.csproj b/test/TestAssets/CrashingOnDebugAssertTestProject/CrashingOnDebugAssertTestProject.csproj index c850afaf4595fe71fb4f377b3c1b743a06de6dae..6219537fd9ed1cbf10659b0412e76131378b010d 100644 GIT binary patch delta 15 WcmbQk+rzuz8|&mR%yE-b*en1u;sy%< delta 27 icmeC-ox{7~8!LYRLlHwNLm5LRLq0<(L-FLVtkVH>K?r^T diff --git a/test/TestAssets/DiscoveryTestProject/DiscoveryTestProject.csproj b/test/TestAssets/DiscoveryTestProject/DiscoveryTestProject.csproj index 36b0a05122..944917f05d 100644 --- a/test/TestAssets/DiscoveryTestProject/DiscoveryTestProject.csproj +++ b/test/TestAssets/DiscoveryTestProject/DiscoveryTestProject.csproj @@ -18,7 +18,7 @@ $(MSTestAdapterVersion) - $(NETTestSdkPreviousVersion) + $(NETTestSdkVersion) diff --git a/test/TestAssets/NUTestProject/NUTestProject.csproj b/test/TestAssets/NUTestProject/NUTestProject.csproj index fb54a56e46..cc51b7a261 100644 --- a/test/TestAssets/NUTestProject/NUTestProject.csproj +++ b/test/TestAssets/NUTestProject/NUTestProject.csproj @@ -16,7 +16,7 @@ $(NUnit3AdapterVersion) - $(NETTestSdkPreviousVersion) + $(NETTestSdkVersion) diff --git a/test/TestAssets/PerfAssets/MSTestAdapterPerfTestProject/MSTestAdapterPerfTestProject.csproj b/test/TestAssets/PerfAssets/MSTestAdapterPerfTestProject/MSTestAdapterPerfTestProject.csproj index 59a3438cde..6e74940dfd 100644 --- a/test/TestAssets/PerfAssets/MSTestAdapterPerfTestProject/MSTestAdapterPerfTestProject.csproj +++ b/test/TestAssets/PerfAssets/MSTestAdapterPerfTestProject/MSTestAdapterPerfTestProject.csproj @@ -7,7 +7,7 @@ - + diff --git a/test/TestAssets/PerfAssets/NUnitAdapterPerfTestProject/NUnitAdapterPerfTestProject.csproj b/test/TestAssets/PerfAssets/NUnitAdapterPerfTestProject/NUnitAdapterPerfTestProject.csproj index edf0a3b4ab..6ea0454b43 100644 --- a/test/TestAssets/PerfAssets/NUnitAdapterPerfTestProject/NUnitAdapterPerfTestProject.csproj +++ b/test/TestAssets/PerfAssets/NUnitAdapterPerfTestProject/NUnitAdapterPerfTestProject.csproj @@ -6,7 +6,7 @@ - + diff --git a/test/TestAssets/PerfAssets/XUnitAdapterPerfTestProject/XUnitAdapterPerfTestProject.csproj b/test/TestAssets/PerfAssets/XUnitAdapterPerfTestProject/XUnitAdapterPerfTestProject.csproj index ff60d1d29b..9dcf47a316 100644 --- a/test/TestAssets/PerfAssets/XUnitAdapterPerfTestProject/XUnitAdapterPerfTestProject.csproj +++ b/test/TestAssets/PerfAssets/XUnitAdapterPerfTestProject/XUnitAdapterPerfTestProject.csproj @@ -7,7 +7,7 @@ - + diff --git a/test/TestAssets/ProjectFileRunSettingsTestProject/ProjectFileRunSettingsTestProject.csproj b/test/TestAssets/ProjectFileRunSettingsTestProject/ProjectFileRunSettingsTestProject.csproj index 35adc06cfd..e3bfe6c61b 100644 --- a/test/TestAssets/ProjectFileRunSettingsTestProject/ProjectFileRunSettingsTestProject.csproj +++ b/test/TestAssets/ProjectFileRunSettingsTestProject/ProjectFileRunSettingsTestProject.csproj @@ -18,7 +18,7 @@ $(MSTestAdapterVersion) - $(NETTestSdkPreviousVersion) + $(NETTestSdkVersion) diff --git a/test/TestAssets/SimpleTestProject/SimpleTestProject.csproj b/test/TestAssets/SimpleTestProject/SimpleTestProject.csproj index 638ddbefd5e06201d5ecc2d67a46c6529eb5c784..83ec8fd93d00f4bf25f3777ad578e501ec554bd2 100644 GIT binary patch delta 12 TcmaDObVq1I0o&#Vwl_=wB|8N= delta 28 jcmca3^hRhy0ULh+LlHwNLm5LRLq0<(L-FQ(wzo_Gf#?X9 diff --git a/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj b/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj index 5928a5a0f5..7ff5b967e7 100644 --- a/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj +++ b/test/TestAssets/SimpleTestProject3/SimpleTestProject3.csproj @@ -19,7 +19,7 @@ $(MSTestAdapterVersion) - $(NETTestSdkPreviousVersion) + $(NETTestSdkVersion) diff --git a/test/TestAssets/XUTestProject/XUTestProject.csproj b/test/TestAssets/XUTestProject/XUTestProject.csproj index 442b315021..ad3a6c6e0e 100644 --- a/test/TestAssets/XUTestProject/XUTestProject.csproj +++ b/test/TestAssets/XUTestProject/XUTestProject.csproj @@ -16,7 +16,7 @@ $(XUnitAdapterVersion) - $(NETTestSdkPreviousVersion) + $(NETTestSdkVersion) From 07b87c12fe0070110a9dc6d2fe252222a6e76833 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Thu, 20 Feb 2020 11:52:38 +0100 Subject: [PATCH 09/33] Fix process counting --- scripts/build.ps1 | 5 +- scripts/build/TestPlatform.Dependencies.props | 2 +- .../EventHandler/RunEventHandler.cs | 17 ++++- ...RunTestsWithDifferentConfigurationTests.cs | 45 ++++++------- .../NumberOfProcessLaunchedUtility.cs | 65 +++++++++++-------- 5 files changed, 78 insertions(+), 56 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 9d0934dc52..200d772607 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -228,8 +228,8 @@ function Invoke-TestAssetsBuild Write-Log ".. .. Build: Source: $TPB_TestAssets_Solution" - Write-Verbose "$dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild" - & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild + Write-Verbose "$dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:NETTestSdkVersion=$TPB_Version -p:CIBuild=$TPB_CIBuild" + & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:NETTestSdkVersion=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild Write-Log ".. .. Build: Complete." Set-ScriptFailedOnError @@ -964,6 +964,7 @@ Generate-Manifest Publish-PatchedDotnet Copy-PackageIntoStaticDirectory Invoke-TestAssetsBuild + Write-Log "Build complete. {$(Get-ElapsedTime($timer))}" if ($Script:ScriptFailed) { Exit 1 } else { Exit 0 } \ No newline at end of file diff --git a/scripts/build/TestPlatform.Dependencies.props b/scripts/build/TestPlatform.Dependencies.props index 3f5064fb6e..f898c1b3ed 100644 --- a/scripts/build/TestPlatform.Dependencies.props +++ b/scripts/build/TestPlatform.Dependencies.props @@ -8,7 +8,7 @@ - $(Version) + $(NETTestSdkVersion) 99.99.99-dev diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/EventHandler/RunEventHandler.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/EventHandler/RunEventHandler.cs index b03922b173..b2aebf9da1 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/EventHandler/RunEventHandler.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/EventHandler/RunEventHandler.cs @@ -3,8 +3,9 @@ namespace Microsoft.TestPlatform.AcceptanceTests.TranslationLayerTests { + using System; using System.Collections.Generic; - + using System.Linq; using Microsoft.VisualStudio.TestPlatform.ObjectModel; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; @@ -27,6 +28,8 @@ public class RunEventHandler : ITestRunEventsHandler /// public string LogMessage { get; private set; } + public List Errors { get; set; } + /// /// Gets the test message level. /// @@ -35,12 +38,24 @@ public class RunEventHandler : ITestRunEventsHandler public RunEventHandler() { this.TestResults = new List(); + this.Errors = new List(); + } + + public void EnsureSuccess() + { + if (this.Errors.Any()) + { + throw new InvalidOperationException($"Test run reported errors:{Environment.NewLine}{string.Join(Environment.NewLine + Environment.NewLine, this.Errors)}"); + } } public void HandleLogMessage(TestMessageLevel level, string message) { this.LogMessage = message; this.TestMessageLevel = level; + if (level == TestMessageLevel.Error) { + this.Errors.Add(message); + } } public void HandleTestRunComplete( diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs index 4c3f9e7555..0bc6449207 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs @@ -62,8 +62,8 @@ public void RunTestsWithTestAdapterPath(RunnerInfo runnerInfo) } [TestMethod] - [NetFullTargetFrameworkDataSource] - [NetCoreTargetFrameworkDataSource] + //[NetFullTargetFrameworkDataSource] + [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] public void RunTestsWithRunSettingsWithParallel(RunnerInfo runnerInfo) { AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); @@ -77,21 +77,13 @@ public void RunTestsWithRunSettingsWithParallel(RunnerInfo runnerInfo) "; - string testhostProcessName = string.Empty; + var testHostNames = new[] { "testhost", "testhost.x86", "dotnet" }; int expectedNumOfProcessCreated = 2; - if (this.IsDesktopTargetFramework()) - { - testhostProcessName = "testhost.x86"; - } - else - { - testhostProcessName = "dotnet"; - } var cts = new CancellationTokenSource(); var numOfProcessCreatedTask = NumberOfProcessLaunchedUtility.NumberOfProcessCreated( cts, - testhostProcessName); + testHostNames); this.vstestConsoleWrapper.RunTests( this.GetTestAssemblies(), @@ -101,6 +93,7 @@ public void RunTestsWithRunSettingsWithParallel(RunnerInfo runnerInfo) cts.Cancel(); // Assert + this.runEventHandler.EnsureSuccess(); Assert.AreEqual(6, this.runEventHandler.TestResults.Count); Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Passed)); Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Failed)); @@ -108,7 +101,7 @@ public void RunTestsWithRunSettingsWithParallel(RunnerInfo runnerInfo) Assert.AreEqual( expectedNumOfProcessCreated, numOfProcessCreatedTask.Result, - $"Number of {testhostProcessName} process created, expected: {expectedNumOfProcessCreated} actual: {numOfProcessCreatedTask.Result}"); + $"Number of '{ string.Join(", ", testHostNames) }' process created, expected: {expectedNumOfProcessCreated} actual: {numOfProcessCreatedTask.Result}"); } [TestMethod] @@ -156,21 +149,20 @@ public void RunTestsWithX64Source(RunnerInfo runnerInfo) this.GetAssetFullPath("SimpleTestProject3.dll") }; - string testhostProcessName = string.Empty; + int expectedNumOfProcessCreated = 1; - if (this.IsDesktopTargetFramework()) - { - testhostProcessName = "testhost"; - } - else - { - testhostProcessName = "dotnet"; - } + var testhostProcessNames = new[] { "testhost", "dotnet" }; + + // sdk is now generating .exe for netcoreapp applications as well + // and we are running testhost.exe all the time + // keeping this here in case we see this behavior differ somewhere + // to remind us that this was not always the case + // testhostProcessName = this.IsDesktopTargetFramework() ? "testhost" : "dotnet"; + var cts = new CancellationTokenSource(); var numOfProcessCreatedTask = NumberOfProcessLaunchedUtility.NumberOfProcessCreated( - cts, - testhostProcessName); + cts, testhostProcessNames); this.vstestConsoleWrapper.RunTests( sources, @@ -183,10 +175,11 @@ public void RunTestsWithX64Source(RunnerInfo runnerInfo) // Assert Assert.AreEqual(1, this.runEventHandler.TestResults.Count); Assert.AreEqual(1, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Passed)); + var numberOfProcessCreated = numOfProcessCreatedTask.Result; Assert.AreEqual( expectedNumOfProcessCreated, - numOfProcessCreatedTask.Result, - $"Number of {testhostProcessName} process created, expected: {expectedNumOfProcessCreated} actual: {numOfProcessCreatedTask.Result}"); + numberOfProcessCreated, + $"Number of { string.Join(" ,", testhostProcessNames) } process created, expected: {expectedNumOfProcessCreated} actual: {numberOfProcessCreated}"); } private IList GetTestAssemblies() diff --git a/test/Microsoft.TestPlatform.TestUtilities/NumberOfProcessLaunchedUtility.cs b/test/Microsoft.TestPlatform.TestUtilities/NumberOfProcessLaunchedUtility.cs index 4524751841..6c67bc64c3 100644 --- a/test/Microsoft.TestPlatform.TestUtilities/NumberOfProcessLaunchedUtility.cs +++ b/test/Microsoft.TestPlatform.TestUtilities/NumberOfProcessLaunchedUtility.cs @@ -3,8 +3,11 @@ namespace TestPlatform.TestUtilities { + using System; using System.Collections.Generic; + using System.ComponentModel; using System.Diagnostics; + using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -14,29 +17,27 @@ namespace TestPlatform.TestUtilities public class NumberOfProcessLaunchedUtility { /// - /// To Find the process created by name during this task run + /// Counts processes that are created until cancellation is requested. /// /// - /// To cancel task + /// To cancel the task and finish counting /// - /// - /// Name of the process + /// + /// Name of the process, or a library that is launched by dotnet.exe /// /// /// The . /// public static async Task NumberOfProcessCreated(CancellationTokenSource cts, string processName) { - var testhostProcessIDsBeforeRun = new List(); - var testhostProcessesBeforeRun = Process.GetProcessesByName(processName); - - foreach (var process in testhostProcessesBeforeRun) - { - testhostProcessIDsBeforeRun.Add(process.Id); - } + return await NumberOfProcessCreated(cts, new[] { processName }); + } + + public static async Task NumberOfProcessCreated(CancellationTokenSource cts, IEnumerable processNames) + { + var processesBeforeRun = GetProcesses(processNames); - var numOfProcessTask = - Task.Run(() => NumberOfProcessLaunchedDuringRun(cts.Token, testhostProcessIDsBeforeRun, processName)); + var numOfProcessTask = Task.Run(() => NumberOfProcessLaunchedDuringRun(cts.Token, processesBeforeRun, processNames)); return await numOfProcessTask; } @@ -46,10 +47,10 @@ public static async Task NumberOfProcessCreated(CancellationTokenSource cts /// /// The token. /// - /// - /// The executor processes before run. + /// + /// The processes that were already running. /// - /// + /// /// The process name. /// /// @@ -57,29 +58,41 @@ public static async Task NumberOfProcessCreated(CancellationTokenSource cts /// public static int NumberOfProcessLaunchedDuringRun( CancellationToken token, - List executorProcessesBeforeRun, - string processName) + IEnumerable processesBeforeRun, + IEnumerable processNames) { - var preCreatedProcessIDs = new List(executorProcessesBeforeRun); - var desireCount = 0; + var existingProcessIDs = processesBeforeRun.Select(p => p.Id).ToList(); + var startedCount = 0; while (!token.IsCancellationRequested) { - var executorProcessDuringRun = Process.GetProcessesByName(processName); + var startedDuringRun = GetProcesses(processNames); - foreach (var process in executorProcessDuringRun) + foreach (var process in startedDuringRun) { - if (preCreatedProcessIDs.Contains(process.Id)) + if (existingProcessIDs.Contains(process.Id)) { continue; } - desireCount++; - preCreatedProcessIDs.Add(process.Id); + startedCount++; + existingProcessIDs.Add(process.Id); } } - return desireCount; + return startedCount; + } + + private static IEnumerable GetProcesses(IEnumerable processNames) + { + + var processes = new List(); + foreach (var processName in processNames) + { + processes.AddRange(Process.GetProcessesByName(processName)); + } + + return processes; } } } \ No newline at end of file From 7707776bdf3572c5042f40fc71ebe715f3a8d594 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Thu, 20 Feb 2020 14:23:02 +0100 Subject: [PATCH 10/33] Fix process acceptance tests --- scripts/build.ps1 | 7 +- .../VanguardTests.cs | 4 +- .../AcceptanceTestBase.cs | 22 ------ .../ExecutionTests.cs | 2 +- .../PlatformTests.cs | 37 ++-------- .../RunsettingsTests.cs | 69 ++++++++++++------- ...RunTestsWithDifferentConfigurationTests.cs | 12 ++-- .../NumberOfProcessLaunchedUtility.cs | 16 ++--- .../TestAssets/SimpleTestProject/UnitTest1.cs | 2 +- 9 files changed, 76 insertions(+), 95 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 200d772607..c652aba6ea 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -250,8 +250,13 @@ function Copy-PackageIntoStaticDirectory { function Publish-PatchedDotnet { Write-Log "Publish-PatchedDotnet: Copy local dotnet installation to testArtifacts" $dotnetPath = "$env:TP_TOOLS_DIR\dotnet\" - + $dotnetTestArtifactsPath = "$env:TP_TESTARTIFACTS\dotnet\" + + if (Test-Path $dotnetTestArtifactsPath) { + Remove-Item -Force -Recurse $dotnetTestArtifactsPath + } + $dotnetTestArtifactsSdkPath = "$env:TP_TESTARTIFACTS\dotnet\sdk\$env:DOTNET_CLI_VERSION\" Copy-Item $dotnetPath $dotnetTestArtifactsPath -Force -Recurse diff --git a/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs b/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs index a60e00cc4f..c3bcc4b01a 100644 --- a/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs +++ b/test/DataCollectors/TraceDataCollector.UnitTests/VanguardTests.cs @@ -109,7 +109,7 @@ public void StartShouldStartVanguardProcessWithCollectCommand() this.vanguard.Start(this.outputFileName, this.dataCollectionContext); cts.Cancel(); - var numOfProcessCreated = numOfProcessCreatedTask.Result; + var numOfProcessCreated = numOfProcessCreatedTask.Result.Count; // TODO find the reason why additional process launched when collecting code coverage. Assert.IsTrue(numOfProcessCreated == 1 || numOfProcessCreated == 2, $"Number of process created:{numOfProcessCreated} expected is 1 or 2."); @@ -172,7 +172,7 @@ public void StopShouldLaunchVarguardWithShutdownCommand() this.vanguard.Stop(); cts.Cancel(); - var numOfProcessCreated = numOfProcessCreatedTask.Result; + var numOfProcessCreated = numOfProcessCreatedTask.Result.Count; // TODO find the reason why additional process launched when collecting code coverage. Assert.IsTrue(numOfProcessCreated == 2 || numOfProcessCreated == 4, $"Number of process created:{numOfProcessCreated} expected is 2 or 4."); diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/AcceptanceTestBase.cs b/test/Microsoft.TestPlatform.AcceptanceTests/AcceptanceTestBase.cs index 14901481f6..9b8e324a62 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/AcceptanceTestBase.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/AcceptanceTestBase.cs @@ -64,28 +64,6 @@ protected string GetTargetFramworkForRunsettings() return targetFramework; } - protected string GetTestHostProcessName(string targetPlatform) - { - var testHostProcessName = string.Empty; - if (this.IsDesktopTargetFramework()) - { - if (string.Equals(targetPlatform, "x86", StringComparison.OrdinalIgnoreCase)) - { - testHostProcessName = "testhost.x86"; - } - else - { - testHostProcessName = "testhost"; - } - } - else - { - testHostProcessName = "dotnet"; - } - - return testHostProcessName; - } - /// /// Default RunSettings /// diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/ExecutionTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/ExecutionTests.cs index cf753be315..69fd20fb8c 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/ExecutionTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/ExecutionTests.cs @@ -94,7 +94,7 @@ public void RunMultipleTestAssembliesInParallel(RunnerInfo runnerInfo) Assert.AreEqual( expectedNumOfProcessCreated, numOfProcessCreatedTask.Result, - $"Number of {testhostProcessName} process created, expected: {expectedNumOfProcessCreated} actual: {numOfProcessCreatedTask.Result}"); + $"Number of {testhostProcessName} process created, expected: {expectedNumOfProcessCreated} actual: {numOfProcessCreatedTask.Result.Count} ({ string.Join(", ", numOfProcessCreatedTask.Result) })"); this.ValidateSummaryStatus(2, 2, 2); this.ExitCodeEquals(1); // failing tests } diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/PlatformTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/PlatformTests.cs index 4d140cbdea..db01345717 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/PlatformTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/PlatformTests.cs @@ -23,12 +23,7 @@ public void RunTestExecutionWithPlatformx64(RunnerInfo runnerInfo) AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); var platformArg = " /Platform:x64"; - string testhostProcessName = string.Empty; - int expectedNumOfProcessCreated = 0; - string desktopHostProcessName = "testhost"; - - SetExpectedParams(ref expectedNumOfProcessCreated, ref testhostProcessName, desktopHostProcessName); - this.RunTestExecutionWithPlatform(platformArg, testhostProcessName, expectedNumOfProcessCreated); + this.RunTestExecutionWithPlatform(platformArg, "testhost", 1); } /// @@ -42,33 +37,13 @@ public void RunTestExecutionWithPlatformx86(RunnerInfo runnerInfo) AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); var platformArg = " /Platform:x86"; - string testhostProcessName = string.Empty; - int expectedNumOfProcessCreated = 0; - string desktopHostProcessName = "testhost.x86"; - - SetExpectedParams(ref expectedNumOfProcessCreated, ref testhostProcessName, desktopHostProcessName); - this.RunTestExecutionWithPlatform(platformArg, testhostProcessName, expectedNumOfProcessCreated); + this.RunTestExecutionWithPlatform(platformArg, "testhost.x86", 1); } private void SetExpectedParams(ref int expectedNumOfProcessCreated, ref string testhostProcessName, string desktopHostProcessName) { - if (this.IsDesktopTargetFramework()) - { - testhostProcessName = desktopHostProcessName; - expectedNumOfProcessCreated = 1; - } - else - { - testhostProcessName = "dotnet"; - if (this.IsDesktopRunner()) - { - expectedNumOfProcessCreated = 1; - } - else - { - expectedNumOfProcessCreated = 2; - } - } + testhostProcessName = desktopHostProcessName; + expectedNumOfProcessCreated = 1; } private void RunTestExecutionWithPlatform(string platformArg, string testhostProcessName, int expectedNumOfProcessCreated) @@ -91,8 +66,8 @@ private void RunTestExecutionWithPlatform(string platformArg, string testhostPro Assert.AreEqual( expectedNumOfProcessCreated, - numOfProcessCreatedTask.Result, - $"Number of {testhostProcessName} process created, expected: {expectedNumOfProcessCreated} actual: {numOfProcessCreatedTask.Result} args: {arguments} runner path: {this.GetConsoleRunnerPath()}"); + numOfProcessCreatedTask.Result.Count, + $"Number of {testhostProcessName} process created, expected: {expectedNumOfProcessCreated} actual: {numOfProcessCreatedTask.Result.Count} ({ string.Join(", ", numOfProcessCreatedTask.Result) }) args: {arguments} runner path: {this.GetConsoleRunnerPath()}"); this.ValidateSummaryStatus(1, 1, 1); } } diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs index 8066cd512e..c0d77a95fc 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/RunsettingsTests.cs @@ -38,7 +38,7 @@ public void CommandLineRunSettingsShouldWinAmongAllOptions(RunnerInfo runnerInfo AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); var targetPlatform = "x86"; - var testhostProcessName = this.GetTestHostProcessName(targetPlatform); + var testhostProcessName = new[] { "testhost.x86", "dotnet" }; var expectedNumOfProcessCreated = GetExpectedNumOfProcessCreatedForWithoutParallel(); // passing parallel @@ -75,7 +75,7 @@ public void CLIRunsettingsShouldWinBetweenCLISwitchesAndCLIRunsettings(RunnerInf AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); var targetPlatform = "x86"; - var testhostProcessName = this.GetTestHostProcessName(targetPlatform); + var testhostProcessName = new[] { "testhost.x86", "dotnet" }; var expectedNumOfProcessCreated = GetExpectedNumOfProcessCreatedForWithoutParallel(); // Pass parallel @@ -108,8 +108,7 @@ public void CommandLineSwitchesShouldWinBetweenSettingsFileAndCommandLineSwitche { AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); - var targetPlatform = "x86"; - var testhostProcessName = this.GetTestHostProcessName(targetPlatform); + var testhostProcessName = new[] { "testhost.x86", "dotnet" }; var expectedNumOfProcessCreated = GetExpectedNumOfProcessCreatedForWithoutParallel(); // passing different platform @@ -135,8 +134,8 @@ public void RunSettingsWithoutParallelAndPlatformX86(RunnerInfo runnerInfo) AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); var targetPlatform = "x86"; - var testhostProcessName = this.GetTestHostProcessName(targetPlatform); - var expectedNumOfProcessCreated = GetExpectedNumOfProcessCreatedForWithoutParallel(); + var testhostProcessNames = new[] { "testhost.x86" }; + var expectedNumOfProcessCreated = 1; var runConfigurationDictionary = new Dictionary { @@ -145,7 +144,7 @@ public void RunSettingsWithoutParallelAndPlatformX86(RunnerInfo runnerInfo) { "TargetFrameworkVersion", this.GetTargetFramworkForRunsettings() }, { "TestAdaptersPaths", this.GetTestAdapterPath() } }; - this.RunTestWithRunSettings(runConfigurationDictionary, null, null, testhostProcessName, expectedNumOfProcessCreated); + this.RunTestWithRunSettings(runConfigurationDictionary, null, null, testhostProcessNames, expectedNumOfProcessCreated); } [TestMethod] @@ -156,8 +155,8 @@ public void RunSettingsParamsAsArguments(RunnerInfo runnerInfo) AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); var targetPlatform = "x86"; - var testhostProcessName = this.GetTestHostProcessName(targetPlatform); - var expectedNumOfProcessCreated = GetExpectedNumOfProcessCreatedForWithoutParallel(); + var testhostProcessName = new[] { "testhost.x86" }; + var expectedNumOfProcessCreated = 1; var runSettingsArgs = String.Join( " ", @@ -180,8 +179,8 @@ public void RunSettingsAndRunSettingsParamsAsArguments(RunnerInfo runnerInfo) AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); var targetPlatform = "x86"; - var testhostProcessName = this.GetTestHostProcessName(targetPlatform); - var expectedNumOfProcessCreated = GetExpectedNumOfProcessCreatedForWithoutParallel(); + var testhostProcessName = new[] { "testhost.x86" }; + var expectedNumOfProcessCreated = 1; var runConfigurationDictionary = new Dictionary { { "MaxCpuCount", "2" }, @@ -211,10 +210,12 @@ public void RunSettingsWithParallelAndPlatformX64(RunnerInfo runnerInfo) AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); var targetPlatform = "x64"; - var testhostProcessName = this.GetTestHostProcessName(targetPlatform); + var testhostProcessName = new[] { "testhost", "dotnet" }; var expectedProcessCreated = 2; - if (!this.IsDesktopTargetFramework() && !this.IsDesktopRunner()) + if (!this.IsDesktopRunner()) { + // this creates dotnet hosted vstest console and 2 testhosts one of which is hosted + // in dotnet, so we have two dotnet + 1 testhost.exe expectedProcessCreated = 3; } @@ -519,7 +520,7 @@ private string GetRunsettingsFilePath(Dictionary runConfiguratio } private void RunTestWithRunSettings(Dictionary runConfigurationDictionary, - string runSettingsArgs, string additionalArgs, string testhostProcessName, int expectedNumOfProcessCreated) + string runSettingsArgs, string additionalArgs, IEnumerable testhostProcessNames, int expectedNumOfProcessCreated) { var assemblyPaths = this.BuildMultipleAssemblyPath("SimpleTestProject.dll", "SimpleTestProject2.dll").Trim('\"'); @@ -546,16 +547,17 @@ private void RunTestWithRunSettings(Dictionary runConfigurationD var cts = new CancellationTokenSource(); var numOfProcessCreatedTask = NumberOfProcessLaunchedUtility.NumberOfProcessCreated( cts, - testhostProcessName); + testhostProcessNames); this.InvokeVsTest(arguments); cts.Cancel(); + var processesCreated = numOfProcessCreatedTask.Result; // assert Assert.AreEqual( expectedNumOfProcessCreated, - numOfProcessCreatedTask.Result, - $"Number of {testhostProcessName} process created, expected: {expectedNumOfProcessCreated} actual: {numOfProcessCreatedTask.Result} args: {arguments} runner path: {this.GetConsoleRunnerPath()}"); + processesCreated.Count, + $"Number of { string.Join(", ", testhostProcessNames) } process created, expected: {expectedNumOfProcessCreated} actual: {processesCreated.Count} ({ string.Join(", ", processesCreated) }) args: {arguments} runner path: {this.GetConsoleRunnerPath()}"); this.ValidateSummaryStatus(2, 2, 2); //cleanup @@ -567,16 +569,37 @@ private void RunTestWithRunSettings(Dictionary runConfigurationD private int GetExpectedNumOfProcessCreatedForWithoutParallel() { - int expectedNumOfProcessCreated; - if (this.IsDesktopTargetFramework()) + if (this.IsDesktopRunner() && this.IsDesktopTargetFramework()) + { + // we create just testhost.exe + return 1; + } + + if (this.IsDesktopRunner() && !this.IsDesktopTargetFramework()) + { + // we create dotnet testhost and testhost.exe + return 2; + } + + if (!this.IsDesktopRunner() && this.IsDesktopTargetFramework()) { - expectedNumOfProcessCreated = 1; + // we create testhost and testhost + return 2; } - else + + if (!this.IsDesktopRunner() && this.IsDesktopTargetFramework() && this.testEnvironment.InIsolationValue == "InProcess") { - expectedNumOfProcessCreated = this.IsDesktopRunner() ? 2 : 3; + // we create just testhost + return 1; } - return expectedNumOfProcessCreated; + + if (!this.IsDesktopRunner() && !this.IsDesktopTargetFramework()) + { + // we create dotnet vsconsole, and 2 dotnet test hosts + return 3; + } + + return -10; } } } diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs index 0bc6449207..fe5270c2db 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs @@ -62,8 +62,8 @@ public void RunTestsWithTestAdapterPath(RunnerInfo runnerInfo) } [TestMethod] - //[NetFullTargetFrameworkDataSource] - [NetCoreTargetFrameworkDataSource(useDesktopRunner: false)] + [NetFullTargetFrameworkDataSource] + [NetCoreTargetFrameworkDataSource] public void RunTestsWithRunSettingsWithParallel(RunnerInfo runnerInfo) { AcceptanceTestBase.SetTestEnvironment(this.testEnvironment, runnerInfo); @@ -100,8 +100,8 @@ public void RunTestsWithRunSettingsWithParallel(RunnerInfo runnerInfo) Assert.AreEqual(2, this.runEventHandler.TestResults.Count(t => t.Outcome == TestOutcome.Skipped)); Assert.AreEqual( expectedNumOfProcessCreated, - numOfProcessCreatedTask.Result, - $"Number of '{ string.Join(", ", testHostNames) }' process created, expected: {expectedNumOfProcessCreated} actual: {numOfProcessCreatedTask.Result}"); + numOfProcessCreatedTask.Result.Count, + $"Number of '{ string.Join(", ", testHostNames) }' process created, expected: {expectedNumOfProcessCreated} actual: {numOfProcessCreatedTask.Result.Count} ({ string.Join(", ", numOfProcessCreatedTask.Result) })"); } [TestMethod] @@ -178,8 +178,8 @@ public void RunTestsWithX64Source(RunnerInfo runnerInfo) var numberOfProcessCreated = numOfProcessCreatedTask.Result; Assert.AreEqual( expectedNumOfProcessCreated, - numberOfProcessCreated, - $"Number of { string.Join(" ,", testhostProcessNames) } process created, expected: {expectedNumOfProcessCreated} actual: {numberOfProcessCreated}"); + numberOfProcessCreated.Count, + $"Number of { string.Join(" ,", testhostProcessNames) } process created, expected: {expectedNumOfProcessCreated} actual: {numberOfProcessCreated.Count} ({ string.Join(", ", numberOfProcessCreated) })"); } private IList GetTestAssemblies() diff --git a/test/Microsoft.TestPlatform.TestUtilities/NumberOfProcessLaunchedUtility.cs b/test/Microsoft.TestPlatform.TestUtilities/NumberOfProcessLaunchedUtility.cs index 6c67bc64c3..5a1828d0f0 100644 --- a/test/Microsoft.TestPlatform.TestUtilities/NumberOfProcessLaunchedUtility.cs +++ b/test/Microsoft.TestPlatform.TestUtilities/NumberOfProcessLaunchedUtility.cs @@ -28,17 +28,17 @@ public class NumberOfProcessLaunchedUtility /// /// The . /// - public static async Task NumberOfProcessCreated(CancellationTokenSource cts, string processName) + public static async Task> NumberOfProcessCreated(CancellationTokenSource cts, string processName) { return await NumberOfProcessCreated(cts, new[] { processName }); } - public static async Task NumberOfProcessCreated(CancellationTokenSource cts, IEnumerable processNames) + public static async Task> NumberOfProcessCreated(CancellationTokenSource cts, IEnumerable processNames) { var processesBeforeRun = GetProcesses(processNames); - var numOfProcessTask = Task.Run(() => NumberOfProcessLaunchedDuringRun(cts.Token, processesBeforeRun, processNames)); - return await numOfProcessTask; + var processesCreated = Task.Run(() => NumberOfProcessLaunchedDuringRun(cts.Token, processesBeforeRun, processNames)); + return await processesCreated; } /// @@ -56,13 +56,13 @@ public static async Task NumberOfProcessCreated(CancellationTokenSource cts /// /// The . /// - public static int NumberOfProcessLaunchedDuringRun( + public static ICollection NumberOfProcessLaunchedDuringRun( CancellationToken token, IEnumerable processesBeforeRun, IEnumerable processNames) { var existingProcessIDs = processesBeforeRun.Select(p => p.Id).ToList(); - var startedCount = 0; + var startedNames = new List(); while (!token.IsCancellationRequested) { @@ -75,12 +75,12 @@ public static int NumberOfProcessLaunchedDuringRun( continue; } - startedCount++; + startedNames.Add(process.ProcessName); existingProcessIDs.Add(process.Id); } } - return startedCount; + return startedNames; } private static IEnumerable GetProcesses(IEnumerable processNames) diff --git a/test/TestAssets/SimpleTestProject/UnitTest1.cs b/test/TestAssets/SimpleTestProject/UnitTest1.cs index ccb01aef4c..db76bd41e7 100644 --- a/test/TestAssets/SimpleTestProject/UnitTest1.cs +++ b/test/TestAssets/SimpleTestProject/UnitTest1.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace SampleUnitTestProject +namespace SampleUnitTestProjectProjectFileRunSettingsTestProject { using System; using System.IO; From 0451b4bcbef587d53e66922a5ae1c2a174f8691e Mon Sep 17 00:00:00 2001 From: nohwnd Date: Thu, 20 Feb 2020 14:27:51 +0100 Subject: [PATCH 11/33] use NETCOREAPP instead of NET451 --- scripts/build.ps1 | 6 +++--- src/testhost.x86/TestHostTraceListener.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index c652aba6ea..9edd36ec08 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -184,9 +184,9 @@ function Clear-Package { # this is cache-busting the nuget packages, so we don't reuse them from cache # after we built new ones if (Test-Path $env:TP_PACKAGES_DIR) { - $devPackages = Get-ChildItem $env:TP_PACKAGES_DIR/microsoft.*/$TPB_Version | Select-Object -ExpandProperty FullName - $devPackages | Remove-Item -Force -Recurse -Confirm:$false -} + $devPackages = Get-ChildItem $env:TP_PACKAGES_DIR/microsoft.*/$TPB_Version | Select-Object -ExpandProperty FullName + $devPackages | Remove-Item -Force -Recurse -Confirm:$false + } } function Restore-Package diff --git a/src/testhost.x86/TestHostTraceListener.cs b/src/testhost.x86/TestHostTraceListener.cs index fc4f30b8b3..2bb788a0d9 100644 --- a/src/testhost.x86/TestHostTraceListener.cs +++ b/src/testhost.x86/TestHostTraceListener.cs @@ -4,7 +4,7 @@ namespace Microsoft.VisualStudio.TestPlatform.TestHost { -#if !NET451 +#if NETCOREAPP using Microsoft.VisualStudio.TestPlatform.ObjectModel; using System; using System.Diagnostics; From 9eb5cca8aff3103c6c9a88748c4ce02c801efaa3 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Thu, 20 Feb 2020 17:16:16 +0100 Subject: [PATCH 12/33] Fixing build --- scripts/build.ps1 | 10 +++++----- scripts/build.sh | 2 +- scripts/build/TestPlatform.Dependencies.props | 2 +- src/testhost.x86/DefaultEngineInvoker.cs | 2 +- .../RunTestsWithDifferentConfigurationTests.cs | 7 ------- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 9edd36ec08..8ab3b62346 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -167,9 +167,9 @@ function Install-DotNetCli # Pull in additional shared frameworks. # Get netcoreapp2.1 shared components. - if (!(Test-Path "$dotnetInstallPath\shared\Microsoft.NETCore.App\2.1.0")) { - & $dotnetInstallScript -InstallDir $dotnetInstallPath -SharedRuntime -Version '2.1.0' -Channel 'release/2.1.0' - } + + & $dotnetInstallScript -InstallDir $dotnetInstallPath -Runtime -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x64 + & $dotnetInstallScript -InstallDir $dotnetInstallPath -Runtime -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x86 # Get shared components which is compatible with dotnet cli version $env:DOTNET_CLI_VERSION #if (!(Test-Path "$dotnetInstallPath\shared\Microsoft.NETCore.App\$env:DOTNET_RUNTIME_VERSION")) { @@ -228,8 +228,8 @@ function Invoke-TestAssetsBuild Write-Log ".. .. Build: Source: $TPB_TestAssets_Solution" - Write-Verbose "$dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:NETTestSdkVersion=$TPB_Version -p:CIBuild=$TPB_CIBuild" - & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:NETTestSdkVersion=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild + Write-Verbose "$dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild" + & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:NETTestSdkVersion="$TPB_Version" -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild Write-Log ".. .. Build: Complete." Set-ScriptFailedOnError diff --git a/scripts/build.sh b/scripts/build.sh index e27183e4ce..8d4bd0537f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -111,7 +111,7 @@ VERSION=$(test -z $VERSION && grep TPVersionPrefix $TP_ROOT_DIR/scripts/build/Te export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 # Dotnet build doesnt support --packages yet. See https://github.com/dotnet/cli/issues/2712 export NUGET_PACKAGES=$TP_PACKAGES_DIR -DOTNET_CLI_VERSION="3.1.100-preview2-014569" +DOTNET_CLI_VERSION="3.1.100" #DOTNET_RUNTIME_VERSION="LATEST" # diff --git a/scripts/build/TestPlatform.Dependencies.props b/scripts/build/TestPlatform.Dependencies.props index f898c1b3ed..3f5064fb6e 100644 --- a/scripts/build/TestPlatform.Dependencies.props +++ b/scripts/build/TestPlatform.Dependencies.props @@ -8,7 +8,7 @@ - $(NETTestSdkVersion) + $(Version) 99.99.99-dev diff --git a/src/testhost.x86/DefaultEngineInvoker.cs b/src/testhost.x86/DefaultEngineInvoker.cs index 7f7c83507a..fe13f03904 100644 --- a/src/testhost.x86/DefaultEngineInvoker.cs +++ b/src/testhost.x86/DefaultEngineInvoker.cs @@ -84,7 +84,7 @@ public void Invoke(IDictionary argsDictionary) #endif } -#if !NET451 +#if NETCOREAPP TestHostTraceListener.Setup(); #endif diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs index fe5270c2db..910e723317 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/TranslationLayerTests/RunTestsWithDifferentConfigurationTests.cs @@ -153,13 +153,6 @@ public void RunTestsWithX64Source(RunnerInfo runnerInfo) int expectedNumOfProcessCreated = 1; var testhostProcessNames = new[] { "testhost", "dotnet" }; - // sdk is now generating .exe for netcoreapp applications as well - // and we are running testhost.exe all the time - // keeping this here in case we see this behavior differ somewhere - // to remind us that this was not always the case - // testhostProcessName = this.IsDesktopTargetFramework() ? "testhost" : "dotnet"; - - var cts = new CancellationTokenSource(); var numOfProcessCreatedTask = NumberOfProcessLaunchedUtility.NumberOfProcessCreated( cts, testhostProcessNames); From ccbd375fd0e9f6eb63264a5df85369dcc55ce85a Mon Sep 17 00:00:00 2001 From: nohwnd Date: Fri, 21 Feb 2020 08:17:30 +0100 Subject: [PATCH 13/33] Fix params --- scripts/build.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 8ab3b62346..4ddf3f7bad 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -168,8 +168,8 @@ function Install-DotNetCli # Pull in additional shared frameworks. # Get netcoreapp2.1 shared components. - & $dotnetInstallScript -InstallDir $dotnetInstallPath -Runtime -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x64 - & $dotnetInstallScript -InstallDir $dotnetInstallPath -Runtime -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x86 + & $dotnetInstallScript -InstallDir $dotnetInstallPath -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x64 + & $dotnetInstallScript -InstallDir $dotnetInstallPath -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x86 # Get shared components which is compatible with dotnet cli version $env:DOTNET_CLI_VERSION #if (!(Test-Path "$dotnetInstallPath\shared\Microsoft.NETCore.App\$env:DOTNET_RUNTIME_VERSION")) { From 4461f19ade91b0935b9b14be4ed86d7d18ef59ee Mon Sep 17 00:00:00 2001 From: nohwnd Date: Fri, 21 Feb 2020 10:47:40 +0100 Subject: [PATCH 14/33] Specify dotnet_root --- scripts/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 4ddf3f7bad..f6aeaf6afd 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -175,7 +175,7 @@ function Install-DotNetCli #if (!(Test-Path "$dotnetInstallPath\shared\Microsoft.NETCore.App\$env:DOTNET_RUNTIME_VERSION")) { #& $dotnetInstallScript -InstallDir $dotnetInstallPath -SharedRuntime -Version $env:DOTNET_RUNTIME_VERSION -Channel 'master' #} - + $env:DOTNET_ROOT= $dotnetInstallPath Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" } From 973a715e30cb8a31e75acd75ef9c6a08f1f2a8f1 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Fri, 21 Feb 2020 14:05:42 +0100 Subject: [PATCH 15/33] Install x86 runtime --- scripts/build.ps1 | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index f6aeaf6afd..03dbed9b20 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -168,14 +168,12 @@ function Install-DotNetCli # Pull in additional shared frameworks. # Get netcoreapp2.1 shared components. - & $dotnetInstallScript -InstallDir $dotnetInstallPath -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x64 - & $dotnetInstallScript -InstallDir $dotnetInstallPath -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x86 - - # Get shared components which is compatible with dotnet cli version $env:DOTNET_CLI_VERSION - #if (!(Test-Path "$dotnetInstallPath\shared\Microsoft.NETCore.App\$env:DOTNET_RUNTIME_VERSION")) { - #& $dotnetInstallScript -InstallDir $dotnetInstallPath -SharedRuntime -Version $env:DOTNET_RUNTIME_VERSION -Channel 'master' - #} + & $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x64 $env:DOTNET_ROOT= $dotnetInstallPath + + & $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x86 + ${env:DOTNET_ROOT(x86)} = "${dotnetInstallPath}_x86" + Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" } From b5b998dfaad927c13aeb1158475970ab8534992b Mon Sep 17 00:00:00 2001 From: nohwnd Date: Fri, 21 Feb 2020 14:45:12 +0100 Subject: [PATCH 16/33] fff --- global.json | 3 --- scripts/build.ps1 | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/global.json b/global.json index af3ec97876..1321affc3d 100644 --- a/global.json +++ b/global.json @@ -5,8 +5,5 @@ "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20052.1", "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20052.1" - }, - "sdk": { - "version" : "3.1.100" } } \ No newline at end of file diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 03dbed9b20..a40d1f1fea 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -174,6 +174,11 @@ function Install-DotNetCli & $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x86 ${env:DOTNET_ROOT(x86)} = "${dotnetInstallPath}_x86" + "x64 dotnet" + & "$env:DOTNET_ROOT\dotnet.exe" --info + "x86 dotnet" + & "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info + Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" } From b0757be8284327c88f40d5c47b7d9fbc815f97c5 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Fri, 21 Feb 2020 14:58:04 +0100 Subject: [PATCH 17/33] bb --- scripts/build.ps1 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index a40d1f1fea..0e13fd9b07 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -163,22 +163,29 @@ function Install-DotNetCli Write-Log "Install-DotNetCli: Get the latest dotnet cli toolset..." $dotnetInstallPath = Join-Path $env:TP_TOOLS_DIR "dotnet" New-Item -ItemType directory -Path $dotnetInstallPath -Force | Out-Null - & $dotnetInstallScript -Channel "master" -InstallDir $dotnetInstallPath -NoPath -Version $env:DOTNET_CLI_VERSION + & $dotnetInstallScript -Channel "master" -InstallDir $dotnetInstallPath -Version $env:DOTNET_CLI_VERSION # Pull in additional shared frameworks. # Get netcoreapp2.1 shared components. - & $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x64 + & $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x64 -NoPath $env:DOTNET_ROOT= $dotnetInstallPath - & $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x86 + & $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Version '2.1.0' -Channel 'release/2.1.0' -Architecture x86 -NoPath ${env:DOTNET_ROOT(x86)} = "${dotnetInstallPath}_x86" + + $env:DOTNET_MULTILEVEL_LOOKUP=0 - "x64 dotnet" + "---- dotnet environment variables" + Get-ChildItem "Env:\dotnet_*" + + "`n`n---- x64 dotnet" & "$env:DOTNET_ROOT\dotnet.exe" --info - "x86 dotnet" + + "`n`n---- x86 dotnet" & "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info + Write-Log "Install-DotNetCli: Complete. {$(Get-ElapsedTime($timer))}" } From 3a63812196f41b1700fec5230e74fd1aedbc4b9a Mon Sep 17 00:00:00 2001 From: nohwnd Date: Fri, 21 Feb 2020 15:09:11 +0100 Subject: [PATCH 18/33] Set the env for tests as well --- scripts/test.ps1 | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/scripts/test.ps1 b/scripts/test.ps1 index adaed530e8..338e5e39eb 100644 --- a/scripts/test.ps1 +++ b/scripts/test.ps1 @@ -59,15 +59,32 @@ $env:TP_ROOT_DIR = (Get-Item (Split-Path $MyInvocation.MyCommand.Path)).Parent.F $env:TP_TOOLS_DIR = Join-Path $env:TP_ROOT_DIR "tools" $env:TP_PACKAGES_DIR = Join-Path $env:TP_ROOT_DIR "packages" $env:TP_OUT_DIR = Join-Path $env:TP_ROOT_DIR "artifacts" + +Write-Verbose "Setup dotnet configuration." # Add latest dotnet.exe directory to environment variable PATH to tests run on latest dotnet. $env:PATH = "$(Split-Path $(Get-DotNetPath));$env:PATH" -# -# Dotnet configuration -# +# set the roots to use only the versions of dotnet that we installed +$env:DOTNET_ROOT = Join-Path $env:TP_TOOLS_DIR "dotnet" +# set the root for x86 runtimes as well +${env:DOTNET_ROOT(x86)} = "${env:DOTNET_ROOT}_x86" +# disable looking up other dotnets in programfiles +$env:DOTNET_MULTILEVEL_LOOKUP = 0 + # Disable first run since we want to control all package sources -Write-Verbose "Setup dotnet configuration." $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1 + +# list what we have set and what is available +"---- dotnet environment variables" +Get-ChildItem "Env:\dotnet_*" + +"`n`n---- x64 dotnet" +& "$env:DOTNET_ROOT\dotnet.exe" --info + +"`n`n---- x86 dotnet" +& "${env:DOTNET_ROOT(x86)}\dotnet.exe" --info + + # Dotnet build doesn't support --packages yet. See https://github.com/dotnet/cli/issues/2712 $env:NUGET_PACKAGES = $env:TP_PACKAGES_DIR From bb8e3a9a73489837877d32bf407f8c707b0fcda5 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Fri, 21 Feb 2020 16:17:22 +0100 Subject: [PATCH 19/33] fix namespace --- test/TestAssets/SimpleTestProject/UnitTest1.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/TestAssets/SimpleTestProject/UnitTest1.cs b/test/TestAssets/SimpleTestProject/UnitTest1.cs index db76bd41e7..ccb01aef4c 100644 --- a/test/TestAssets/SimpleTestProject/UnitTest1.cs +++ b/test/TestAssets/SimpleTestProject/UnitTest1.cs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -namespace SampleUnitTestProjectProjectFileRunSettingsTestProject +namespace SampleUnitTestProject { using System; using System.IO; From 7e936ff749a814764f731035fe594ffe9d55bbb2 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Fri, 21 Feb 2020 16:33:20 +0100 Subject: [PATCH 20/33] Fix var --- scripts/build.ps1 | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 0e13fd9b07..32d7011173 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -239,7 +239,7 @@ function Invoke-TestAssetsBuild Write-Log ".. .. Build: Source: $TPB_TestAssets_Solution" Write-Verbose "$dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild" - & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:NETTestSdkVersion="$TPB_Version" -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild + & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version="$TPB_Version" -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild -bl Write-Log ".. .. Build: Complete." Set-ScriptFailedOnError @@ -966,18 +966,18 @@ Write-Log "Test platform environment variables: " Get-ChildItem env: | Where-Object -FilterScript { $_.Name.StartsWith("TP_") } | Format-Table Write-Log "Test platform build variables: " Get-Variable | Where-Object -FilterScript { $_.Name.StartsWith("TPB_") } | Format-Table -Install-DotNetCli -Clear-Package -Restore-Package -Update-LocalizedResources -Invoke-Build -Publish-Package -Publish-Tests -Create-VsixPackage -Create-NugetPackages -Generate-Manifest -Publish-PatchedDotnet -Copy-PackageIntoStaticDirectory +# Install-DotNetCli +# Clear-Package +# Restore-Package +# Update-LocalizedResources +# Invoke-Build +# Publish-Package +# Publish-Tests +# Create-VsixPackage +# Create-NugetPackages +# Generate-Manifest +# Publish-PatchedDotnet +# Copy-PackageIntoStaticDirectory Invoke-TestAssetsBuild Write-Log "Build complete. {$(Get-ElapsedTime($timer))}" From 62eabc451de6643dcfe91e65b62c58799f3b3ba9 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Fri, 21 Feb 2020 16:47:45 +0100 Subject: [PATCH 21/33] revert build --- scripts/build.ps1 | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 32d7011173..0fc7ab7fee 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -239,7 +239,7 @@ function Invoke-TestAssetsBuild Write-Log ".. .. Build: Source: $TPB_TestAssets_Solution" Write-Verbose "$dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild" - & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version="$TPB_Version" -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild -bl + & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version="$TPB_Version" -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild Write-Log ".. .. Build: Complete." Set-ScriptFailedOnError @@ -966,18 +966,18 @@ Write-Log "Test platform environment variables: " Get-ChildItem env: | Where-Object -FilterScript { $_.Name.StartsWith("TP_") } | Format-Table Write-Log "Test platform build variables: " Get-Variable | Where-Object -FilterScript { $_.Name.StartsWith("TPB_") } | Format-Table -# Install-DotNetCli -# Clear-Package -# Restore-Package -# Update-LocalizedResources -# Invoke-Build -# Publish-Package -# Publish-Tests -# Create-VsixPackage -# Create-NugetPackages -# Generate-Manifest -# Publish-PatchedDotnet -# Copy-PackageIntoStaticDirectory +Install-DotNetCli +Clear-Package +Restore-Package +Update-LocalizedResources +Invoke-Build +Publish-Package +Publish-Tests +Create-VsixPackage +Create-NugetPackages +Generate-Manifest +Publish-PatchedDotnet +Copy-PackageIntoStaticDirectory Invoke-TestAssetsBuild Write-Log "Build complete. {$(Get-ElapsedTime($timer))}" From b175d213c5ea1f85f11410370f80fa18dfacd4a8 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Fri, 21 Feb 2020 17:48:27 +0100 Subject: [PATCH 22/33] Fix tests in parallel --- .../ExecutionTests.cs | 29 +++++-------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/ExecutionTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/ExecutionTests.cs index 69fd20fb8c..78b9ad46b3 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/ExecutionTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/ExecutionTests.cs @@ -63,37 +63,24 @@ public void RunMultipleTestAssembliesInParallel(RunnerInfo runnerInfo) arguments = string.Concat(arguments, " /Parallel"); arguments = string.Concat(arguments, " /Platform:x86"); string testhostProcessName = string.Empty; - int expectedNumOfProcessCreated = 0; - if (this.IsDesktopTargetFramework()) - { - testhostProcessName = "testhost.x86"; - expectedNumOfProcessCreated = 2; - } - else - { - testhostProcessName = "dotnet"; - if (this.IsDesktopRunner()) - { - expectedNumOfProcessCreated = 2; - } - else - { - // Include launcher dotnet.exe - expectedNumOfProcessCreated = 3; - } - } + // for the desktop we will run testhost.x86 in two copies, but for core + // we will run a combination of testhost.x86 and dotnet, where the dotnet will be + // the test console, and sometimes it will be the test host (e.g dotnet, dotnet, testhost.x86, or dotnet, testhost.x86, testhost.x86) + // based on the target framework + int expectedNumOfProcessCreated = this.IsDesktopRunner() ? 2 : 3; + var testhostProcessNames = new [] { "testhost.x86", "dotnet" }; var cts = new CancellationTokenSource(); var numOfProcessCreatedTask = NumberOfProcessLaunchedUtility.NumberOfProcessCreated( cts, - testhostProcessName); + testhostProcessNames); this.InvokeVsTest(arguments); cts.Cancel(); Assert.AreEqual( expectedNumOfProcessCreated, - numOfProcessCreatedTask.Result, + numOfProcessCreatedTask.Result.Count, $"Number of {testhostProcessName} process created, expected: {expectedNumOfProcessCreated} actual: {numOfProcessCreatedTask.Result.Count} ({ string.Join(", ", numOfProcessCreatedTask.Result) })"); this.ValidateSummaryStatus(2, 2, 2); this.ExitCodeEquals(1); // failing tests From c8246b2b46e96fd246652694b9f2c8a255d9634a Mon Sep 17 00:00:00 2001 From: nohwnd Date: Fri, 21 Feb 2020 19:19:55 +0100 Subject: [PATCH 23/33] Fix debug test tests --- .gitignore | 1 + scripts/build.ps1 | 22 ++++++++++----- scripts/build/TestPlatform.Dependencies.props | 25 ++++++++++++------ scripts/build/TestPlatform.Settings.targets | 3 ++- .../CrashingOnDebugAssertTestProject.csproj | Bin 1676 -> 2484 bytes .../DebugTests.cs | 4 +++ 6 files changed, 39 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 258ec369ec..ded1afeca3 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ msbuild*.err build*.log build*.wrn build*.err +*.binlog # MSTest test Results [Tt]est[Rr]esult*/ diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 0fc7ab7fee..28af83af8e 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -62,15 +62,15 @@ $env:TP_OUT_DIR = Join-Path $env:TP_ROOT_DIR "artifacts" $env:TP_TESTARTIFACTS = Join-Path $env:TP_OUT_DIR "testArtifacts" $env:TP_PACKAGE_PROJ_DIR = Join-Path $env:TP_ROOT_DIR "src\package" -# Set Version from scripts/build/TestPlatform.Settings.targets +# Set Version from scripts/build/TestPlatform.Settings.targets, when we are running locally and not providing the version as the parameter +# or when the build is done directly in VS if([string]::IsNullOrWhiteSpace($Version)) { - $Version = ([xml](Get-Content $env:TP_ROOT_DIR\scripts\build\TestPlatform.Settings.targets)).Project.PropertyGroup.TPVersionPrefix | - Where-Object { $_ } | + $Version = ([xml](Get-Content $env:TP_ROOT_DIR\scripts\build\TestPlatform.Settings.targets)).Project.PropertyGroup[0].TPVersionPrefix | ForEach-Object { $_.Trim() } | Select-Object -First 1 - Write-Verbose "Version was not provided using version '$Version' from TestPlatform.Settings.targets" + Write-Verbose "Version was not provided using version '$Version' from TestPlatform.Settings.targets" } # @@ -102,7 +102,7 @@ $TPB_TargetRuntime = $TargetRuntime $TPB_X64_Runtime = "win7-x64" $TPB_X86_Runtime = "win7-x86" -# Version suffix is empty for RTM releases +# Version suffix is empty for RTM release $TPB_Version = if ($VersionSuffix -ne '') { $Version + "-" + $VersionSuffix } else { $Version } $TPB_CIBuild = $CIBuild $TPB_PublishTests = $PublishTestArtifacts @@ -116,6 +116,14 @@ $Script:ScriptFailed = $false Import-Module "$($CurrentScriptDir.FullName)\verify-nupkgs.ps1" +# Update the version in the dependencies props to be the TPB_version version, this is not ideal but because changing how this is resolved would +# mean that we need to change the whole build process this is a solution with the least amount of impact, that does not require us to keep track of +# the version in multiple places +$dependenciesPath = "$env:TP_ROOT_DIR\scripts\build\TestPlatform.Dependencies.props" +$dependencies = Get-Content -Raw -Encoding UTF8 $dependenciesPath +$updatedDependencies = $dependencies -replace ".*?", "$TPB_Version" +$updatedDependencies | Set-Content -Encoding UTF8 $dependenciesPath + function Write-Log ([string] $message) { $currentColor = $Host.UI.RawUI.ForegroundColor @@ -222,7 +230,7 @@ function Invoke-Build Write-Log ".. .. Build: Source: $TPB_Solution" Write-Verbose "$dotnetExe build $TPB_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild" - & $dotnetExe build $TPB_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild + & $dotnetExe build $TPB_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild -bl:TestPlatform.binlog Write-Log ".. .. Build: Complete." Set-ScriptFailedOnError @@ -239,7 +247,7 @@ function Invoke-TestAssetsBuild Write-Log ".. .. Build: Source: $TPB_TestAssets_Solution" Write-Verbose "$dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version=$TPB_Version -p:CIBuild=$TPB_CIBuild" - & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:Version="$TPB_Version" -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild + & $dotnetExe build $TPB_TestAssets_Solution --configuration $TPB_Configuration -v:minimal -p:CIBuild=$TPB_CIBuild -p:LocalizedBuild=$TPB_LocalizedBuild -bl:"$($env:TP_ROOT_DIR)\TestAssets.binlog" Write-Log ".. .. Build: Complete." Set-ScriptFailedOnError diff --git a/scripts/build/TestPlatform.Dependencies.props b/scripts/build/TestPlatform.Dependencies.props index 3f5064fb6e..d1f54f0820 100644 --- a/scripts/build/TestPlatform.Dependencies.props +++ b/scripts/build/TestPlatform.Dependencies.props @@ -1,17 +1,17 @@ - + 15.8.3247 - - $(Version) - - - 99.99.99-dev + + + 16.6.0-dev 2.1.0 2.1.0 @@ -42,3 +42,12 @@ + + + + + + + + + diff --git a/scripts/build/TestPlatform.Settings.targets b/scripts/build/TestPlatform.Settings.targets index 253dd27ec5..0070d93c7f 100644 --- a/scripts/build/TestPlatform.Settings.targets +++ b/scripts/build/TestPlatform.Settings.targets @@ -3,7 +3,8 @@ $(MSBuildThisFileDirectory)../../ + at the start of new iteration to the goal number. This is also used to version the local packages. This version needs to be statically + readable when we read the file as xml, don't move it to a .props file, unless you change the build server process --> 16.6.0 diff --git a/test/TestAssets/CrashingOnDebugAssertTestProject/CrashingOnDebugAssertTestProject.csproj b/test/TestAssets/CrashingOnDebugAssertTestProject/CrashingOnDebugAssertTestProject.csproj index 6219537fd9ed1cbf10659b0412e76131378b010d..9c87d9e68076b6a85b725d5546d31774adb855a5 100644 GIT binary patch literal 2484 zcmds(PjAye5XIjaiSJ-4q>@7&%7F`Ms**yLLm?`KQ!XZTB9p|8;shw_X9s?>TjSWS zNreQekmdDycV>3pn?LrC?;RcLtLB<1&}YS3DpR6Mr8>}#_7&O(Y7{mVtOV$F z^a$&F%=&n^Kx2tU#(R(XoXh+S(2iMM>4-67?qwG4oCPZ(GG@p7=Phqq3@RQQ@{ns- z8Z+m4f*)posE=BMW(Kz5tsaC(8V}}yG1xAhpCcP6!tRuDg69F&Vl<3xn;GX zU)C!7ZXA?tl(F6?{LTLmMSj%(CX9n-9{gWOuJ5(~E(2C^O_gGGXZ!w(lmAKi?D+}( C0F}=G delta 12 TcmdlY+{3#;k9l(#TO2b08@2 Date: Fri, 21 Feb 2020 22:00:34 +0100 Subject: [PATCH 24/33] plat tests --- scripts/build/TestPlatform.Dependencies.props | 9 ------- .../Navigation/PortableSymbolReader.cs | 11 +++++++- src/testhost.x86/TestHostTraceListener.cs | 25 ++++++++++++++++++- .../DiaSessionTests.cs | 4 +-- 4 files changed, 36 insertions(+), 13 deletions(-) diff --git a/scripts/build/TestPlatform.Dependencies.props b/scripts/build/TestPlatform.Dependencies.props index d1f54f0820..055803abb0 100644 --- a/scripts/build/TestPlatform.Dependencies.props +++ b/scripts/build/TestPlatform.Dependencies.props @@ -42,12 +42,3 @@ - - - - - - - - - diff --git a/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs b/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs index 8f4f11b18c..9a28728b3a 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/Navigation/PortableSymbolReader.cs @@ -94,7 +94,16 @@ private void PopulateCacheForTypeAndMethodSymbols(string binaryPath) // At this point, the assembly should be already loaded into the load context. We query for a reference to // find the types and cache the symbol information. Let the loader follow default lookup order instead of // forcing load from a specific path. - var asm = Assembly.Load(new PlatformAssemblyLoadContext().GetAssemblyNameFromPath(binaryPath)); + Assembly asm; + try + { + asm = Assembly.Load(new PlatformAssemblyLoadContext().GetAssemblyNameFromPath(binaryPath)); + } + catch (FileNotFoundException) + { + // fallback when the assembly is not loaded + asm = Assembly.LoadFile(binaryPath); + } foreach (var type in asm.GetTypes()) { diff --git a/src/testhost.x86/TestHostTraceListener.cs b/src/testhost.x86/TestHostTraceListener.cs index 2bb788a0d9..39d5d2e01f 100644 --- a/src/testhost.x86/TestHostTraceListener.cs +++ b/src/testhost.x86/TestHostTraceListener.cs @@ -17,7 +17,30 @@ public static void Setup() { EqtTrace.Info("Setting up debug trace listener."); EqtTrace.Verbose("TestPlatformTraceListener.Setup: Removing listener {0}.", Trace.Listeners[0]); - Trace.Listeners[0] = new TestHostTraceListener(); + + // in the majority of cases there will be only a single DefaultTraceListener in this collection + // and we will replace that with our listener + if (Trace.Listeners.Count == 1 && Trace.Listeners[0] is DefaultTraceListener) + { + Trace.Listeners[0] = new TestHostTraceListener(); + } + else + { + // if the user will register their own trace + // listener via configuration we won't replace them, only the DefaultTraceListener + var i = 0; + var listeners = new TraceListener[Trace.Listeners.Count]; + Trace.Listeners.CopyTo(listeners, 0); + foreach (var listener in listeners) + { + if (listener.GetType() == typeof(DefaultTraceListener)) + { + Trace.Listeners[i] = new TestHostTraceListener(); + } + i++; + } + } + EqtTrace.Verbose("TestPlatformTraceListener.Setup: Added test platform trace listener."); #if NETCOREAPP2_1 diff --git a/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/DiaSessionTests.cs b/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/DiaSessionTests.cs index ce293c0093..5e3e57fb33 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/DiaSessionTests.cs +++ b/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/DiaSessionTests.cs @@ -14,7 +14,7 @@ namespace Microsoft.TestPlatform.ObjectModel.PlatformTests public class DiaSessionTests : IntegrationTestBase { private const string NET451 = "net451"; - private const string NETCOREAPP10 = "netcoreapp1.0"; + private const string NETCOREAPP21 = "netcoreapp2.1"; public static string GetAndSetTargetFrameWork(IntegrationTestEnvironment testEnvironment) { @@ -22,7 +22,7 @@ public static string GetAndSetTargetFrameWork(IntegrationTestEnvironment testEnv #if NET451 testEnvironment.TargetFramework = NET451; #else - testEnvironment.TargetFramework = NETCOREAPP10; + testEnvironment.TargetFramework = NETCOREAPP21; #endif return currentTargetFrameWork; } From bb585e13505471256246043c771082e872761aad Mon Sep 17 00:00:00 2001 From: nohwnd Date: Mon, 24 Feb 2020 08:43:55 +0100 Subject: [PATCH 25/33] Make Debug assertion internal --- .../DebugAssertException.cs | 2 +- .../CrashingOnDebugAssertTestProject/DebugTests.cs | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Microsoft.TestPlatform.ObjectModel/DebugAssertException.cs b/src/Microsoft.TestPlatform.ObjectModel/DebugAssertException.cs index 1e1138ec94..e882a67d97 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DebugAssertException.cs +++ b/src/Microsoft.TestPlatform.ObjectModel/DebugAssertException.cs @@ -5,7 +5,7 @@ namespace Microsoft.VisualStudio.TestPlatform.ObjectModel { using System; - public sealed class DebugAssertException : Exception + internal sealed class DebugAssertException : Exception { public DebugAssertException(string message, string stackTrace) : base(message) { diff --git a/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs b/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs index 8d1de3d844..b313a04314 100644 --- a/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs +++ b/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs @@ -34,12 +34,5 @@ public void TraceFail() { Trace.Fail("fail"); } - - [TestMethod] - [ExpectedException(typeof(DebugAssertException))] - public void CatchingExceptionFromDebugAssert() - { - Debug.Assert(false); - } } } From 288da7d44b99abefc20cb6e5d6b7e332079afd7f Mon Sep 17 00:00:00 2001 From: nohwnd Date: Mon, 24 Feb 2020 08:59:09 +0100 Subject: [PATCH 26/33] Fix feedback --- .../DebugAssertTests.cs | 4 ++-- ....TestPlatform.ObjectModel.PlatformTests.csproj | 4 +--- .../ConsoleNativeApp/Debug/ConsoleNativeApp.log | 1 - .../ConsoleNativeApp.vcxproj.FileListAbsolute.txt | 0 test/TestAssets/NuGet.config | 2 +- test/coverlet.collector/coverlet.collector.csproj | 4 ++++ test/coverlet.collector/key.snk | Bin 596 -> 0 bytes 7 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.log delete mode 100644 test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.vcxproj.FileListAbsolute.txt delete mode 100644 test/coverlet.collector/key.snk diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs index 2b8a2e9ed9..d4deda99df 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs @@ -24,8 +24,8 @@ public void RunningTestWithAFailingDebugAssertDoesNotCrashTheHostingProcess(Runn // this will have failed tests when our trace listener works and crash the testhost process when it does not // because crashing processes is what a failed Debug.Assert does by default, unless you have a debugger attached - this.ValidateSummaryStatus(passedTestsCount: 1, failedTestsCount: 4, 0); + this.ValidateSummaryStatus(0, failedTestsCount: 4, 0); StringAssert.Contains(this.StdOut, "Test method CrashingOnDebugAssertTestProject.DebugTests.DebugAssert threw exception: Microsoft.VisualStudio.TestPlatform.ObjectModel.DebugAssertException: Method Debug.Assert failed"); } } -} +} \ No newline at end of file diff --git a/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/Microsoft.TestPlatform.ObjectModel.PlatformTests.csproj b/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/Microsoft.TestPlatform.ObjectModel.PlatformTests.csproj index 50d21d2737..f0b70feee4 100644 --- a/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/Microsoft.TestPlatform.ObjectModel.PlatformTests.csproj +++ b/test/Microsoft.TestPlatform.ObjectModel.PlatformTests/Microsoft.TestPlatform.ObjectModel.PlatformTests.csproj @@ -10,9 +10,7 @@ Microsoft.TestPlatform.ObjectModel.PlatformTests - - - + diff --git a/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.log b/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.log deleted file mode 100644 index 3dbfe80b92..0000000000 --- a/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.log +++ /dev/null @@ -1 +0,0 @@ -C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.16299.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". diff --git a/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.vcxproj.FileListAbsolute.txt b/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/ConsoleNativeApp.vcxproj.FileListAbsolute.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/TestAssets/NuGet.config b/test/TestAssets/NuGet.config index 8cd696ed80..978fb1eaac 100644 --- a/test/TestAssets/NuGet.config +++ b/test/TestAssets/NuGet.config @@ -4,7 +4,7 @@ - + diff --git a/test/coverlet.collector/coverlet.collector.csproj b/test/coverlet.collector/coverlet.collector.csproj index a881df2bb4..6ab15f7846 100644 --- a/test/coverlet.collector/coverlet.collector.csproj +++ b/test/coverlet.collector/coverlet.collector.csproj @@ -5,6 +5,10 @@ false + + + + diff --git a/test/coverlet.collector/key.snk b/test/coverlet.collector/key.snk deleted file mode 100644 index 16bbaafe56640fff2bb1ea859376bf05fc4e16a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 From d56c4eeb048d0ee71d9f010b7d55f044da09b735 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Mon, 24 Feb 2020 11:31:37 +0100 Subject: [PATCH 27/33] only override fail --- scripts/build/TestPlatform.Dependencies.props | 2 + .../DebugAssertException.cs | 2 +- src/testhost.x86/TestHostTraceListener.cs | 8 +- src/testhost/testhost.csproj | 1 + .../DebugAssertTests.cs | 2 +- .../DebugTests.cs | 32 +++++++- .../coverlet.collector.csproj | 4 - test/coverlet.collector/key.snk | Bin 0 -> 596 bytes .../TestHostTraceListenerTests.cs | 77 ++++++++++++++++++ 9 files changed, 114 insertions(+), 14 deletions(-) rename src/{Microsoft.TestPlatform.ObjectModel => testhost.x86}/DebugAssertException.cs (88%) create mode 100644 test/coverlet.collector/key.snk create mode 100644 test/testhost.UnitTests/TestHostTraceListenerTests.cs diff --git a/scripts/build/TestPlatform.Dependencies.props b/scripts/build/TestPlatform.Dependencies.props index 055803abb0..37ba14a8f6 100644 --- a/scripts/build/TestPlatform.Dependencies.props +++ b/scripts/build/TestPlatform.Dependencies.props @@ -42,3 +42,5 @@ + + diff --git a/src/Microsoft.TestPlatform.ObjectModel/DebugAssertException.cs b/src/testhost.x86/DebugAssertException.cs similarity index 88% rename from src/Microsoft.TestPlatform.ObjectModel/DebugAssertException.cs rename to src/testhost.x86/DebugAssertException.cs index e882a67d97..1255f5898e 100644 --- a/src/Microsoft.TestPlatform.ObjectModel/DebugAssertException.cs +++ b/src/testhost.x86/DebugAssertException.cs @@ -1,7 +1,7 @@ // 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.ObjectModel +namespace Microsoft.VisualStudio.TestPlatform.TestHost { using System; diff --git a/src/testhost.x86/TestHostTraceListener.cs b/src/testhost.x86/TestHostTraceListener.cs index 39d5d2e01f..206d96a37c 100644 --- a/src/testhost.x86/TestHostTraceListener.cs +++ b/src/testhost.x86/TestHostTraceListener.cs @@ -11,7 +11,7 @@ namespace Microsoft.VisualStudio.TestPlatform.TestHost using System.Linq; using System.Reflection; - internal class TestHostTraceListener : TraceListener + internal class TestHostTraceListener : DefaultTraceListener { public static void Setup() { @@ -60,14 +60,14 @@ public static void Setup() #endif } - public override void Write(string message) + public override void Fail(string message) { throw GetException(message); } - public override void WriteLine(string message) + public override void Fail(string message, string detailMessage) { - throw GetException(message); + throw GetException((message + Environment.NewLine + detailMessage)); } public static void ShowDialog(string stackTrace, string message, string detailMessage, string _) diff --git a/src/testhost/testhost.csproj b/src/testhost/testhost.csproj index cd9c055e0c..66928e9c0f 100644 --- a/src/testhost/testhost.csproj +++ b/src/testhost/testhost.csproj @@ -16,6 +16,7 @@ false + diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs index d4deda99df..de65b896c6 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs @@ -24,7 +24,7 @@ public void RunningTestWithAFailingDebugAssertDoesNotCrashTheHostingProcess(Runn // this will have failed tests when our trace listener works and crash the testhost process when it does not // because crashing processes is what a failed Debug.Assert does by default, unless you have a debugger attached - this.ValidateSummaryStatus(0, failedTestsCount: 4, 0); + this.ValidateSummaryStatus(passedTestsCount: 4, failedTestsCount: 4, 0); StringAssert.Contains(this.StdOut, "Test method CrashingOnDebugAssertTestProject.DebugTests.DebugAssert threw exception: Microsoft.VisualStudio.TestPlatform.ObjectModel.DebugAssertException: Method Debug.Assert failed"); } } diff --git a/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs b/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs index b313a04314..52d252f1aa 100644 --- a/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs +++ b/test/TestAssets/CrashingOnDebugAssertTestProject/DebugTests.cs @@ -12,27 +12,51 @@ namespace CrashingOnDebugAssertTestProject public class DebugTests { [TestMethod] - public void DebugAssert() + public void DebugAssertFailsTheTest() { Debug.Assert(false); } [TestMethod] - public void DebugFail() + public void DebugFailFailsTheTest() { Debug.Fail("fail"); } [TestMethod] - public void TraceAssert() + public void TraceAssertFailsTheTest() { Trace.Assert(false); } [TestMethod] - public void TraceFail() + public void TraceFailFailsThetest() { Trace.Fail("fail"); } + + [TestMethod] + public void TraceWriteDoesNotFailTheTest() + { + Trace.Write("hello"); + } + + [TestMethod] + public void TraceWriteLineDoesNotFailTheTest() + { + Trace.WriteLine("hello"); + } + + [TestMethod] + public void DebugWriteDoesNotFailTheTest() + { + Debug.Write("hello"); + } + + [TestMethod] + public void DebugWriteLineDoesNotFailTheTest() + { + Debug.WriteLine("hello"); + } } } diff --git a/test/coverlet.collector/coverlet.collector.csproj b/test/coverlet.collector/coverlet.collector.csproj index 6ab15f7846..a881df2bb4 100644 --- a/test/coverlet.collector/coverlet.collector.csproj +++ b/test/coverlet.collector/coverlet.collector.csproj @@ -5,10 +5,6 @@ false - - - - diff --git a/test/coverlet.collector/key.snk b/test/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 diff --git a/test/testhost.UnitTests/TestHostTraceListenerTests.cs b/test/testhost.UnitTests/TestHostTraceListenerTests.cs new file mode 100644 index 0000000000..c5f004088e --- /dev/null +++ b/test/testhost.UnitTests/TestHostTraceListenerTests.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + + +namespace testhost.UnitTests +{ +#if NETCOREAPP + using Microsoft.VisualStudio.TestPlatform.TestHost; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using System.Diagnostics; + + [TestClass] + public class TestHostTraceListenerTests + { + public void SetupTraceListener() + { + // using this instead of class initialize to avoid crashing the whole process + // in case we break the class init behavior, which would make debugging tests + // that touch ClassInitialize difficult + Trace.Listeners.Clear(); + Trace.Listeners.Add(new TestHostTraceListener()); + } + + [TestMethod] + [ExpectedException(typeof(DebugAssertException))] + public void DebugAssertThrowsDebugAssertException() + { + Debug.Assert(false); + } + + [TestMethod] + [ExpectedException(typeof(DebugAssertException))] + public void DebugFailThrowsDebugAssertException() + { + Debug.Fail("fail"); + } + + [TestMethod] + [ExpectedException(typeof(DebugAssertException))] + public void TraceAssertThrowsDebugAssertException() + { + Trace.Assert(false); + } + + [TestMethod] + [ExpectedException(typeof(DebugAssertException))] + public void TraceFailThrowsDebugAssertException() + { + Trace.Fail("fail"); + } + + [TestMethod] + public void TraceWriteDoesNotFailTheTest() + { + Trace.Write("hello"); + } + + [TestMethod] + public void TraceWriteLineDoesNotFailTheTest() + { + Trace.WriteLine("hello"); + } + + [TestMethod] + public void DebugWriteDoesNotFailTheTest() + { + Debug.Write("hello"); + } + + [TestMethod] + public void DebugWriteLineDoesNotFailTheTest() + { + Debug.WriteLine("hello"); + } + } +#endif +} From a8b90d492de4aab49b92bc008cf1a4d572779d2b Mon Sep 17 00:00:00 2001 From: nohwnd Date: Mon, 24 Feb 2020 11:37:12 +0100 Subject: [PATCH 28/33] Add few unit tests --- test/testhost.UnitTests/TestHostTraceListenerTests.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/testhost.UnitTests/TestHostTraceListenerTests.cs b/test/testhost.UnitTests/TestHostTraceListenerTests.cs index c5f004088e..97bf87e1c5 100644 --- a/test/testhost.UnitTests/TestHostTraceListenerTests.cs +++ b/test/testhost.UnitTests/TestHostTraceListenerTests.cs @@ -12,12 +12,11 @@ namespace testhost.UnitTests [TestClass] public class TestHostTraceListenerTests { - public void SetupTraceListener() + public TestHostTraceListenerTests() { // using this instead of class initialize to avoid crashing the whole process - // in case we break the class init behavior, which would make debugging tests - // that touch ClassInitialize difficult - Trace.Listeners.Clear(); + // in case we break the class init behavior due to some other changes + Trace.Listeners.Clear(); Trace.Listeners.Add(new TestHostTraceListener()); } From 52cb5fea3646064e6b7fca82c314113f15a20a08 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Mon, 24 Feb 2020 12:03:06 +0100 Subject: [PATCH 29/33] Add unit tests for trace listener --- src/testhost.x86/TestHostTraceListener.cs | 28 ++---- .../TestHostTraceListenerTests.cs | 88 ++++++++++++++++++- 2 files changed, 93 insertions(+), 23 deletions(-) diff --git a/src/testhost.x86/TestHostTraceListener.cs b/src/testhost.x86/TestHostTraceListener.cs index 206d96a37c..bc5f149d61 100644 --- a/src/testhost.x86/TestHostTraceListener.cs +++ b/src/testhost.x86/TestHostTraceListener.cs @@ -16,31 +16,19 @@ internal class TestHostTraceListener : DefaultTraceListener public static void Setup() { EqtTrace.Info("Setting up debug trace listener."); - EqtTrace.Verbose("TestPlatformTraceListener.Setup: Removing listener {0}.", Trace.Listeners[0]); - // in the majority of cases there will be only a single DefaultTraceListener in this collection - // and we will replace that with our listener - if (Trace.Listeners.Count == 1 && Trace.Listeners[0] is DefaultTraceListener) - { - Trace.Listeners[0] = new TestHostTraceListener(); - } - else + // and we will replace that with our listener, in case there are listeners of different types we keep + // them as is + for (var i = 0; i < Trace.Listeners.Count; i++) { - // if the user will register their own trace - // listener via configuration we won't replace them, only the DefaultTraceListener - var i = 0; - var listeners = new TraceListener[Trace.Listeners.Count]; - Trace.Listeners.CopyTo(listeners, 0); - foreach (var listener in listeners) + var listener = Trace.Listeners[i]; + if (listener is DefaultTraceListener) { - if (listener.GetType() == typeof(DefaultTraceListener)) - { - Trace.Listeners[i] = new TestHostTraceListener(); - } - i++; + EqtTrace.Verbose("TestPlatformTraceListener.Setup: Removing listener {0}.", Trace.Listeners[i]); + Trace.Listeners[i] = new TestHostTraceListener(); } } - + EqtTrace.Verbose("TestPlatformTraceListener.Setup: Added test platform trace listener."); #if NETCOREAPP2_1 diff --git a/test/testhost.UnitTests/TestHostTraceListenerTests.cs b/test/testhost.UnitTests/TestHostTraceListenerTests.cs index 97bf87e1c5..1e31e5ebde 100644 --- a/test/testhost.UnitTests/TestHostTraceListenerTests.cs +++ b/test/testhost.UnitTests/TestHostTraceListenerTests.cs @@ -7,19 +7,37 @@ namespace testhost.UnitTests #if NETCOREAPP using Microsoft.VisualStudio.TestPlatform.TestHost; using Microsoft.VisualStudio.TestTools.UnitTesting; + using System.Collections.Generic; using System.Diagnostics; + using System.Linq; [TestClass] public class TestHostTraceListenerTests { - public TestHostTraceListenerTests() + TraceListener[] listeners; + + [TestInitialize()] + public void Initialize() { - // using this instead of class initialize to avoid crashing the whole process - // in case we break the class init behavior due to some other changes + this.listeners = new TraceListener[Trace.Listeners.Count]; + Trace.Listeners.CopyTo(this.listeners, 0); + // not using the TestHostTraceListener.Setup method here + // because that detects only default trace listeners and there won't + // be any when this is in production, so this would end up testing against + // an older version of the trace listener Trace.Listeners.Clear(); Trace.Listeners.Add(new TestHostTraceListener()); } + [TestCleanup()] + public void Cleanup() { + Trace.Listeners.Clear(); + foreach(var listener in this.listeners) + { + Trace.Listeners.Add(listener); + } + } + [TestMethod] [ExpectedException(typeof(DebugAssertException))] public void DebugAssertThrowsDebugAssertException() @@ -72,5 +90,69 @@ public void DebugWriteLineDoesNotFailTheTest() Debug.WriteLine("hello"); } } + + [TestClass] + public class TestHostTraceListenerRegistrationTests + { + TraceListener[] listeners; + + [TestInitialize()] + public void Initialize() + { + this.listeners = new TraceListener[Trace.Listeners.Count]; + Trace.Listeners.CopyTo(this.listeners, 0); + } + + [TestCleanup()] + public void Cleanup() + { + Trace.Listeners.Clear(); + foreach (var listener in this.listeners) + { + Trace.Listeners.Add(listener); + } + } + + [TestMethod] + public void SetupReplacesDefaultTraceListener() + { + Trace.Listeners.Clear(); + Trace.Listeners.Add(new DefaultTraceListener()); + TestHostTraceListener.Setup(); + + // this is what will happen in the majority of cases, there will be a single + // trace listener that will be the default trace listener and we will replace it + // with ours + Assert.IsInstanceOfType(Trace.Listeners[0], typeof(TestHostTraceListener)); + } + + [TestMethod] + public void SetupKeepsNonDefaultTraceListeners() + { + Trace.Listeners.Clear(); + Trace.Listeners.Add(new DummyTraceListener()); + Trace.Listeners.Add(new DefaultTraceListener()); + Trace.Listeners.Add(new DummyTraceListener()); + TestHostTraceListener.Setup(); + + Assert.IsInstanceOfType(Trace.Listeners[0], typeof(DummyTraceListener)); + Assert.IsInstanceOfType(Trace.Listeners[1], typeof(TestHostTraceListener)); + Assert.IsInstanceOfType(Trace.Listeners[2], typeof(DummyTraceListener)); + } + + private class DummyTraceListener : TraceListener + { + public List Lines { get; } = new List(); + public override void Write(string message) + { + Lines.Add(message); + } + + public override void WriteLine(string message) + { + Lines.Add(message); + } + } + } #endif } From 6f88c2b5d6086c3db7f48494d84149420452047c Mon Sep 17 00:00:00 2001 From: nohwnd Date: Mon, 24 Feb 2020 12:14:52 +0100 Subject: [PATCH 30/33] Clean up --- scripts/build/TestPlatform.Dependencies.props | 2 -- .../SocketCommunicationManager.cs | 17 ++--------------- src/testhost.x86/TestHostTraceListener.cs | 2 +- ...estAsset.ConsoleNativeApp.Build.CppClean.log | 0 .../coverlet.collector.csproj | 4 ---- 5 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/Microsoft.TestPlatform.TestAsset.ConsoleNativeApp.Build.CppClean.log diff --git a/scripts/build/TestPlatform.Dependencies.props b/scripts/build/TestPlatform.Dependencies.props index 37ba14a8f6..055803abb0 100644 --- a/scripts/build/TestPlatform.Dependencies.props +++ b/scripts/build/TestPlatform.Dependencies.props @@ -42,5 +42,3 @@ - - diff --git a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs index a8c42cb04a..411dcaf88b 100644 --- a/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs +++ b/src/Microsoft.TestPlatform.CommunicationUtilities/SocketCommunicationManager.cs @@ -8,7 +8,6 @@ namespace Microsoft.VisualStudio.TestPlatform.CommunicationUtilities using System.IO; using System.Net; using System.Net.Sockets; - using System.Reflection; using System.Threading; using System.Threading.Tasks; using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces; @@ -178,7 +177,7 @@ public async Task SetupClientAsync(IPEndPoint endpoint) { try { - EqtTrace.Verbose("SocketCommunicationManager : SetupClientAsync : Attempting to connect to the server {0}:{1}.", endpoint.Address, endpoint.Port); + EqtTrace.Verbose("SocketCommunicationManager : SetupClientAsync : Attempting to connect to the server."); await this.tcpClient.ConnectAsync(endpoint.Address, endpoint.Port); if (this.tcpClient.Connected) @@ -200,19 +199,7 @@ public async Task SetupClientAsync(IPEndPoint endpoint) } catch (Exception ex) { - // a simple backoff policy, otherwise this loop produces and incredible - // amount of error logs when it cannot connect - var delay = watch.ElapsedMilliseconds < 100 - ? 1 - : watch.ElapsedMilliseconds < 1000 - ? 10 - : 100; - - if ((watch.ElapsedMilliseconds + delay) < connectionTimeout) - { - await Task.Delay(delay); - EqtTrace.Error($"Connection Failed with error {0}, retrying in {delay} ms", ex.ToString()); - } + EqtTrace.Error("Connection Failed with error {0}, retrying", ex.ToString()); } } while ((this.tcpClient != null) && !this.tcpClient.Connected && watch.ElapsedMilliseconds < connectionTimeout); diff --git a/src/testhost.x86/TestHostTraceListener.cs b/src/testhost.x86/TestHostTraceListener.cs index bc5f149d61..0c3fab7790 100644 --- a/src/testhost.x86/TestHostTraceListener.cs +++ b/src/testhost.x86/TestHostTraceListener.cs @@ -24,7 +24,7 @@ public static void Setup() var listener = Trace.Listeners[i]; if (listener is DefaultTraceListener) { - EqtTrace.Verbose("TestPlatformTraceListener.Setup: Removing listener {0}.", Trace.Listeners[i]); + EqtTrace.Verbose($"TestPlatformTraceListener.Setup: Replacing listener {0} with { nameof(TestHostTraceListener) }.", Trace.Listeners[i]); Trace.Listeners[i] = new TestHostTraceListener(); } } diff --git a/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/Microsoft.TestPlatform.TestAsset.ConsoleNativeApp.Build.CppClean.log b/test/TestAssets/CPPSimpleTestProject/ConsoleNativeApp/Debug/Microsoft.TestPlatform.TestAsset.ConsoleNativeApp.Build.CppClean.log deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/coverlet.collector/coverlet.collector.csproj b/test/coverlet.collector/coverlet.collector.csproj index 6ab15f7846..a881df2bb4 100644 --- a/test/coverlet.collector/coverlet.collector.csproj +++ b/test/coverlet.collector/coverlet.collector.csproj @@ -5,10 +5,6 @@ false - - - - From c9c316070ba81988a68c4499acc12a5b204f3699 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Mon, 24 Feb 2020 12:36:07 +0100 Subject: [PATCH 31/33] Define DEBUG in Release --- test/testhost.UnitTests/TestHostTraceListenerTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/testhost.UnitTests/TestHostTraceListenerTests.cs b/test/testhost.UnitTests/TestHostTraceListenerTests.cs index 1e31e5ebde..41680ef59c 100644 --- a/test/testhost.UnitTests/TestHostTraceListenerTests.cs +++ b/test/testhost.UnitTests/TestHostTraceListenerTests.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +// define trace and debug to trigger the Debug.Assert calls even when we build in Release +#define DEBUG namespace testhost.UnitTests { @@ -9,7 +11,6 @@ namespace testhost.UnitTests using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Collections.Generic; using System.Diagnostics; - using System.Linq; [TestClass] public class TestHostTraceListenerTests From 4795f91b74b9ba65cef0b939073cb196d1a7a0f8 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Mon, 24 Feb 2020 13:36:55 +0100 Subject: [PATCH 32/33] fix assert tests --- scripts/build/TestPlatform.Dependencies.props | 1 + test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/build/TestPlatform.Dependencies.props b/scripts/build/TestPlatform.Dependencies.props index 055803abb0..a4296403ae 100644 --- a/scripts/build/TestPlatform.Dependencies.props +++ b/scripts/build/TestPlatform.Dependencies.props @@ -42,3 +42,4 @@ + diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs index de65b896c6..52c62ee0c2 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs @@ -25,7 +25,7 @@ public void RunningTestWithAFailingDebugAssertDoesNotCrashTheHostingProcess(Runn // this will have failed tests when our trace listener works and crash the testhost process when it does not // because crashing processes is what a failed Debug.Assert does by default, unless you have a debugger attached this.ValidateSummaryStatus(passedTestsCount: 4, failedTestsCount: 4, 0); - StringAssert.Contains(this.StdOut, "Test method CrashingOnDebugAssertTestProject.DebugTests.DebugAssert threw exception: Microsoft.VisualStudio.TestPlatform.ObjectModel.DebugAssertException: Method Debug.Assert failed"); + StringAssert.Contains(this.StdOut, "Test method CrashingOnDebugAssertTestProject.DebugTests.DebugAssert threw exception: Microsoft.VisualStudio.TestPlatform.TestHost.DebugAssertException: Method Debug.Assert failed"); } } } \ No newline at end of file From 872717ae8673c345a7700c89eb7742d3b02fa184 Mon Sep 17 00:00:00 2001 From: nohwnd Date: Mon, 24 Feb 2020 14:14:51 +0100 Subject: [PATCH 33/33] Fix debugassert --- test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs index 52c62ee0c2..d2e5156bc1 100644 --- a/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs +++ b/test/Microsoft.TestPlatform.AcceptanceTests/DebugAssertTests.cs @@ -25,7 +25,7 @@ public void RunningTestWithAFailingDebugAssertDoesNotCrashTheHostingProcess(Runn // this will have failed tests when our trace listener works and crash the testhost process when it does not // because crashing processes is what a failed Debug.Assert does by default, unless you have a debugger attached this.ValidateSummaryStatus(passedTestsCount: 4, failedTestsCount: 4, 0); - StringAssert.Contains(this.StdOut, "Test method CrashingOnDebugAssertTestProject.DebugTests.DebugAssert threw exception: Microsoft.VisualStudio.TestPlatform.TestHost.DebugAssertException: Method Debug.Assert failed"); + StringAssert.Contains(this.StdOut, "threw exception: Microsoft.VisualStudio.TestPlatform.TestHost.DebugAssertException: Method Debug.Assert failed"); } } } \ No newline at end of file