From 6300d4244cdc09afc833056cd3b822229e5f0847 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 27 Nov 2018 10:53:27 -0800 Subject: [PATCH 01/82] added functests project, added tests to open WinformsControlsTest tabs --- System.Windows.Forms.sln | 71 ++++++ .../ExternalTestHelpers.cs | 23 ++ .../System.Windows.Forms.FuncTests.csproj | 19 ++ .../TestHelpers.cs | 171 +++++++++++++ .../WinformsControlsTest.cs | 237 ++++++++++++++++++ 5 files changed, 521 insertions(+) create mode 100644 System.Windows.Forms.sln create mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/ExternalTestHelpers.cs create mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.FuncTests.csproj create mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs create mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs diff --git a/System.Windows.Forms.sln b/System.Windows.Forms.sln new file mode 100644 index 00000000000..97b164e3d67 --- /dev/null +++ b/System.Windows.Forms.sln @@ -0,0 +1,71 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.28307.4001 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms", "src\System.Windows.Forms\src\System.Windows.Forms.csproj", "{0D23A41B-2626-4703-9E4A-87C07F69B0B2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Ref", "src\System.Windows.Forms\ref\System.Windows.Forms.Ref.csproj", "{334C343B-9D39-498E-89D8-B6526028FD5C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Tests", "src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj", "{AB38E262-F206-4820-8F29-23C5F72A4A16}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinformsControlsTest", "src\System.Windows.Forms\tests\functests\WinformsControlsTest\WinformsControlsTest.csproj", "{657472B8-FDA3-49DF-B8BE-0246046A4348}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Private.Winforms", "pkg\Microsoft.Private.Winforms.csproj", "{F133342A-3040-4005-A2F0-7685AA7CB82D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pkg", "pkg", "{C611474D-0DFF-4E30-A22A-4A0C0776AB0D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{02770A27-2DAC-4D90-BD56-2C3749E92917}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{6F8B68FA-FC93-4EB2-973E-89CBF96A1676}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{A306DE68-8EF5-403F-93E3-AC309655B5D2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.FuncTests", "src\System.Windows.Forms\tests\FuncTests\System.Windows.Forms.FuncTests\System.Windows.Forms.FuncTests.csproj", "{0EC2E473-02FF-471B-BF52-DEB375F64D23}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0D23A41B-2626-4703-9E4A-87C07F69B0B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0D23A41B-2626-4703-9E4A-87C07F69B0B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0D23A41B-2626-4703-9E4A-87C07F69B0B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0D23A41B-2626-4703-9E4A-87C07F69B0B2}.Release|Any CPU.Build.0 = Release|Any CPU + {334C343B-9D39-498E-89D8-B6526028FD5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {334C343B-9D39-498E-89D8-B6526028FD5C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {334C343B-9D39-498E-89D8-B6526028FD5C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {334C343B-9D39-498E-89D8-B6526028FD5C}.Release|Any CPU.Build.0 = Release|Any CPU + {AB38E262-F206-4820-8F29-23C5F72A4A16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AB38E262-F206-4820-8F29-23C5F72A4A16}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AB38E262-F206-4820-8F29-23C5F72A4A16}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AB38E262-F206-4820-8F29-23C5F72A4A16}.Release|Any CPU.Build.0 = Release|Any CPU + {657472B8-FDA3-49DF-B8BE-0246046A4348}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {657472B8-FDA3-49DF-B8BE-0246046A4348}.Debug|Any CPU.Build.0 = Debug|Any CPU + {657472B8-FDA3-49DF-B8BE-0246046A4348}.Release|Any CPU.ActiveCfg = Release|Any CPU + {657472B8-FDA3-49DF-B8BE-0246046A4348}.Release|Any CPU.Build.0 = Release|Any CPU + {F133342A-3040-4005-A2F0-7685AA7CB82D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F133342A-3040-4005-A2F0-7685AA7CB82D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F133342A-3040-4005-A2F0-7685AA7CB82D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F133342A-3040-4005-A2F0-7685AA7CB82D}.Release|Any CPU.Build.0 = Release|Any CPU + {0EC2E473-02FF-471B-BF52-DEB375F64D23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EC2E473-02FF-471B-BF52-DEB375F64D23}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EC2E473-02FF-471B-BF52-DEB375F64D23}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EC2E473-02FF-471B-BF52-DEB375F64D23}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {0D23A41B-2626-4703-9E4A-87C07F69B0B2} = {02770A27-2DAC-4D90-BD56-2C3749E92917} + {334C343B-9D39-498E-89D8-B6526028FD5C} = {6F8B68FA-FC93-4EB2-973E-89CBF96A1676} + {AB38E262-F206-4820-8F29-23C5F72A4A16} = {A306DE68-8EF5-403F-93E3-AC309655B5D2} + {657472B8-FDA3-49DF-B8BE-0246046A4348} = {A306DE68-8EF5-403F-93E3-AC309655B5D2} + {F133342A-3040-4005-A2F0-7685AA7CB82D} = {C611474D-0DFF-4E30-A22A-4A0C0776AB0D} + {0EC2E473-02FF-471B-BF52-DEB375F64D23} = {A306DE68-8EF5-403F-93E3-AC309655B5D2} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7B1B0433-F612-4E5A-BE7E-FCF5B9F6E136} + EndGlobalSection +EndGlobal diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/ExternalTestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/ExternalTestHelpers.cs new file mode 100644 index 00000000000..d729937f581 --- /dev/null +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/ExternalTestHelpers.cs @@ -0,0 +1,23 @@ +using System.Runtime.InteropServices; + +namespace System.Windows.Forms.FuncTests +{ + public class ExternalTestHelpers + { + [DllImport("User32.dll")] + static extern int SetForegroundWindow(IntPtr point); + + [DllImport("User32.dll")] + static extern IntPtr GetForegroundWindow(); + + public static int TrySetForegroundWindow(IntPtr point) + { + return SetForegroundWindow(point); + } + + public static IntPtr TryGetForegroundWindow() + { + return GetForegroundWindow(); + } + } +} diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.FuncTests.csproj b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.FuncTests.csproj new file mode 100644 index 00000000000..abd546829d9 --- /dev/null +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.FuncTests.csproj @@ -0,0 +1,19 @@ + + + + netcoreapp3.0 + + false + + + + + + + + + + + + + diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs new file mode 100644 index 00000000000..51778d25f2d --- /dev/null +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs @@ -0,0 +1,171 @@ +using System.Diagnostics; +using System.Threading; + +namespace System.Windows.Forms.FuncTests +{ + public class TestHelpers + { + /// + /// Calls StartProcess for the ProcessStartInfo containing the bin path of this directory plsu the given byPathFromBin + /// + /// The string path to add onto the end of the bin path; trimed for tailing \'s + /// + /// + /// + /// Throws ArgumentException if string byPathFromBin is null + /// The new Process + public static Process StartProcess(string byPathFromBin) + { + if(null == byPathFromBin) + { + throw new ArgumentException(nameof(byPathFromBin) + " must not be null."); + } + + ProcessStartInfo startInfo = new ProcessStartInfo(); + startInfo.FileName = BinPath() + byPathFromBin.Trim('\\'); + // ... + + return StartProcess(startInfo); + } + + /// + /// Calls Process.Start() on the given ProcessStartInfo; waits 500 ms + /// + /// The info with which to start the process + /// + /// + /// Throws ArgumentException if ProcessStartInfo info is null + /// The new Process + public static Process StartProcess(ProcessStartInfo info) + { + Process process = new Process(); + + process.StartInfo = info ?? throw new ArgumentException(nameof(info) + " must not be null."); + process.Start(); + + Thread.Sleep(500); + + return process; + } + + /// + /// Returns the bin directory of this project on a given machine + /// + /// + /// + /// Returns the entire path of this project if the bin is not part of it + /// The bin path as a string; example: example:\Project\bin\ + public static string BinPath() + { + var path = AppDomain.CurrentDomain.BaseDirectory; + var pathParts = path.Split('\\'); + string ret = ""; + uint i = 0; + while (i < pathParts.Length) + { + ret += pathParts[i] + IO.Path.DirectorySeparatorChar; + if (pathParts[i].ToLower().Equals("bin".ToLower())) + { + break; + } + i++; + } + return ret; + } + + /// + /// Presses Enter on the given process if it can be made the foreground process + /// + /// The process to send the Enter key to + /// Whether or not the Enter key was pressed on the process + /// + public static bool PressEnterOnProcess(Process process) + { + return PressOnProcess(process, "~"); + } + + /// + /// Presses Tab on the given process if it can be made the foreground process + /// + /// The process to send the Tab key to + /// Whether or not the Tab key was pressed on the process + /// + public static bool PressTabOnProcess(Process process) + { + return PressOnProcess(process, "{TAB}"); + } + + /// + /// Presses Tab any number of times on the given process if it can be made the foreground process + /// + /// The process to send the Tab key(s) to + /// The number of times to press tab in a row + /// Throws an ArgumentException if number of times is zero; this is unlikely to be intended. + /// Whether or not the Tab key(s) were pressed on the process + /// + public static bool PressTabsOnProcess(Process process, uint times) + { + if (times == 0) + { + throw new ArgumentException(nameof(times) + " may not be zero."); + } + + string keys = ""; + for (uint i = 0; i < times; i++) + { + keys += "{TAB}"; + } + return PressOnProcess(process, keys); + } + + /// + /// Presses the given keys on the given process, then waits 200ms + /// + /// The process to send the key(s) to + /// The key(s) to send to the process + /// Throws an ArgumentException if the process is null or has exited. + /// Throws an ArgumentException if the given key(s) is null or the empty string. + /// Whether or not the key(s) were pressed on the process + /// + /// + /// + /// + /// + internal static bool PressOnProcess(Process process, string keys) + { + if (null == process) + { + throw new ArgumentException(nameof(process) + " must not be null."); + } + + if (process.HasExited) + { + throw new ArgumentException(nameof(process) + " must not have exited."); + } + + if (string.IsNullOrEmpty(keys)) + { + throw new ArgumentException(nameof(keys) + " must not be null or empty."); + } + + var handle = process.MainWindowHandle; + ExternalTestHelpers.TrySetForegroundWindow(handle); + + if (handle.Equals(ExternalTestHelpers.TryGetForegroundWindow())) + { + SendKeys.SendWait(keys); + + Thread.Sleep(200); + + return true; + } + else + { + Debug.Assert(true, "Given process could not be made to be the ForegroundWindow"); + + return false; + } + } + + } +} diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs new file mode 100644 index 00000000000..e42e858d959 --- /dev/null +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs @@ -0,0 +1,237 @@ +using System; +using System.Diagnostics; +using Xunit; + +namespace System.Windows.Forms.FuncTests +{ + public class WinformsControlsTestTests + { + + public const string PathToTestFromBin = "WinformsControlsTest\\Debug\\netcoreapp3.0\\WinformsControlsTest.exe"; + + [Fact] + public void WinformsControlsTest_OpenAndClose() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + + Assert.NotNull(process); + Assert.NotNull(Process.GetProcessById(process.Id)); + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_ButtonsTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_CalendarTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 1); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_TreeViewAndImageListTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 2); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_ContentAlignmentTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 3); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_MultipleControlsTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 4); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_DataGridViewTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 5); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_MenusTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 6); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_PanelsTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 7); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_SplitterTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 8); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_ComboBoxesTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 9); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_MDIParentTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 10); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_PropertyGridTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 11); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_ListViewTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 12); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_DateTimePickerTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 13); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + } +} From 80679a99b68f336eb9c155bf9b7139f368d01704 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 27 Nov 2018 14:10:16 -0800 Subject: [PATCH 02/82] sdk magic .tests --- System.Windows.Forms.sln | 4 ++-- ...ncTests.csproj => System.Windows.Forms.Func.Tests.csproj} | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) rename src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/{System.Windows.Forms.FuncTests.csproj => System.Windows.Forms.Func.Tests.csproj} (59%) diff --git a/System.Windows.Forms.sln b/System.Windows.Forms.sln index 97b164e3d67..9dcf0ba071e 100644 --- a/System.Windows.Forms.sln +++ b/System.Windows.Forms.sln @@ -1,4 +1,4 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.28307.4001 @@ -21,7 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{6F8B68FA-FC9 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{A306DE68-8EF5-403F-93E3-AC309655B5D2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.FuncTests", "src\System.Windows.Forms\tests\FuncTests\System.Windows.Forms.FuncTests\System.Windows.Forms.FuncTests.csproj", "{0EC2E473-02FF-471B-BF52-DEB375F64D23}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Func.Tests", "src\System.Windows.Forms\tests\FuncTests\System.Windows.Forms.FuncTests\System.Windows.Forms.Func.Tests.csproj", "{0EC2E473-02FF-471B-BF52-DEB375F64D23}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.FuncTests.csproj b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.Func.Tests.csproj similarity index 59% rename from src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.FuncTests.csproj rename to src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.Func.Tests.csproj index abd546829d9..66a0132e833 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.FuncTests.csproj +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.Func.Tests.csproj @@ -7,9 +7,8 @@ - - - + + From d78d7e5cd8381b2ca1157b7ecfa9b24c5ec5d6d9 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 27 Nov 2018 16:33:59 -0800 Subject: [PATCH 03/82] change to set environment variable before process start --- .../TestHelpers.cs | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs index 51778d25f2d..8c90c414732 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs @@ -8,21 +8,22 @@ public class TestHelpers /// /// Calls StartProcess for the ProcessStartInfo containing the bin path of this directory plsu the given byPathFromBin /// - /// The string path to add onto the end of the bin path; trimed for tailing \'s + /// The string path to add onto the end of the bin path in order to reach the exe to run; trimed for tailing \'s /// /// /// /// Throws ArgumentException if string byPathFromBin is null /// The new Process - public static Process StartProcess(string byPathFromBin) + public static Process StartProcess(string byPathFromBinToExe) { - if(null == byPathFromBin) + if(null == byPathFromBinToExe) { - throw new ArgumentException(nameof(byPathFromBin) + " must not be null."); + throw new ArgumentException(nameof(byPathFromBinToExe) + " must not be null."); } ProcessStartInfo startInfo = new ProcessStartInfo(); - startInfo.FileName = BinPath() + byPathFromBin.Trim('\\'); + startInfo.FileName = BinPath() + byPathFromBinToExe.Trim('\\'); + startInfo.EnvironmentVariables["DOTNET_ROOT"] = RepoPath() + ".dotnet"; // ... return StartProcess(startInfo); @@ -50,12 +51,33 @@ public static Process StartProcess(ProcessStartInfo info) /// /// Returns the bin directory of this project on a given machine - /// - /// - /// + /// /> /// Returns the entire path of this project if the bin is not part of it /// The bin path as a string; example: example:\Project\bin\ public static string BinPath() + { + return RelativePathTo("bin"); + } + + /// + /// Returns the repo base directory of this project on a given machine + /// /> + /// Returns the entire path of this project if the bin is not part of it + /// The repo base path as a string; example: example:\Project\ + public static string RepoPath() + { + return RelativePathTo("winforms"); + } + + /// + /// Returns the stop directory of this project on a given machine + /// + /// The string to stop at in the path; compared all lower + /// + /// + /// Returns the entire path of this project if the stop is not part of it + /// The path as a string; example: example:\Project\bin\ given "bin" if bin is present in the path + public static string RelativePathTo(string stop) { var path = AppDomain.CurrentDomain.BaseDirectory; var pathParts = path.Split('\\'); @@ -64,7 +86,7 @@ public static string BinPath() while (i < pathParts.Length) { ret += pathParts[i] + IO.Path.DirectorySeparatorChar; - if (pathParts[i].ToLower().Equals("bin".ToLower())) + if (pathParts[i].ToLower().Equals(stop.ToLower())) { break; } @@ -73,6 +95,8 @@ public static string BinPath() return ret; } + + /// /// Presses Enter on the given process if it can be made the foreground process /// From 7965f0cf622eeaa0f40a7f583155fbd1abfef0ca Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 28 Nov 2018 13:36:52 -0800 Subject: [PATCH 04/82] nit --- .../System.Windows.Forms.FuncTests/TestHelpers.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs index 8c90c414732..b1b69d687c7 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs @@ -16,9 +16,9 @@ public class TestHelpers /// The new Process public static Process StartProcess(string byPathFromBinToExe) { - if(null == byPathFromBinToExe) + if(byPathFromBinToExe == null) { - throw new ArgumentException(nameof(byPathFromBinToExe) + " must not be null."); + throw new ArgumentNullException(nameof(byPathFromBinToExe)); } ProcessStartInfo startInfo = new ProcessStartInfo(); @@ -51,7 +51,7 @@ public static Process StartProcess(ProcessStartInfo info) /// /// Returns the bin directory of this project on a given machine - /// /> + /// /// Returns the entire path of this project if the bin is not part of it /// The bin path as a string; example: example:\Project\bin\ public static string BinPath() @@ -61,7 +61,7 @@ public static string BinPath() /// /// Returns the repo base directory of this project on a given machine - /// /> + /// /// Returns the entire path of this project if the bin is not part of it /// The repo base path as a string; example: example:\Project\ public static string RepoPath() @@ -79,9 +79,14 @@ public static string RepoPath() /// The path as a string; example: example:\Project\bin\ given "bin" if bin is present in the path public static string RelativePathTo(string stop) { + if(string.IsNullOrEmpty(stop)) + { + throw new ArgumentException(nameof(stop) + " should not be null or empty."); + } + var path = AppDomain.CurrentDomain.BaseDirectory; var pathParts = path.Split('\\'); - string ret = ""; + string ret = string.Empty; uint i = 0; while (i < pathParts.Length) { From d8c0f44a627a69ed539eaf4891afa432071184bc Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 28 Nov 2018 15:49:30 -0800 Subject: [PATCH 05/82] yeah pair programming! --- .../TestHelpers.cs | 70 ++++++++++++++----- .../WinformsControlsTest.csproj | 4 ++ 2 files changed, 57 insertions(+), 17 deletions(-) diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs index b1b69d687c7..55de13c266d 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs @@ -1,17 +1,21 @@ using System.Diagnostics; using System.Threading; +using System.IO; +using System.Reflection; namespace System.Windows.Forms.FuncTests -{ +{ public class TestHelpers - { + { + /// - /// Calls StartProcess for the ProcessStartInfo containing the bin path of this directory plsu the given byPathFromBin + /// Calls StartProcess for the ProcessStartInfo containing the bin path of this directory plus the given byPathFromBinToExe; also ensures that repo\.dotnet\dotnet.exe exists /// /// The string path to add onto the end of the bin path in order to reach the exe to run; trimed for tailing \'s /// /// /// + /// /// Throws ArgumentException if string byPathFromBin is null /// The new Process public static Process StartProcess(string byPathFromBinToExe) @@ -21,9 +25,21 @@ public static Process StartProcess(string byPathFromBinToExe) throw new ArgumentNullException(nameof(byPathFromBinToExe)); } + if(byPathFromBinToExe.Length < 4 || + !byPathFromBinToExe.Substring(byPathFromBinToExe.Length-4).ToLower().Equals((".exe".ToLower()))) + { + throw new ArgumentException(nameof(byPathFromBinToExe) + " must end in a .exe"); + } + + var dotnetPath = DotNetPath(); + if (!Directory.Exists(dotnetPath)) + { + throw new DirectoryNotFoundException(dotnetPath + " directory cannot be found."); + } + ProcessStartInfo startInfo = new ProcessStartInfo(); - startInfo.FileName = BinPath() + byPathFromBinToExe.Trim('\\'); - startInfo.EnvironmentVariables["DOTNET_ROOT"] = RepoPath() + ".dotnet"; + startInfo.FileName = Path.Combine(BinPath(), byPathFromBinToExe.Trim('\\')); + startInfo.EnvironmentVariables["DOTNET_ROOT"] = dotnetPath; // ... return StartProcess(startInfo); @@ -56,17 +72,13 @@ public static Process StartProcess(ProcessStartInfo info) /// The bin path as a string; example: example:\Project\bin\ public static string BinPath() { - return RelativePathTo("bin"); + return RelativePathForwardTo("bin"); } - /// - /// Returns the repo base directory of this project on a given machine - /// - /// Returns the entire path of this project if the bin is not part of it - /// The repo base path as a string; example: example:\Project\ - public static string RepoPath() + + public static string DotNetPath() { - return RelativePathTo("winforms"); + return RelativePathBackwardsUntilFind(".dotnet"); } /// @@ -77,20 +89,20 @@ public static string RepoPath() /// /// Returns the entire path of this project if the stop is not part of it /// The path as a string; example: example:\Project\bin\ given "bin" if bin is present in the path - public static string RelativePathTo(string stop) + public static string RelativePathForwardTo(string stop) { if(string.IsNullOrEmpty(stop)) { - throw new ArgumentException(nameof(stop) + " should not be null or empty."); + throw new ArgumentException(nameof(stop) + " must not be null or empty."); } + string ret = string.Empty; var path = AppDomain.CurrentDomain.BaseDirectory; var pathParts = path.Split('\\'); - string ret = string.Empty; uint i = 0; while (i < pathParts.Length) { - ret += pathParts[i] + IO.Path.DirectorySeparatorChar; + ret = Path.Combine(ret, pathParts[i]); if (pathParts[i].ToLower().Equals(stop.ToLower())) { break; @@ -100,6 +112,30 @@ public static string RelativePathTo(string stop) return ret; } + public static string RelativePathBackwardsUntilFind(string seek) + { + if (string.IsNullOrEmpty(seek)) + { + throw new ArgumentNullException(nameof(seek)); + } + + var codeBaseUrl = new Uri(Assembly.GetExecutingAssembly().CodeBase); + var codeBasePath = Uri.UnescapeDataString(codeBaseUrl.AbsolutePath); + var currentDirectory = Path.GetDirectoryName(codeBasePath); + var root = Directory.GetDirectoryRoot(currentDirectory); + while (!currentDirectory.Equals(root)) + { + if (Directory.GetDirectories(currentDirectory, seek, SearchOption.TopDirectoryOnly).Length == 1) + { + var ret = Path.Combine(currentDirectory, seek); + return ret; + } + currentDirectory = Directory.GetParent(currentDirectory).FullName; + } + throw new Exception("no dotnet folder was found"); + } + + /// diff --git a/src/System.Windows.Forms/tests/functests/WinformsControlsTest/WinformsControlsTest.csproj b/src/System.Windows.Forms/tests/functests/WinformsControlsTest/WinformsControlsTest.csproj index 59a1e1566ab..a314eaf9f7e 100644 --- a/src/System.Windows.Forms/tests/functests/WinformsControlsTest/WinformsControlsTest.csproj +++ b/src/System.Windows.Forms/tests/functests/WinformsControlsTest/WinformsControlsTest.csproj @@ -85,6 +85,10 @@ + + + + Buttons.cs From 6feb911d6a9bf0a46e6105393a040ad5c75d1eb8 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 28 Nov 2018 16:00:35 -0800 Subject: [PATCH 06/82] please work tho --- .../System.Windows.Forms.FuncTests/WinformsControlsTest.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs index e42e858d959..98e40f23b12 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs @@ -21,6 +21,9 @@ public void WinformsControlsTest_OpenAndClose() process.Kill(); process.WaitForExit(); + uint x = 5; + x + 1; + Assert.True(process.HasExited); } From 491809a3056ef28ad7a7c204afd9eb41b68a2d8e Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Wed, 28 Nov 2018 18:02:09 -0600 Subject: [PATCH 07/82] Set yaml debug to true to help troubleshoot --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 56c7cadfa34..9d4ed8a4a2c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,6 +8,7 @@ variables: # clean the local repo on the build agents Build.Repository.Clean: true + System.Debug: true # only trigger ci builds for the master branch trigger: From 5d54a7935ab96940c7248bcb4177bb0e1c21b5c8 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 28 Nov 2018 16:07:34 -0800 Subject: [PATCH 08/82] why --- .../System.Windows.Forms.FuncTests/WinformsControlsTest.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs index 98e40f23b12..e42e858d959 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs @@ -21,9 +21,6 @@ public void WinformsControlsTest_OpenAndClose() process.Kill(); process.WaitForExit(); - uint x = 5; - x + 1; - Assert.True(process.HasExited); } From cbdea61e2df12ef9d357f59bca52623a6fb73edc Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 28 Nov 2018 16:15:37 -0800 Subject: [PATCH 09/82] shot in the dark but sure --- .../System.Windows.Forms.FuncTests/WinformsControlsTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs index e42e858d959..adf7b549401 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs @@ -7,7 +7,7 @@ namespace System.Windows.Forms.FuncTests public class WinformsControlsTestTests { - public const string PathToTestFromBin = "WinformsControlsTest\\Debug\\netcoreapp3.0\\WinformsControlsTest.exe"; + public const string PathToTestFromBin = "WinformsControlsTest\\Release\\netcoreapp3.0\\WinformsControlsTest.exe"; [Fact] public void WinformsControlsTest_OpenAndClose() From ae4f6d636c9b34c480cb02e09289bde4abdfda4c Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 28 Nov 2018 16:29:28 -0800 Subject: [PATCH 10/82] even better, this time with feeling! --- .../System.Windows.Forms.FuncTests/TestHelpers.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs index 55de13c266d..1b190e4276b 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs @@ -25,8 +25,7 @@ public static Process StartProcess(string byPathFromBinToExe) throw new ArgumentNullException(nameof(byPathFromBinToExe)); } - if(byPathFromBinToExe.Length < 4 || - !byPathFromBinToExe.Substring(byPathFromBinToExe.Length-4).ToLower().Equals((".exe".ToLower()))) + if (!byPathFromBinToExe.EndsWith(".exe", StringComparison.CurrentCultureIgnoreCase)) { throw new ArgumentException(nameof(byPathFromBinToExe) + " must end in a .exe"); } @@ -103,7 +102,7 @@ public static string RelativePathForwardTo(string stop) while (i < pathParts.Length) { ret = Path.Combine(ret, pathParts[i]); - if (pathParts[i].ToLower().Equals(stop.ToLower())) + if (pathParts[i].Equals(stop, StringComparison.CurrentCultureIgnoreCase)) { break; } @@ -123,7 +122,7 @@ public static string RelativePathBackwardsUntilFind(string seek) var codeBasePath = Uri.UnescapeDataString(codeBaseUrl.AbsolutePath); var currentDirectory = Path.GetDirectoryName(codeBasePath); var root = Directory.GetDirectoryRoot(currentDirectory); - while (!currentDirectory.Equals(root)) + while (!currentDirectory.Equals(root, StringComparison.CurrentCultureIgnoreCase)) { if (Directory.GetDirectories(currentDirectory, seek, SearchOption.TopDirectoryOnly).Length == 1) { From 782b6681b0a989b0bfe0430cd6a55f596e5fcd15 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 28 Nov 2018 16:39:09 -0800 Subject: [PATCH 11/82] docs --- .../TestHelpers.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs index 1b190e4276b..cc7732e27f0 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs @@ -86,6 +86,7 @@ public static string DotNetPath() /// The string to stop at in the path; compared all lower /// /// + /// /// Returns the entire path of this project if the stop is not part of it /// The path as a string; example: example:\Project\bin\ given "bin" if bin is present in the path public static string RelativePathForwardTo(string stop) @@ -97,7 +98,7 @@ public static string RelativePathForwardTo(string stop) string ret = string.Empty; var path = AppDomain.CurrentDomain.BaseDirectory; - var pathParts = path.Split('\\'); + var pathParts = path.Split(Path.DirectorySeparatorChar); uint i = 0; while (i < pathParts.Length) { @@ -111,6 +112,17 @@ public static string RelativePathForwardTo(string stop) return ret; } + /// + /// Looks backwards form the current executing directory until it finds a sibling directory seek, then returns the full path of that sibling + /// + /// The sibling directory to look for + /// + /// + /// + /// + /// + /// + /// The full path of the first sibling directory by the current executing directory, away from the root public static string RelativePathBackwardsUntilFind(string seek) { if (string.IsNullOrEmpty(seek)) @@ -131,12 +143,9 @@ public static string RelativePathBackwardsUntilFind(string seek) } currentDirectory = Directory.GetParent(currentDirectory).FullName; } - throw new Exception("no dotnet folder was found"); + throw new Exception("no " + nameof(seek) + " sibling folder was found"); } - - - /// /// Presses Enter on the given process if it can be made the foreground process /// From 8713166aaca95bc91377b34d9d119d6978df789b Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Thu, 29 Nov 2018 11:04:55 -0600 Subject: [PATCH 12/82] changed func test config to debug and add 5 minute timeout to build step for debugging --- eng/ci.yml | 3 ++- .../System.Windows.Forms.FuncTests/WinformsControlsTest.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index cb71b507de9..a3815f0b889 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -91,4 +91,5 @@ jobs: $(_PublishArgs) $(_SignArgs) $(_OfficialBuildIdArgs) - displayName: Windows Build / Publish \ No newline at end of file + displayName: Windows Build / Publish + timeoutInMinutes: 5 \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs index adf7b549401..e42e858d959 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs @@ -7,7 +7,7 @@ namespace System.Windows.Forms.FuncTests public class WinformsControlsTestTests { - public const string PathToTestFromBin = "WinformsControlsTest\\Release\\netcoreapp3.0\\WinformsControlsTest.exe"; + public const string PathToTestFromBin = "WinformsControlsTest\\Debug\\netcoreapp3.0\\WinformsControlsTest.exe"; [Fact] public void WinformsControlsTest_OpenAndClose() From 2a08804a6dee05a51d1218f0cafd8a6d4b2ee64e Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Thu, 29 Nov 2018 10:21:35 -0800 Subject: [PATCH 13/82] renaming folder structure to match csproj name --- System.Windows.Forms.sln | 71 ----- .../ExternalTestHelpers.cs | 23 -- .../System.Windows.Forms.Func.Tests.csproj | 18 -- .../TestHelpers.cs | 244 ------------------ .../WinformsControlsTest.cs | 237 ----------------- 5 files changed, 593 deletions(-) delete mode 100644 System.Windows.Forms.sln delete mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/ExternalTestHelpers.cs delete mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.Func.Tests.csproj delete mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs delete mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs diff --git a/System.Windows.Forms.sln b/System.Windows.Forms.sln deleted file mode 100644 index 9dcf0ba071e..00000000000 --- a/System.Windows.Forms.sln +++ /dev/null @@ -1,71 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28307.4001 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms", "src\System.Windows.Forms\src\System.Windows.Forms.csproj", "{0D23A41B-2626-4703-9E4A-87C07F69B0B2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Ref", "src\System.Windows.Forms\ref\System.Windows.Forms.Ref.csproj", "{334C343B-9D39-498E-89D8-B6526028FD5C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Tests", "src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj", "{AB38E262-F206-4820-8F29-23C5F72A4A16}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinformsControlsTest", "src\System.Windows.Forms\tests\functests\WinformsControlsTest\WinformsControlsTest.csproj", "{657472B8-FDA3-49DF-B8BE-0246046A4348}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Private.Winforms", "pkg\Microsoft.Private.Winforms.csproj", "{F133342A-3040-4005-A2F0-7685AA7CB82D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pkg", "pkg", "{C611474D-0DFF-4E30-A22A-4A0C0776AB0D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{02770A27-2DAC-4D90-BD56-2C3749E92917}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{6F8B68FA-FC93-4EB2-973E-89CBF96A1676}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{A306DE68-8EF5-403F-93E3-AC309655B5D2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Func.Tests", "src\System.Windows.Forms\tests\FuncTests\System.Windows.Forms.FuncTests\System.Windows.Forms.Func.Tests.csproj", "{0EC2E473-02FF-471B-BF52-DEB375F64D23}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0D23A41B-2626-4703-9E4A-87C07F69B0B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D23A41B-2626-4703-9E4A-87C07F69B0B2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D23A41B-2626-4703-9E4A-87C07F69B0B2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D23A41B-2626-4703-9E4A-87C07F69B0B2}.Release|Any CPU.Build.0 = Release|Any CPU - {334C343B-9D39-498E-89D8-B6526028FD5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {334C343B-9D39-498E-89D8-B6526028FD5C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {334C343B-9D39-498E-89D8-B6526028FD5C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {334C343B-9D39-498E-89D8-B6526028FD5C}.Release|Any CPU.Build.0 = Release|Any CPU - {AB38E262-F206-4820-8F29-23C5F72A4A16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AB38E262-F206-4820-8F29-23C5F72A4A16}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AB38E262-F206-4820-8F29-23C5F72A4A16}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AB38E262-F206-4820-8F29-23C5F72A4A16}.Release|Any CPU.Build.0 = Release|Any CPU - {657472B8-FDA3-49DF-B8BE-0246046A4348}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {657472B8-FDA3-49DF-B8BE-0246046A4348}.Debug|Any CPU.Build.0 = Debug|Any CPU - {657472B8-FDA3-49DF-B8BE-0246046A4348}.Release|Any CPU.ActiveCfg = Release|Any CPU - {657472B8-FDA3-49DF-B8BE-0246046A4348}.Release|Any CPU.Build.0 = Release|Any CPU - {F133342A-3040-4005-A2F0-7685AA7CB82D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F133342A-3040-4005-A2F0-7685AA7CB82D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F133342A-3040-4005-A2F0-7685AA7CB82D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F133342A-3040-4005-A2F0-7685AA7CB82D}.Release|Any CPU.Build.0 = Release|Any CPU - {0EC2E473-02FF-471B-BF52-DEB375F64D23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0EC2E473-02FF-471B-BF52-DEB375F64D23}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0EC2E473-02FF-471B-BF52-DEB375F64D23}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0EC2E473-02FF-471B-BF52-DEB375F64D23}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {0D23A41B-2626-4703-9E4A-87C07F69B0B2} = {02770A27-2DAC-4D90-BD56-2C3749E92917} - {334C343B-9D39-498E-89D8-B6526028FD5C} = {6F8B68FA-FC93-4EB2-973E-89CBF96A1676} - {AB38E262-F206-4820-8F29-23C5F72A4A16} = {A306DE68-8EF5-403F-93E3-AC309655B5D2} - {657472B8-FDA3-49DF-B8BE-0246046A4348} = {A306DE68-8EF5-403F-93E3-AC309655B5D2} - {F133342A-3040-4005-A2F0-7685AA7CB82D} = {C611474D-0DFF-4E30-A22A-4A0C0776AB0D} - {0EC2E473-02FF-471B-BF52-DEB375F64D23} = {A306DE68-8EF5-403F-93E3-AC309655B5D2} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7B1B0433-F612-4E5A-BE7E-FCF5B9F6E136} - EndGlobalSection -EndGlobal diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/ExternalTestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/ExternalTestHelpers.cs deleted file mode 100644 index d729937f581..00000000000 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/ExternalTestHelpers.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Runtime.InteropServices; - -namespace System.Windows.Forms.FuncTests -{ - public class ExternalTestHelpers - { - [DllImport("User32.dll")] - static extern int SetForegroundWindow(IntPtr point); - - [DllImport("User32.dll")] - static extern IntPtr GetForegroundWindow(); - - public static int TrySetForegroundWindow(IntPtr point) - { - return SetForegroundWindow(point); - } - - public static IntPtr TryGetForegroundWindow() - { - return GetForegroundWindow(); - } - } -} diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.Func.Tests.csproj b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.Func.Tests.csproj deleted file mode 100644 index 66a0132e833..00000000000 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/System.Windows.Forms.Func.Tests.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netcoreapp3.0 - - false - - - - - - - - - - - - diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs deleted file mode 100644 index cc7732e27f0..00000000000 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/TestHelpers.cs +++ /dev/null @@ -1,244 +0,0 @@ -using System.Diagnostics; -using System.Threading; -using System.IO; -using System.Reflection; - -namespace System.Windows.Forms.FuncTests -{ - public class TestHelpers - { - - /// - /// Calls StartProcess for the ProcessStartInfo containing the bin path of this directory plus the given byPathFromBinToExe; also ensures that repo\.dotnet\dotnet.exe exists - /// - /// The string path to add onto the end of the bin path in order to reach the exe to run; trimed for tailing \'s - /// - /// - /// - /// - /// Throws ArgumentException if string byPathFromBin is null - /// The new Process - public static Process StartProcess(string byPathFromBinToExe) - { - if(byPathFromBinToExe == null) - { - throw new ArgumentNullException(nameof(byPathFromBinToExe)); - } - - if (!byPathFromBinToExe.EndsWith(".exe", StringComparison.CurrentCultureIgnoreCase)) - { - throw new ArgumentException(nameof(byPathFromBinToExe) + " must end in a .exe"); - } - - var dotnetPath = DotNetPath(); - if (!Directory.Exists(dotnetPath)) - { - throw new DirectoryNotFoundException(dotnetPath + " directory cannot be found."); - } - - ProcessStartInfo startInfo = new ProcessStartInfo(); - startInfo.FileName = Path.Combine(BinPath(), byPathFromBinToExe.Trim('\\')); - startInfo.EnvironmentVariables["DOTNET_ROOT"] = dotnetPath; - // ... - - return StartProcess(startInfo); - } - - /// - /// Calls Process.Start() on the given ProcessStartInfo; waits 500 ms - /// - /// The info with which to start the process - /// - /// - /// Throws ArgumentException if ProcessStartInfo info is null - /// The new Process - public static Process StartProcess(ProcessStartInfo info) - { - Process process = new Process(); - - process.StartInfo = info ?? throw new ArgumentException(nameof(info) + " must not be null."); - process.Start(); - - Thread.Sleep(500); - - return process; - } - - /// - /// Returns the bin directory of this project on a given machine - /// - /// Returns the entire path of this project if the bin is not part of it - /// The bin path as a string; example: example:\Project\bin\ - public static string BinPath() - { - return RelativePathForwardTo("bin"); - } - - - public static string DotNetPath() - { - return RelativePathBackwardsUntilFind(".dotnet"); - } - - /// - /// Returns the stop directory of this project on a given machine - /// - /// The string to stop at in the path; compared all lower - /// - /// - /// - /// Returns the entire path of this project if the stop is not part of it - /// The path as a string; example: example:\Project\bin\ given "bin" if bin is present in the path - public static string RelativePathForwardTo(string stop) - { - if(string.IsNullOrEmpty(stop)) - { - throw new ArgumentException(nameof(stop) + " must not be null or empty."); - } - - string ret = string.Empty; - var path = AppDomain.CurrentDomain.BaseDirectory; - var pathParts = path.Split(Path.DirectorySeparatorChar); - uint i = 0; - while (i < pathParts.Length) - { - ret = Path.Combine(ret, pathParts[i]); - if (pathParts[i].Equals(stop, StringComparison.CurrentCultureIgnoreCase)) - { - break; - } - i++; - } - return ret; - } - - /// - /// Looks backwards form the current executing directory until it finds a sibling directory seek, then returns the full path of that sibling - /// - /// The sibling directory to look for - /// - /// - /// - /// - /// - /// - /// The full path of the first sibling directory by the current executing directory, away from the root - public static string RelativePathBackwardsUntilFind(string seek) - { - if (string.IsNullOrEmpty(seek)) - { - throw new ArgumentNullException(nameof(seek)); - } - - var codeBaseUrl = new Uri(Assembly.GetExecutingAssembly().CodeBase); - var codeBasePath = Uri.UnescapeDataString(codeBaseUrl.AbsolutePath); - var currentDirectory = Path.GetDirectoryName(codeBasePath); - var root = Directory.GetDirectoryRoot(currentDirectory); - while (!currentDirectory.Equals(root, StringComparison.CurrentCultureIgnoreCase)) - { - if (Directory.GetDirectories(currentDirectory, seek, SearchOption.TopDirectoryOnly).Length == 1) - { - var ret = Path.Combine(currentDirectory, seek); - return ret; - } - currentDirectory = Directory.GetParent(currentDirectory).FullName; - } - throw new Exception("no " + nameof(seek) + " sibling folder was found"); - } - - /// - /// Presses Enter on the given process if it can be made the foreground process - /// - /// The process to send the Enter key to - /// Whether or not the Enter key was pressed on the process - /// - public static bool PressEnterOnProcess(Process process) - { - return PressOnProcess(process, "~"); - } - - /// - /// Presses Tab on the given process if it can be made the foreground process - /// - /// The process to send the Tab key to - /// Whether or not the Tab key was pressed on the process - /// - public static bool PressTabOnProcess(Process process) - { - return PressOnProcess(process, "{TAB}"); - } - - /// - /// Presses Tab any number of times on the given process if it can be made the foreground process - /// - /// The process to send the Tab key(s) to - /// The number of times to press tab in a row - /// Throws an ArgumentException if number of times is zero; this is unlikely to be intended. - /// Whether or not the Tab key(s) were pressed on the process - /// - public static bool PressTabsOnProcess(Process process, uint times) - { - if (times == 0) - { - throw new ArgumentException(nameof(times) + " may not be zero."); - } - - string keys = ""; - for (uint i = 0; i < times; i++) - { - keys += "{TAB}"; - } - return PressOnProcess(process, keys); - } - - /// - /// Presses the given keys on the given process, then waits 200ms - /// - /// The process to send the key(s) to - /// The key(s) to send to the process - /// Throws an ArgumentException if the process is null or has exited. - /// Throws an ArgumentException if the given key(s) is null or the empty string. - /// Whether or not the key(s) were pressed on the process - /// - /// - /// - /// - /// - internal static bool PressOnProcess(Process process, string keys) - { - if (null == process) - { - throw new ArgumentException(nameof(process) + " must not be null."); - } - - if (process.HasExited) - { - throw new ArgumentException(nameof(process) + " must not have exited."); - } - - if (string.IsNullOrEmpty(keys)) - { - throw new ArgumentException(nameof(keys) + " must not be null or empty."); - } - - var handle = process.MainWindowHandle; - ExternalTestHelpers.TrySetForegroundWindow(handle); - - if (handle.Equals(ExternalTestHelpers.TryGetForegroundWindow())) - { - SendKeys.SendWait(keys); - - Thread.Sleep(200); - - return true; - } - else - { - Debug.Assert(true, "Given process could not be made to be the ForegroundWindow"); - - return false; - } - } - - } -} diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs deleted file mode 100644 index e42e858d959..00000000000 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.FuncTests/WinformsControlsTest.cs +++ /dev/null @@ -1,237 +0,0 @@ -using System; -using System.Diagnostics; -using Xunit; - -namespace System.Windows.Forms.FuncTests -{ - public class WinformsControlsTestTests - { - - public const string PathToTestFromBin = "WinformsControlsTest\\Debug\\netcoreapp3.0\\WinformsControlsTest.exe"; - - [Fact] - public void WinformsControlsTest_OpenAndClose() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - - Assert.NotNull(process); - Assert.NotNull(Process.GetProcessById(process.Id)); - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_ButtonsTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_CalendarTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 1); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_TreeViewAndImageListTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 2); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_ContentAlignmentTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 3); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_MultipleControlsTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 4); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_DataGridViewTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 5); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_MenusTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 6); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_PanelsTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 7); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_SplitterTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 8); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_ComboBoxesTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 9); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_MDIParentTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 10); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_PropertyGridTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 11); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_ListViewTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 12); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_DateTimePickerTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 13); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - } -} From 88f2af9200f3a4f8f1ed5752b8b8f140742f9780 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Thu, 29 Nov 2018 10:26:23 -0800 Subject: [PATCH 14/82] left this change behind --- .../ExternalTestHelpers.cs | 23 ++ .../System.Windows.Forms.Func.Tests.csproj | 18 ++ .../TestHelpers.cs | 244 ++++++++++++++++++ .../WinformsControlsTest.cs | 237 +++++++++++++++++ 4 files changed, 522 insertions(+) create mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs create mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/System.Windows.Forms.Func.Tests.csproj create mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs create mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs new file mode 100644 index 00000000000..d2c066a422e --- /dev/null +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs @@ -0,0 +1,23 @@ +using System.Runtime.InteropServices; + +namespace System.Windows.Forms.Func.Tests +{ + public class ExternalTestHelpers + { + [DllImport("User32.dll")] + static extern int SetForegroundWindow(IntPtr point); + + [DllImport("User32.dll")] + static extern IntPtr GetForegroundWindow(); + + public static int TrySetForegroundWindow(IntPtr point) + { + return SetForegroundWindow(point); + } + + public static IntPtr TryGetForegroundWindow() + { + return GetForegroundWindow(); + } + } +} diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/System.Windows.Forms.Func.Tests.csproj b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/System.Windows.Forms.Func.Tests.csproj new file mode 100644 index 00000000000..66a0132e833 --- /dev/null +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/System.Windows.Forms.Func.Tests.csproj @@ -0,0 +1,18 @@ + + + + netcoreapp3.0 + + false + + + + + + + + + + + + diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs new file mode 100644 index 00000000000..dca955473c3 --- /dev/null +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs @@ -0,0 +1,244 @@ +using System.Diagnostics; +using System.Threading; +using System.IO; +using System.Reflection; + +namespace System.Windows.Forms.Func.Tests +{ + public class TestHelpers + { + + /// + /// Calls StartProcess for the ProcessStartInfo containing the bin path of this directory plus the given byPathFromBinToExe; also ensures that repo\.dotnet\dotnet.exe exists + /// + /// The string path to add onto the end of the bin path in order to reach the exe to run; trimed for tailing \'s + /// + /// + /// + /// + /// Throws ArgumentException if string byPathFromBin is null + /// The new Process + public static Process StartProcess(string byPathFromBinToExe) + { + if(byPathFromBinToExe == null) + { + throw new ArgumentNullException(nameof(byPathFromBinToExe)); + } + + if (!byPathFromBinToExe.EndsWith(".exe", StringComparison.CurrentCultureIgnoreCase)) + { + throw new ArgumentException(nameof(byPathFromBinToExe) + " must end in a .exe"); + } + + var dotnetPath = DotNetPath(); + if (!Directory.Exists(dotnetPath)) + { + throw new DirectoryNotFoundException(dotnetPath + " directory cannot be found."); + } + + ProcessStartInfo startInfo = new ProcessStartInfo(); + startInfo.FileName = Path.Combine(BinPath(), byPathFromBinToExe.Trim('\\')); + startInfo.EnvironmentVariables["DOTNET_ROOT"] = dotnetPath; + // ... + + return StartProcess(startInfo); + } + + /// + /// Calls Process.Start() on the given ProcessStartInfo; waits 500 ms + /// + /// The info with which to start the process + /// + /// + /// Throws ArgumentException if ProcessStartInfo info is null + /// The new Process + public static Process StartProcess(ProcessStartInfo info) + { + Process process = new Process(); + + process.StartInfo = info ?? throw new ArgumentException(nameof(info) + " must not be null."); + process.Start(); + + Thread.Sleep(500); + + return process; + } + + /// + /// Returns the bin directory of this project on a given machine + /// + /// Returns the entire path of this project if the bin is not part of it + /// The bin path as a string; example: example:\Project\bin\ + public static string BinPath() + { + return RelativePathForwardTo("bin"); + } + + + public static string DotNetPath() + { + return RelativePathBackwardsUntilFind(".dotnet"); + } + + /// + /// Returns the stop directory of this project on a given machine + /// + /// The string to stop at in the path; compared all lower + /// + /// + /// + /// Returns the entire path of this project if the stop is not part of it + /// The path as a string; example: example:\Project\bin\ given "bin" if bin is present in the path + public static string RelativePathForwardTo(string stop) + { + if(string.IsNullOrEmpty(stop)) + { + throw new ArgumentException(nameof(stop) + " must not be null or empty."); + } + + string ret = string.Empty; + var path = AppDomain.CurrentDomain.BaseDirectory; + var pathParts = path.Split(Path.DirectorySeparatorChar); + uint i = 0; + while (i < pathParts.Length) + { + ret = Path.Combine(ret, pathParts[i]); + if (pathParts[i].Equals(stop, StringComparison.CurrentCultureIgnoreCase)) + { + break; + } + i++; + } + return ret; + } + + /// + /// Looks backwards form the current executing directory until it finds a sibling directory seek, then returns the full path of that sibling + /// + /// The sibling directory to look for + /// + /// + /// + /// + /// + /// + /// The full path of the first sibling directory by the current executing directory, away from the root + public static string RelativePathBackwardsUntilFind(string seek) + { + if (string.IsNullOrEmpty(seek)) + { + throw new ArgumentNullException(nameof(seek)); + } + + var codeBaseUrl = new Uri(Assembly.GetExecutingAssembly().CodeBase); + var codeBasePath = Uri.UnescapeDataString(codeBaseUrl.AbsolutePath); + var currentDirectory = Path.GetDirectoryName(codeBasePath); + var root = Directory.GetDirectoryRoot(currentDirectory); + while (!currentDirectory.Equals(root, StringComparison.CurrentCultureIgnoreCase)) + { + if (Directory.GetDirectories(currentDirectory, seek, SearchOption.TopDirectoryOnly).Length == 1) + { + var ret = Path.Combine(currentDirectory, seek); + return ret; + } + currentDirectory = Directory.GetParent(currentDirectory).FullName; + } + throw new Exception("no " + nameof(seek) + " sibling folder was found"); + } + + /// + /// Presses Enter on the given process if it can be made the foreground process + /// + /// The process to send the Enter key to + /// Whether or not the Enter key was pressed on the process + /// + public static bool PressEnterOnProcess(Process process) + { + return PressOnProcess(process, "~"); + } + + /// + /// Presses Tab on the given process if it can be made the foreground process + /// + /// The process to send the Tab key to + /// Whether or not the Tab key was pressed on the process + /// + public static bool PressTabOnProcess(Process process) + { + return PressOnProcess(process, "{TAB}"); + } + + /// + /// Presses Tab any number of times on the given process if it can be made the foreground process + /// + /// The process to send the Tab key(s) to + /// The number of times to press tab in a row + /// Throws an ArgumentException if number of times is zero; this is unlikely to be intended. + /// Whether or not the Tab key(s) were pressed on the process + /// + public static bool PressTabsOnProcess(Process process, uint times) + { + if (times == 0) + { + throw new ArgumentException(nameof(times) + " may not be zero."); + } + + string keys = ""; + for (uint i = 0; i < times; i++) + { + keys += "{TAB}"; + } + return PressOnProcess(process, keys); + } + + /// + /// Presses the given keys on the given process, then waits 200ms + /// + /// The process to send the key(s) to + /// The key(s) to send to the process + /// Throws an ArgumentException if the process is null or has exited. + /// Throws an ArgumentException if the given key(s) is null or the empty string. + /// Whether or not the key(s) were pressed on the process + /// + /// + /// + /// + /// + internal static bool PressOnProcess(Process process, string keys) + { + if (null == process) + { + throw new ArgumentException(nameof(process) + " must not be null."); + } + + if (process.HasExited) + { + throw new ArgumentException(nameof(process) + " must not have exited."); + } + + if (string.IsNullOrEmpty(keys)) + { + throw new ArgumentException(nameof(keys) + " must not be null or empty."); + } + + var handle = process.MainWindowHandle; + ExternalTestHelpers.TrySetForegroundWindow(handle); + + if (handle.Equals(ExternalTestHelpers.TryGetForegroundWindow())) + { + SendKeys.SendWait(keys); + + Thread.Sleep(200); + + return true; + } + else + { + Debug.Assert(true, "Given process could not be made to be the ForegroundWindow"); + + return false; + } + } + + } +} diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs new file mode 100644 index 00000000000..f6e4c39b6cc --- /dev/null +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs @@ -0,0 +1,237 @@ +using System; +using System.Diagnostics; +using Xunit; + +namespace System.Windows.Forms.Func.Tests +{ + public class WinformsControlsTestTests + { + + public const string PathToTestFromBin = "WinformsControlsTest\\Debug\\netcoreapp3.0\\WinformsControlsTest.exe"; + + [Fact] + public void WinformsControlsTest_OpenAndClose() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + + Assert.NotNull(process); + Assert.NotNull(Process.GetProcessById(process.Id)); + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_ButtonsTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_CalendarTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 1); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_TreeViewAndImageListTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 2); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_ContentAlignmentTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 3); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_MultipleControlsTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 4); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_DataGridViewTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 5); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_MenusTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 6); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_PanelsTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 7); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_SplitterTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 8); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_ComboBoxesTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 9); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_MDIParentTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 10); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_PropertyGridTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 11); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_ListViewTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 12); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + + [Fact] + public void WinformsControlsTest_DateTimePickerTest() + { + var process = TestHelpers.StartProcess(PathToTestFromBin); + TestHelpers.PressTabsOnProcess(process, 13); + TestHelpers.PressEnterOnProcess(process); + + Assert.False(process.HasExited); + + process.Kill(); + process.WaitForExit(); + + Assert.True(process.HasExited); + } + } +} From 92bcf598d84e2ab7e27da0649163dfe4c54ef8d2 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Thu, 29 Nov 2018 18:45:17 -0600 Subject: [PATCH 15/82] debugging in yaml --- azure-pipelines.yml | 1 - eng/ci.yml | 37 ++++++++++++++++++++++++++++++++++++- eng/common/CIBuild.cmd | 2 +- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9d4ed8a4a2c..56c7cadfa34 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,7 +8,6 @@ variables: # clean the local repo on the build agents Build.Repository.Clean: true - System.Debug: true # only trigger ci builds for the master branch trigger: diff --git a/eng/ci.yml b/eng/ci.yml index a3815f0b889..22573a0dde3 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -84,6 +84,7 @@ jobs: steps: - checkout: self clean: true + # Use utility script to run script command dependent on agent OS. - script: eng\common\cibuild.cmd -configuration $(_BuildConfig) @@ -92,4 +93,38 @@ jobs: $(_SignArgs) $(_OfficialBuildIdArgs) displayName: Windows Build / Publish - timeoutInMinutes: 5 \ No newline at end of file + + - script: | + echo BinariesDir = $(Build.BinariesDirectory) + + # Copy files for helix job + # - task: CopyFiles@2 + # inputs: + # #sourceFolder: # Optional + # #contents: '**' + # targetFolder: + # #cleanTargetFolder: false # Optional + # #overWrite: false # Optional + # #flattenFolders: false # Optional + + # - template: /eng/common/templates/steps/helix-publish.yml + # parameters: + # HelixSource: $(_HelixSource) + # HelixType: ̓'tests/functional' + # #HelixTargetQueues: '' + # HelixAccessToken: $(helix-token) # secret variable set in Azure DevOps build definition + # #HelixPreCommands: '' + # #HelixPostCommands: '' + # WorkItemDirectory: '' + # WorkItemCommand: '' + # #CorrelationPayloadDirectory: '' + # XUnitProjects: '' + # XUnitTargetFramework: '' + # XUnitRunnerVersion: '' + # IncludeDotNetCli: false + # DotNetCliPackageType: '' + # DotNetCliVersion: '' + # EnableXUnitReporter: false + # WaitForWorkItemCompletion: true + # condition: succeeded() + # continueOnError: false \ No newline at end of file diff --git a/eng/common/CIBuild.cmd b/eng/common/CIBuild.cmd index 6544b0cd54f..b104bbf5996 100644 --- a/eng/common/CIBuild.cmd +++ b/eng/common/CIBuild.cmd @@ -1,3 +1,3 @@ @echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*" +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -sign -pack -publish -ci %*" exit /b %ErrorLevel% From 46768621bce0f483cf234a43a6aabfdb45f88e4a Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Thu, 29 Nov 2018 18:52:36 -0600 Subject: [PATCH 16/82] testing --- eng/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eng/ci.yml b/eng/ci.yml index 22573a0dde3..aef3de60d09 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -85,6 +85,10 @@ jobs: - checkout: self clean: true + - script: | + echo BinariesDir = $(Build.BinariesDirectory) + echo ArtifactsBinDir = $(ArtifactsBinDir) + # Use utility script to run script command dependent on agent OS. - script: eng\common\cibuild.cmd -configuration $(_BuildConfig) @@ -96,6 +100,7 @@ jobs: - script: | echo BinariesDir = $(Build.BinariesDirectory) + echo ArtifactsBinDir = $(ArtifactsBinDir) # Copy files for helix job # - task: CopyFiles@2 From 4e60f0a4ab47c83b53519410ba01ee937bd32bf4 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Fri, 30 Nov 2018 11:04:57 -0600 Subject: [PATCH 17/82] print out all env vars for debugging --- eng/ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index aef3de60d09..ec53aa85954 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -86,8 +86,7 @@ jobs: clean: true - script: | - echo BinariesDir = $(Build.BinariesDirectory) - echo ArtifactsBinDir = $(ArtifactsBinDir) + set # Use utility script to run script command dependent on agent OS. - script: eng\common\cibuild.cmd @@ -99,8 +98,7 @@ jobs: displayName: Windows Build / Publish - script: | - echo BinariesDir = $(Build.BinariesDirectory) - echo ArtifactsBinDir = $(ArtifactsBinDir) + set # Copy files for helix job # - task: CopyFiles@2 From 285cec4d7d7b9ec4d71233554bf3cc0abc221d70 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Fri, 30 Nov 2018 12:36:11 -0600 Subject: [PATCH 18/82] adding helix steps --- eng/ci.yml | 89 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 53 insertions(+), 36 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index ec53aa85954..3678a715010 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -41,6 +41,16 @@ jobs: - name: _OfficialBuildIdArgs value: '' + # needed for helix jobs + - name: _HelixAgentPool + value: 'Windows.10.Amd64.Open' + - name: _WinformsControlsTestBinDir + value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\WinformsControlsTest\$(_BuildConfig)\netcoreapp3.0 + - name: _WinformsFuncTestBinDir + value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\System.Windows.Forms.Func.Tests\$(_BuildConfig)\netcoreapp3.0 + - name: _HelixStagingDir + value: $(BUILD.STAGINGDIRECTORY)\helix\functests + # Override some values if we're building internally - ${{ if eq(parameters.runAsPublic, 'false') }}: @@ -70,6 +80,9 @@ jobs: - name: _OfficialBuildIdArgs value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) + - name: _HelixAgentPool + value: 'Windows.10.Amd64' + strategy: matrix: Build_Debug: @@ -85,9 +98,6 @@ jobs: - checkout: self clean: true - - script: | - set - # Use utility script to run script command dependent on agent OS. - script: eng\common\cibuild.cmd -configuration $(_BuildConfig) @@ -97,37 +107,44 @@ jobs: $(_OfficialBuildIdArgs) displayName: Windows Build / Publish - - script: | - set - # Copy files for helix job - # - task: CopyFiles@2 - # inputs: - # #sourceFolder: # Optional - # #contents: '**' - # targetFolder: - # #cleanTargetFolder: false # Optional - # #overWrite: false # Optional - # #flattenFolders: false # Optional - - # - template: /eng/common/templates/steps/helix-publish.yml - # parameters: - # HelixSource: $(_HelixSource) - # HelixType: ̓'tests/functional' - # #HelixTargetQueues: '' - # HelixAccessToken: $(helix-token) # secret variable set in Azure DevOps build definition - # #HelixPreCommands: '' - # #HelixPostCommands: '' - # WorkItemDirectory: '' - # WorkItemCommand: '' - # #CorrelationPayloadDirectory: '' - # XUnitProjects: '' - # XUnitTargetFramework: '' - # XUnitRunnerVersion: '' - # IncludeDotNetCli: false - # DotNetCliPackageType: '' - # DotNetCliVersion: '' - # EnableXUnitReporter: false - # WaitForWorkItemCompletion: true - # condition: succeeded() - # continueOnError: false \ No newline at end of file + - task: CopyFiles@2 + inputs: + sourceFolder: $(_WinformsControlsTestBinDir) + contents: '**' + targetFolder: $(_HelixStagingDir) + cleanTargetFolder: true + #overWrite: false # Optional + displayName: Copy winforms controls tests to helix staging dir + - task: CopyFiles@2 + inputs: + sourceFolder: $(_WinformsFuncTestBinDir) + contents: '**' + targetFolder: $(_HelixStagingDir) + overWrite: true + displayName: Copy xUnit func tests to helix staging dir + + - template: /eng/common/templates/steps/helix-publish.yml + parameters: + HelixSource: $(_HelixSource) + HelixType: ̓'tests/functional' + HelixTargetQueues: $(_HelixAgentPool) + # secret variable set in Azure DevOps build definition + # todo: when we go public, get this value from the Helix Anonymous variable group + # for internal builds, get this value from the DotNet-HelixApi-Access variable group + HelixAccessToken: $(helix-token) + #HelixPreCommands: '' + #HelixPostCommands: '' + WorkItemDirectory: $(_HelixStagingDir) + WorkItemCommand: 'dotnet.exe exec --depsfile System.Windows.Forms.Func.Tests.deps.json --runtimeconfig System.Windows.Forms.Func.Tests.runtimeconfig.json xunit.console.dll System.Windows.Forms.Func.Tests.dll -noautoreporters -xml System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.xml -html System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.html' + #CorrelationPayloadDirectory: '' + #XUnitProjects: '' + #XUnitTargetFramework: '' + #XUnitRunnerVersion: '' + IncludeDotNetCli: true + DotNetCliPackageType: 'sdk' + DotNetCliVersion: '3.0.100-preview-009764' + EnableXUnitReporter: true + WaitForWorkItemCompletion: true + condition: succeeded() + continueOnError: false \ No newline at end of file From 4b78c5ad04bb36d5a1db7c2d4980a170293e3607 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Fri, 7 Dec 2018 13:52:18 -0800 Subject: [PATCH 19/82] readd func tests proj to sln --- Winforms.sln | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Winforms.sln b/Winforms.sln index fa7df9b7be2..c603ecd70b5 100644 --- a/Winforms.sln +++ b/Winforms.sln @@ -39,6 +39,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{DF68A171 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "facade", "facade", "{434C00C3-E498-4BA7-9764-9F0FC8CFE457}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{583F1292-AE8D-4511-B8D8-A81FE4642DDC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "func", "func", "{680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Func.Tests", "src\System.Windows.Forms\tests\FuncTests\System.Windows.Forms.Func.Tests\System.Windows.Forms.Func.Tests.csproj", "{238195CE-7CCE-4469-ACD8-EA00E88D947A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -97,6 +103,10 @@ Global {9BEC2806-D8E0-443B-8B58-9D344E0C2D24}.Debug|Any CPU.Build.0 = Debug|Any CPU {9BEC2806-D8E0-443B-8B58-9D344E0C2D24}.Release|Any CPU.ActiveCfg = Release|Any CPU {9BEC2806-D8E0-443B-8B58-9D344E0C2D24}.Release|Any CPU.Build.0 = Release|Any CPU + {238195CE-7CCE-4469-ACD8-EA00E88D947A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {238195CE-7CCE-4469-ACD8-EA00E88D947A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {238195CE-7CCE-4469-ACD8-EA00E88D947A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {238195CE-7CCE-4469-ACD8-EA00E88D947A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -104,17 +114,20 @@ Global GlobalSection(NestedProjects) = preSolution {0D23A41B-2626-4703-9E4A-87C07F69B0B2} = {77FEDB47-F7F6-490D-AF7C-ABB4A9E0B9D7} {334C343B-9D39-498E-89D8-B6526028FD5C} = {D5951C9D-146A-4F80-9451-B7AED28254F1} - {AB38E262-F206-4820-8F29-23C5F72A4A16} = {DF68A171-D27B-4E6A-8A7E-63A651622355} - {657472B8-FDA3-49DF-B8BE-0246046A4348} = {DF68A171-D27B-4E6A-8A7E-63A651622355} + {AB38E262-F206-4820-8F29-23C5F72A4A16} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC} + {657472B8-FDA3-49DF-B8BE-0246046A4348} = {680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A} {F133342A-3040-4005-A2F0-7685AA7CB82D} = {989F376E-AE19-43B0-A3E6-96A7E22B4E80} {5A619DC4-854A-450E-8F9A-AC72D2F5B59A} = {D5951C9D-146A-4F80-9451-B7AED28254F1} {B50AC96F-2655-4687-A404-16DF51882CBC} = {77FEDB47-F7F6-490D-AF7C-ABB4A9E0B9D7} - {27F24D0C-5F0A-472E-AE12-98B386A13D50} = {DF68A171-D27B-4E6A-8A7E-63A651622355} - {F977CA8C-FBF9-4D82-80BA-FE5B2F33486E} = {DF68A171-D27B-4E6A-8A7E-63A651622355} + {27F24D0C-5F0A-472E-AE12-98B386A13D50} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC} + {F977CA8C-FBF9-4D82-80BA-FE5B2F33486E} = {583F1292-AE8D-4511-B8D8-A81FE4642DDC} {61D06BBD-B0CF-4CE1-9139-1CC4B82F0F9B} = {77FEDB47-F7F6-490D-AF7C-ABB4A9E0B9D7} {351EA462-BCB8-42E7-8595-A4FE55E3B25D} = {D5951C9D-146A-4F80-9451-B7AED28254F1} {A2B1148A-1747-47BD-8048-416C2C2AF14C} = {434C00C3-E498-4BA7-9764-9F0FC8CFE457} {9BEC2806-D8E0-443B-8B58-9D344E0C2D24} = {434C00C3-E498-4BA7-9764-9F0FC8CFE457} + {583F1292-AE8D-4511-B8D8-A81FE4642DDC} = {DF68A171-D27B-4E6A-8A7E-63A651622355} + {680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A} = {DF68A171-D27B-4E6A-8A7E-63A651622355} + {238195CE-7CCE-4469-ACD8-EA00E88D947A} = {680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7B1B0433-F612-4E5A-BE7E-FCF5B9F6E136} From 304a1814718ffdc5e13c0fac102767a8aa7deeb5 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Fri, 7 Dec 2018 16:35:29 -0600 Subject: [PATCH 20/82] Comment out func tests that are failing for now --- .../WinformsControlsTest.cs | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs index f6e4c39b6cc..b0904e1ccfe 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs @@ -54,20 +54,21 @@ public void WinformsControlsTest_CalendarTest() Assert.True(process.HasExited); } - [Fact] - public void WinformsControlsTest_TreeViewAndImageListTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 2); - TestHelpers.PressEnterOnProcess(process); + // [Fact] + // Commenting out until this gets fixed + // public void WinformsControlsTest_TreeViewAndImageListTest() + // { + // var process = TestHelpers.StartProcess(PathToTestFromBin); + // TestHelpers.PressTabsOnProcess(process, 2); + // TestHelpers.PressEnterOnProcess(process); - Assert.False(process.HasExited); + // Assert.False(process.HasExited); - process.Kill(); - process.WaitForExit(); + // process.Kill(); + // process.WaitForExit(); - Assert.True(process.HasExited); - } + // Assert.True(process.HasExited); + // } [Fact] public void WinformsControlsTest_ContentAlignmentTest() @@ -204,20 +205,21 @@ public void WinformsControlsTest_PropertyGridTest() Assert.True(process.HasExited); } - [Fact] - public void WinformsControlsTest_ListViewTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 12); - TestHelpers.PressEnterOnProcess(process); + // [Fact] + // Commenting this out until this is fixed + // public void WinformsControlsTest_ListViewTest() + // { + // var process = TestHelpers.StartProcess(PathToTestFromBin); + // TestHelpers.PressTabsOnProcess(process, 12); + // TestHelpers.PressEnterOnProcess(process); - Assert.False(process.HasExited); + // Assert.False(process.HasExited); - process.Kill(); - process.WaitForExit(); + // process.Kill(); + // process.WaitForExit(); - Assert.True(process.HasExited); - } + // Assert.True(process.HasExited); + // } [Fact] public void WinformsControlsTest_DateTimePickerTest() From 85302d73e63f551ef78098b370e213b9d338dc86 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Fri, 7 Dec 2018 16:39:05 -0600 Subject: [PATCH 21/82] change to agentPool that has agent running in interactive mode to support UI testing --- eng/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/ci.yml b/eng/ci.yml index 3678a715010..576c1418926 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -1,7 +1,7 @@ parameters: # Needed because agent pool can't be read from a user-defined variable (Azure DevOps limitation) - agentPool: dotnet-external-temp + agentPool: dotnet-external-temp-vs2017 # Needed because runAsPublic is used in template expressions, which can't read from user-defined variables runAsPublic: true From 6ac7fb777321cc29358e508da7dd39367704aa9a Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 15:24:10 -0600 Subject: [PATCH 22/82] re-enable unit tests on the machine and disable helix for now --- eng/ci.yml | 82 +++++++++++++++++++++--------------------- eng/common/CIBuild.cmd | 2 +- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 576c1418926..7e36bbfd199 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -107,44 +107,44 @@ jobs: $(_OfficialBuildIdArgs) displayName: Windows Build / Publish - # Copy files for helix job - - task: CopyFiles@2 - inputs: - sourceFolder: $(_WinformsControlsTestBinDir) - contents: '**' - targetFolder: $(_HelixStagingDir) - cleanTargetFolder: true - #overWrite: false # Optional - displayName: Copy winforms controls tests to helix staging dir - - task: CopyFiles@2 - inputs: - sourceFolder: $(_WinformsFuncTestBinDir) - contents: '**' - targetFolder: $(_HelixStagingDir) - overWrite: true - displayName: Copy xUnit func tests to helix staging dir - - - template: /eng/common/templates/steps/helix-publish.yml - parameters: - HelixSource: $(_HelixSource) - HelixType: ̓'tests/functional' - HelixTargetQueues: $(_HelixAgentPool) - # secret variable set in Azure DevOps build definition - # todo: when we go public, get this value from the Helix Anonymous variable group - # for internal builds, get this value from the DotNet-HelixApi-Access variable group - HelixAccessToken: $(helix-token) - #HelixPreCommands: '' - #HelixPostCommands: '' - WorkItemDirectory: $(_HelixStagingDir) - WorkItemCommand: 'dotnet.exe exec --depsfile System.Windows.Forms.Func.Tests.deps.json --runtimeconfig System.Windows.Forms.Func.Tests.runtimeconfig.json xunit.console.dll System.Windows.Forms.Func.Tests.dll -noautoreporters -xml System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.xml -html System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.html' - #CorrelationPayloadDirectory: '' - #XUnitProjects: '' - #XUnitTargetFramework: '' - #XUnitRunnerVersion: '' - IncludeDotNetCli: true - DotNetCliPackageType: 'sdk' - DotNetCliVersion: '3.0.100-preview-009764' - EnableXUnitReporter: true - WaitForWorkItemCompletion: true - condition: succeeded() - continueOnError: false \ No newline at end of file + # # Copy files for helix job + # - task: CopyFiles@2 + # inputs: + # sourceFolder: $(_WinformsControlsTestBinDir) + # contents: '**' + # targetFolder: $(_HelixStagingDir) + # cleanTargetFolder: true + # #overWrite: false # Optional + # displayName: Copy winforms controls tests to helix staging dir + # - task: CopyFiles@2 + # inputs: + # sourceFolder: $(_WinformsFuncTestBinDir) + # contents: '**' + # targetFolder: $(_HelixStagingDir) + # overWrite: true + # displayName: Copy xUnit func tests to helix staging dir + + # - template: /eng/common/templates/steps/helix-publish.yml + # parameters: + # HelixSource: $(_HelixSource) + # HelixType: ̓'tests/functional' + # HelixTargetQueues: $(_HelixAgentPool) + # # secret variable set in Azure DevOps build definition + # # todo: when we go public, get this value from the Helix Anonymous variable group + # # for internal builds, get this value from the DotNet-HelixApi-Access variable group + # HelixAccessToken: $(helix-token) + # #HelixPreCommands: '' + # #HelixPostCommands: '' + # WorkItemDirectory: $(_HelixStagingDir) + # WorkItemCommand: 'dotnet.exe exec --depsfile System.Windows.Forms.Func.Tests.deps.json --runtimeconfig System.Windows.Forms.Func.Tests.runtimeconfig.json xunit.console.dll System.Windows.Forms.Func.Tests.dll -noautoreporters -xml System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.xml -html System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.html' + # #CorrelationPayloadDirectory: '' + # #XUnitProjects: '' + # #XUnitTargetFramework: '' + # #XUnitRunnerVersion: '' + # IncludeDotNetCli: true + # DotNetCliPackageType: 'sdk' + # DotNetCliVersion: '3.0.100-preview-009764' + # EnableXUnitReporter: true + # WaitForWorkItemCompletion: true + # condition: succeeded() + # continueOnError: false \ No newline at end of file diff --git a/eng/common/CIBuild.cmd b/eng/common/CIBuild.cmd index b104bbf5996..6544b0cd54f 100644 --- a/eng/common/CIBuild.cmd +++ b/eng/common/CIBuild.cmd @@ -1,3 +1,3 @@ @echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -sign -pack -publish -ci %*" +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*" exit /b %ErrorLevel% From 7d9311239eacf06e621a3ac9242d85f3fd01ced0 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 15:51:22 -0600 Subject: [PATCH 23/82] initial try of unit tests through helix --- eng/ci.yml | 62 +++++++++++++++++++++--------------------- eng/common/CIBuild.cmd | 3 +- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 7e36bbfd199..ac206f6e501 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -1,7 +1,7 @@ parameters: # Needed because agent pool can't be read from a user-defined variable (Azure DevOps limitation) - agentPool: dotnet-external-temp-vs2017 + agentPool: dotnet-external-temp # Needed because runAsPublic is used in template expressions, which can't read from user-defined variables runAsPublic: true @@ -44,12 +44,12 @@ jobs: # needed for helix jobs - name: _HelixAgentPool value: 'Windows.10.Amd64.Open' - - name: _WinformsControlsTestBinDir - value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\WinformsControlsTest\$(_BuildConfig)\netcoreapp3.0 - - name: _WinformsFuncTestBinDir - value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\System.Windows.Forms.Func.Tests\$(_BuildConfig)\netcoreapp3.0 - - name: _HelixStagingDir - value: $(BUILD.STAGINGDIRECTORY)\helix\functests + # - name: _WinformsControlsTestBinDir + # value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\WinformsControlsTest\$(_BuildConfig)\netcoreapp3.0 + # - name: _WinformsFuncTestBinDir + # value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\System.Windows.Forms.Func.Tests\$(_BuildConfig)\netcoreapp3.0 + # - name: _HelixStagingDir + # value: $(BUILD.STAGINGDIRECTORY)\helix\functests # Override some values if we're building internally - ${{ if eq(parameters.runAsPublic, 'false') }}: @@ -124,27 +124,27 @@ jobs: # overWrite: true # displayName: Copy xUnit func tests to helix staging dir - # - template: /eng/common/templates/steps/helix-publish.yml - # parameters: - # HelixSource: $(_HelixSource) - # HelixType: ̓'tests/functional' - # HelixTargetQueues: $(_HelixAgentPool) - # # secret variable set in Azure DevOps build definition - # # todo: when we go public, get this value from the Helix Anonymous variable group - # # for internal builds, get this value from the DotNet-HelixApi-Access variable group - # HelixAccessToken: $(helix-token) - # #HelixPreCommands: '' - # #HelixPostCommands: '' - # WorkItemDirectory: $(_HelixStagingDir) - # WorkItemCommand: 'dotnet.exe exec --depsfile System.Windows.Forms.Func.Tests.deps.json --runtimeconfig System.Windows.Forms.Func.Tests.runtimeconfig.json xunit.console.dll System.Windows.Forms.Func.Tests.dll -noautoreporters -xml System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.xml -html System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.html' - # #CorrelationPayloadDirectory: '' - # #XUnitProjects: '' - # #XUnitTargetFramework: '' - # #XUnitRunnerVersion: '' - # IncludeDotNetCli: true - # DotNetCliPackageType: 'sdk' - # DotNetCliVersion: '3.0.100-preview-009764' - # EnableXUnitReporter: true - # WaitForWorkItemCompletion: true - # condition: succeeded() - # continueOnError: false \ No newline at end of file + - template: /eng/common/templates/steps/helix-publish.yml + parameters: + HelixSource: $(_HelixSource) + HelixType: ̓'tests/functional' + HelixTargetQueues: $(_HelixAgentPool) + # secret variable set in Azure DevOps build definition + # todo: when we go public, get this value from the Helix Anonymous variable group + # for internal builds, get this value from the DotNet-HelixApi-Access variable group + HelixAccessToken: $(helix-token) + #HelixPreCommands: '' + #HelixPostCommands: '' + WorkItemDirectory: #$(_HelixStagingDir) + WorkItemCommand: #'dotnet.exe exec --depsfile System.Windows.Forms.Func.Tests.deps.json --runtimeconfig System.Windows.Forms.Func.Tests.runtimeconfig.json xunit.console.dll System.Windows.Forms.Func.Tests.dll -noautoreporters -xml System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.xml -html System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.html' + #CorrelationPayloadDirectory: '' + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj' + #XUnitTargetFramework: '' + #XUnitRunnerVersion: '' + IncludeDotNetCli: true + DotNetCliPackageType: 'sdk' + #DotNetCliVersion: '3.0.100-preview-009764' + EnableXUnitReporter: true + WaitForWorkItemCompletion: true + condition: succeeded() + continueOnError: false \ No newline at end of file diff --git a/eng/common/CIBuild.cmd b/eng/common/CIBuild.cmd index 6544b0cd54f..9fe84a9857c 100644 --- a/eng/common/CIBuild.cmd +++ b/eng/common/CIBuild.cmd @@ -1,3 +1,4 @@ @echo off -powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -test -sign -pack -publish -ci %*" +:: TODO: Add -test after -build once we verify helix is working +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0Build.ps1""" -restore -build -sign -pack -publish -ci %*" exit /b %ErrorLevel% From 0b63f1895ab2b569e9038bea9e5ea6f1354a2fa6 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 16:06:16 -0600 Subject: [PATCH 24/82] specify a dotnet cli version to use on helix machines --- eng/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/ci.yml b/eng/ci.yml index ac206f6e501..cf1802d3dc5 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -143,7 +143,9 @@ jobs: #XUnitRunnerVersion: '' IncludeDotNetCli: true DotNetCliPackageType: 'sdk' - #DotNetCliVersion: '3.0.100-preview-009764' + # We build with '3.0.100-preview-009764' but Helix can't currently use non-publicly-released sdk versions + # TODO: Move our SDK version up to match this + DotNetCliVersion: '3.0.100-preview-009820' EnableXUnitReporter: true WaitForWorkItemCompletion: true condition: succeeded() From 999a2767f87b4beb9b08cc53af1560e511b093ac Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 16:07:48 -0600 Subject: [PATCH 25/82] specify a dotnet cli version to use on helix machines --- eng/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/ci.yml b/eng/ci.yml index cf1802d3dc5..4ecc2bc22dc 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -144,7 +144,7 @@ jobs: IncludeDotNetCli: true DotNetCliPackageType: 'sdk' # We build with '3.0.100-preview-009764' but Helix can't currently use non-publicly-released sdk versions - # TODO: Move our SDK version up to match this + # TODO: Move our SDK version up to match this, and remove this line afterwards DotNetCliVersion: '3.0.100-preview-009820' EnableXUnitReporter: true WaitForWorkItemCompletion: true From 5ccec956159d48ba8cf89f7bdf3f8fed40354e2c Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 16:20:27 -0600 Subject: [PATCH 26/82] Added helix sdk to global.json --- eng/Version.Details.xml | 4 ++++ eng/ci.yml | 2 +- global.json | 7 ++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7a787c17409..408687cfcb2 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,5 +6,9 @@ https://github.com/dotnet/arcade c3be73644108181b6c951c3ef8febd220a2a79f3 + + https://github.com/dotnet/arcade + 36310812bfac90c202486ea70b4617e9ce7aec04 + diff --git a/eng/ci.yml b/eng/ci.yml index 2b8f97ebf54..7bbfea20ea1 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -153,7 +153,7 @@ jobs: DotNetCliPackageType: 'sdk' # We build with '3.0.100-preview-009764' but Helix can't currently use non-publicly-released sdk versions # TODO: Move our SDK version up to match this, and remove this line afterwards - DotNetCliVersion: '3.0.100-preview-009820' + #DotNetCliVersion: '3.0.100-preview-009820' EnableXUnitReporter: true WaitForWorkItemCompletion: true condition: succeeded() diff --git a/global.json b/global.json index 4ef50bc2c2c..3bf26f7a639 100644 --- a/global.json +++ b/global.json @@ -1,11 +1,12 @@ { "tools": { - "dotnet": "3.0.100-preview-009784" + "dotnet": "3.0.100-preview-009820" }, "sdk": { - "version": "3.0.100-preview-009784" + "version": "3.0.100-preview-009820" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.18608.1" + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.18608.1", + "Microsoft.DotNet.Helix.Sdk": "1.0.0-beta.18578.9" } } From d76c67ece68584afefc93b851e4746e966df3a87 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 16:26:45 -0600 Subject: [PATCH 27/82] move sdk version back because of unrelated breaks --- global.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 3bf26f7a639..87654a93469 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "tools": { - "dotnet": "3.0.100-preview-009820" + "dotnet": "3.0.100-preview-009764" }, "sdk": { - "version": "3.0.100-preview-009820" + "version": "3.0.100-preview-009764" }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.18608.1", From ccb81de49bb6f3438fb757f7d6fb1e6afc4fc4c7 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 16:31:54 -0600 Subject: [PATCH 28/82] specify the dotnetcli version again --- eng/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/ci.yml b/eng/ci.yml index 7bbfea20ea1..2b8f97ebf54 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -153,7 +153,7 @@ jobs: DotNetCliPackageType: 'sdk' # We build with '3.0.100-preview-009764' but Helix can't currently use non-publicly-released sdk versions # TODO: Move our SDK version up to match this, and remove this line afterwards - #DotNetCliVersion: '3.0.100-preview-009820' + DotNetCliVersion: '3.0.100-preview-009820' EnableXUnitReporter: true WaitForWorkItemCompletion: true condition: succeeded() From bba1040869ccf017eb7b18e214d3a0af8dca4380 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 16:50:39 -0600 Subject: [PATCH 29/82] Revving dotnet sdk, fixing build errors --- eng/ci.yml | 3 --- global.json | 4 ++-- .../src/System/Windows/Forms/WinFormsSecurity.cs | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 2b8f97ebf54..bb913b78eec 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -151,9 +151,6 @@ jobs: #XUnitRunnerVersion: '' IncludeDotNetCli: true DotNetCliPackageType: 'sdk' - # We build with '3.0.100-preview-009764' but Helix can't currently use non-publicly-released sdk versions - # TODO: Move our SDK version up to match this, and remove this line afterwards - DotNetCliVersion: '3.0.100-preview-009820' EnableXUnitReporter: true WaitForWorkItemCompletion: true condition: succeeded() diff --git a/global.json b/global.json index 87654a93469..3bf26f7a639 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "tools": { - "dotnet": "3.0.100-preview-009764" + "dotnet": "3.0.100-preview-009820" }, "sdk": { - "version": "3.0.100-preview-009764" + "version": "3.0.100-preview-009820" }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.18608.1", diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/WinFormsSecurity.cs b/src/System.Windows.Forms/src/System/Windows/Forms/WinFormsSecurity.cs index c7b453a87ca..7e0287767b6 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/WinFormsSecurity.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/WinFormsSecurity.cs @@ -9,10 +9,11 @@ namespace System.Windows.Forms { using System.Diagnostics.CodeAnalysis; using System; using System.IO; - using System.Security.Permissions; + //using System.Security.Permissions; using System.Security; using System.Drawing.Printing; using System.Runtime.Versioning; + using System.Runtime; internal static class IntSecurity { public static readonly TraceSwitch SecurityDemand = new TraceSwitch("SecurityDemand", "Trace when security demands occur."); From e1de8c7d7c526b812cb1d3592251e78ba335b1a1 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 16:53:01 -0600 Subject: [PATCH 30/82] make helix sdk = arcade sdk --- global.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/global.json b/global.json index 3bf26f7a639..6a1bd51b9f7 100644 --- a/global.json +++ b/global.json @@ -1,12 +1,12 @@ { "tools": { - "dotnet": "3.0.100-preview-009820" + "dotnet": "3.0.100-preview-009764" }, "sdk": { - "version": "3.0.100-preview-009820" + "version": "3.0.100-preview-009764" }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.18608.1", - "Microsoft.DotNet.Helix.Sdk": "1.0.0-beta.18578.9" + "Microsoft.DotNet.Helix.Sdk": "1.0.0-beta.18608.1" } } From 5f0e35c17565bd96ed99d23aafea8299e92c25ae Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 16:53:40 -0600 Subject: [PATCH 31/82] saving for real this time --- eng/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/ci.yml b/eng/ci.yml index bb913b78eec..2b8f97ebf54 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -151,6 +151,9 @@ jobs: #XUnitRunnerVersion: '' IncludeDotNetCli: true DotNetCliPackageType: 'sdk' + # We build with '3.0.100-preview-009764' but Helix can't currently use non-publicly-released sdk versions + # TODO: Move our SDK version up to match this, and remove this line afterwards + DotNetCliVersion: '3.0.100-preview-009820' EnableXUnitReporter: true WaitForWorkItemCompletion: true condition: succeeded() From 86a55df38d2460fe74739ecba24e0616eed6a04b Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 16:58:04 -0600 Subject: [PATCH 32/82] revert sdk code fixes --- .../src/System/Windows/Forms/WinFormsSecurity.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/WinFormsSecurity.cs b/src/System.Windows.Forms/src/System/Windows/Forms/WinFormsSecurity.cs index 7e0287767b6..c7b453a87ca 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/WinFormsSecurity.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/WinFormsSecurity.cs @@ -9,11 +9,10 @@ namespace System.Windows.Forms { using System.Diagnostics.CodeAnalysis; using System; using System.IO; - //using System.Security.Permissions; + using System.Security.Permissions; using System.Security; using System.Drawing.Printing; using System.Runtime.Versioning; - using System.Runtime; internal static class IntSecurity { public static readonly TraceSwitch SecurityDemand = new TraceSwitch("SecurityDemand", "Trace when security demands occur."); From a4ad3c76ba68003f2d46c815df2e71c6b2468e23 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 17:29:21 -0600 Subject: [PATCH 33/82] use new and improved helix template --- eng/ci.yml | 23 ++++++++++---------- eng/common/templates/steps/send-to-helix.yml | 3 +-- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 2b8f97ebf54..ceb422a323c 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -132,30 +132,29 @@ jobs: # overWrite: true # displayName: Copy xUnit func tests to helix staging dir - - template: /eng/common/templates/steps/helix-publish.yml + - template: /eng/common/templates/steps/send-to-helix.yml parameters: - HelixSource: $(_HelixSource) - HelixType: ̓'tests/functional' - HelixTargetQueues: $(_HelixAgentPool) - # secret variable set in Azure DevOps build definition - # todo: when we go public, get this value from the Helix Anonymous variable group - # for internal builds, get this value from the DotNet-HelixApi-Access variable group - HelixAccessToken: $(helix-token) + HelixSource: $(_HelixSource) # required + HelixType: 'tests/default/' # required + #HelixBuild: $(Build.BuildNumber) # required + HelixTargetQueues: $(_HelixAgentPool) # required + HelixAccessToken: $(helix-token) # required #HelixPreCommands: '' #HelixPostCommands: '' - WorkItemDirectory: #$(_HelixStagingDir) - WorkItemCommand: #'dotnet.exe exec --depsfile System.Windows.Forms.Func.Tests.deps.json --runtimeconfig System.Windows.Forms.Func.Tests.runtimeconfig.json xunit.console.dll System.Windows.Forms.Func.Tests.dll -noautoreporters -xml System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.xml -html System.Windows.Forms.Func.Tests_netcoreapp3.0_x64.html' + #WorkItemDirectory: '' + #WorkItemCommand: '' #CorrelationPayloadDirectory: '' - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj' + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' #XUnitTargetFramework: '' #XUnitRunnerVersion: '' IncludeDotNetCli: true DotNetCliPackageType: 'sdk' # We build with '3.0.100-preview-009764' but Helix can't currently use non-publicly-released sdk versions - # TODO: Move our SDK version up to match this, and remove this line afterwards DotNetCliVersion: '3.0.100-preview-009820' EnableXUnitReporter: true WaitForWorkItemCompletion: true + IsExternal: false + #Creator: '' condition: succeeded() continueOnError: false diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml index d0622f3caf4..a8cefd22db4 100644 --- a/eng/common/templates/steps/send-to-helix.yml +++ b/eng/common/templates/steps/send-to-helix.yml @@ -23,8 +23,7 @@ parameters: continueOnError: false steps: - - script: '%BUILD_SOURCESDIRECTORY%\eng\common\msbuild.ps1 %BUILD_SOURCESDIRECTORY%\eng\common\helixpublish.proj /bl:%BUILD_SOURCESDIRECTORY%\artifacts\log\%BuildConfig%\SendToHelix.binlog' - displayName: Send job to Helix (Windows) + - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' displayName: Send job to Helix (Windows) env: BuildConfig: $(_BuildConfig) HelixSource: ${{ parameters.HelixSource }} From 3e90fcf681b5f002ab3977102f5859ec75f02885 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 17:32:31 -0600 Subject: [PATCH 34/82] fixing yaml syntax error --- eng/common/templates/steps/send-to-helix.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml index a8cefd22db4..a2e76c69deb 100644 --- a/eng/common/templates/steps/send-to-helix.yml +++ b/eng/common/templates/steps/send-to-helix.yml @@ -23,7 +23,8 @@ parameters: continueOnError: false steps: - - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' displayName: Send job to Helix (Windows) + - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' + displayName: Send job to Helix (Windows) env: BuildConfig: $(_BuildConfig) HelixSource: ${{ parameters.HelixSource }} From d534d8ffbae3e1a3fcf150ae2ab776e6f804affa Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 17:45:06 -0600 Subject: [PATCH 35/82] use proper public sdk version --- eng/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/ci.yml b/eng/ci.yml index ceb422a323c..9a68c9b9831 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -150,7 +150,7 @@ jobs: IncludeDotNetCli: true DotNetCliPackageType: 'sdk' # We build with '3.0.100-preview-009764' but Helix can't currently use non-publicly-released sdk versions - DotNetCliVersion: '3.0.100-preview-009820' + DotNetCliVersion: '3.0.100-preview-009812' EnableXUnitReporter: true WaitForWorkItemCompletion: true IsExternal: false From 548dd251cbf01d7f85f75968746f38ccb737e3c9 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Mon, 10 Dec 2018 17:50:19 -0600 Subject: [PATCH 36/82] specify xunit target framework to netcoreapp3.0 --- eng/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 9a68c9b9831..a40dd0f8668 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -145,11 +145,12 @@ jobs: #WorkItemCommand: '' #CorrelationPayloadDirectory: '' XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' - #XUnitTargetFramework: '' - #XUnitRunnerVersion: '' + XUnitTargetFramework: netcoreapp3.0 # this defaults to netcoreapp2.1, so this is required + #XUnitRunnerVersion: 2.4.1 # specify the version of xUnit runner you wish to use here IncludeDotNetCli: true DotNetCliPackageType: 'sdk' # We build with '3.0.100-preview-009764' but Helix can't currently use non-publicly-released sdk versions + # Note that the version you use here MUST be in the official releases at https://dotnet.microsoft.com/download/dotnet-core/3.0 DotNetCliVersion: '3.0.100-preview-009812' EnableXUnitReporter: true WaitForWorkItemCompletion: true From 1837a4c400cfb7fe12e0ca04a0bb2fe4e662e7db Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Tue, 11 Dec 2018 10:44:28 -0600 Subject: [PATCH 37/82] fixed typo --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 76a15297546..da0e0729eda 100644 --- a/global.json +++ b/global.json @@ -6,7 +6,7 @@ "version": "3.0.100-preview-009820" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.18610.4" + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.18610.4", "Microsoft.DotNet.Helix.Sdk": "1.0.0-beta.18610.4" } } From 7ac7875668f180a174896b4f538eb96ec69d1048 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Tue, 11 Dec 2018 14:54:50 -0600 Subject: [PATCH 38/82] manually consume new arcade helix template because the arcade build is currently broken --- eng/ci.yml | 24 +++++++------------- eng/common/templates/steps/send-to-helix.yml | 11 +++++---- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index a40dd0f8668..cd9269440e9 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -134,28 +134,20 @@ jobs: - template: /eng/common/templates/steps/send-to-helix.yml parameters: - HelixSource: $(_HelixSource) # required - HelixType: 'tests/default/' # required - #HelixBuild: $(Build.BuildNumber) # required - HelixTargetQueues: $(_HelixAgentPool) # required - HelixAccessToken: $(helix-token) # required - #HelixPreCommands: '' - #HelixPostCommands: '' - #WorkItemDirectory: '' - #WorkItemCommand: '' - #CorrelationPayloadDirectory: '' + HelixSource: $(_HelixSource) + HelixTargetQueues: $(_HelixAgentPool) + HelixAccessToken: $(helix-token) XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' - XUnitTargetFramework: netcoreapp3.0 # this defaults to netcoreapp2.1, so this is required - #XUnitRunnerVersion: 2.4.1 # specify the version of xUnit runner you wish to use here + XUnitPublishTargetFramework: netcoreapp3.0 + #XUnitRuntimeTargetFramework: netcoreapp3.0 IncludeDotNetCli: true DotNetCliPackageType: 'sdk' - # We build with '3.0.100-preview-009764' but Helix can't currently use non-publicly-released sdk versions - # Note that the version you use here MUST be in the official releases at https://dotnet.microsoft.com/download/dotnet-core/3.0 + # This version MUST be in the official releases at https://dotnet.microsoft.com/download/dotnet-core/3.0 + # and does not necessarily match the internal dot net sdk we build against DotNetCliVersion: '3.0.100-preview-009812' - EnableXUnitReporter: true + #EnableXUnitReporter: true WaitForWorkItemCompletion: true IsExternal: false - #Creator: '' condition: succeeded() continueOnError: false diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml index a2e76c69deb..596368c51b0 100644 --- a/eng/common/templates/steps/send-to-helix.yml +++ b/eng/common/templates/steps/send-to-helix.yml @@ -10,7 +10,8 @@ parameters: WorkItemCommand: '' CorrelationPayloadDirectory: '' XUnitProjects: '' - XUnitTargetFramework: '' + XUnitPublishTargetFramework: '' + XUnitRuntimeTargetFramework: '' XUnitRunnerVersion: '' IncludeDotNetCli: false DotNetCliPackageType: '' @@ -38,7 +39,8 @@ steps: WorkItemCommand: ${{ parameters.WorkItemCommand }} CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} XUnitProjects: ${{ parameters.XUnitProjects }} - XUnitTargetFramework: ${{ parameters.XUnitTargetFramework }} + XUnitPublishTargetFramework: ${{ parameters.XUnitPublishTargetFramework }} + XUnitRuntimeTargetFramework: ${{ parameters.XUnitRuntimeTargetFramework }} XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }} IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} @@ -64,7 +66,8 @@ steps: WorkItemCommand: ${{ parameters.WorkItemCommand }} CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} XUnitProjects: ${{ parameters.XUnitProjects }} - XUnitTargetFramework: ${{ parameters.XUnitTargetFramework }} + XUnitPublishTargetFramework: ${{ parameters.XUnitPublishTargetFramework }} + XUnitRuntimeTargetFramework: ${{ parameters.XUnitRuntimeTargetFramework }} XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }} IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} @@ -74,4 +77,4 @@ steps: IsExternal: ${{ parameters.IsExternal }} Creator: ${{ parameters.Creator }} condition: and(${{ parameters.condition }}, ne(variables['Agent.Os'], 'Windows_NT')) - continueOnError: ${{ parameters.continueOnError }} + continueOnError: ${{ parameters.continueOnError }} \ No newline at end of file From 0aa3dc564c1c7cee058f4ff46f28855a145d03e7 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Tue, 11 Dec 2018 15:30:59 -0600 Subject: [PATCH 39/82] use win8 helix pools because win10 pools aren't ready for us yet --- eng/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index cd9269440e9..adb5685ed2d 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -44,8 +44,10 @@ jobs: value: '' # needed for helix jobs + # The win10 pool isn't ready for us yet, so using 8.1 in the meantime + # When ready, change value to 'Windows.10.Amd64.Open' - name: _HelixAgentPool - value: 'Windows.10.Amd64.Open' + value: 'Windows.81.Amd64.Open' # - name: _WinformsControlsTestBinDir # value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\WinformsControlsTest\$(_BuildConfig)\netcoreapp3.0 # - name: _WinformsFuncTestBinDir @@ -82,8 +84,10 @@ jobs: - name: _OfficialBuildIdArgs value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) + # The win10 pool isn't ready for us yet, so using 8.1 in the meantime + # When ready, change value to 'Windows.10.Amd64' - name: _HelixAgentPool - value: 'Windows.10.Amd64' + value: 'Windows.81.Amd64' strategy: matrix: From 2f62ee5e1da5c0b0339052fd8256fb058bbdfe66 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 11 Dec 2018 14:04:42 -0800 Subject: [PATCH 40/82] hopefully a fix for the different build versions --- .../IFunctionalPathTest.cs | 9 ++++ .../WinformsControlsTest.cs | 47 ++++++++++++------- 2 files changed, 39 insertions(+), 17 deletions(-) create mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/IFunctionalPathTest.cs diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/IFunctionalPathTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/IFunctionalPathTest.cs new file mode 100644 index 00000000000..be64fd4d35c --- /dev/null +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/IFunctionalPathTest.cs @@ -0,0 +1,9 @@ +using System; + +namespace System.Windows.Forms.Func.Tests +{ + public interface IFunctionalPathTest + { + string GetPathToTestFromBin(); + } +} \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs index b0904e1ccfe..7dc28918e1c 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs @@ -1,18 +1,31 @@ using System; using System.Diagnostics; using Xunit; +using Xunit.Abstractions; namespace System.Windows.Forms.Func.Tests { - public class WinformsControlsTestTests + + + public class WinformsControlsTestTests : IFunctionalPathTest { - public const string PathToTestFromBin = "WinformsControlsTest\\Debug\\netcoreapp3.0\\WinformsControlsTest.exe"; + public string GetPathToTestFromBin() + { + string buildType = "Release"; + + #if DEBUG + buildType = "Debug"; + #endif + + return "WinformsControlsTest\\" + buildType + "\\netcoreapp3.0\\WinformsControlsTest.exe"; + } [Fact] public void WinformsControlsTest_OpenAndClose() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); Assert.NotNull(process); Assert.NotNull(Process.GetProcessById(process.Id)); @@ -27,7 +40,7 @@ public void WinformsControlsTest_OpenAndClose() [Fact] public void WinformsControlsTest_ButtonsTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressEnterOnProcess(process); @@ -42,7 +55,7 @@ public void WinformsControlsTest_ButtonsTest() [Fact] public void WinformsControlsTest_CalendarTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressTabsOnProcess(process, 1); TestHelpers.PressEnterOnProcess(process); @@ -58,7 +71,7 @@ public void WinformsControlsTest_CalendarTest() // Commenting out until this gets fixed // public void WinformsControlsTest_TreeViewAndImageListTest() // { - // var process = TestHelpers.StartProcess(PathToTestFromBin); + // var process = TestHelpers.StartProcess(GetPathToTestFromBin()); // TestHelpers.PressTabsOnProcess(process, 2); // TestHelpers.PressEnterOnProcess(process); @@ -73,7 +86,7 @@ public void WinformsControlsTest_CalendarTest() [Fact] public void WinformsControlsTest_ContentAlignmentTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressTabsOnProcess(process, 3); TestHelpers.PressEnterOnProcess(process); @@ -88,7 +101,7 @@ public void WinformsControlsTest_ContentAlignmentTest() [Fact] public void WinformsControlsTest_MultipleControlsTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressTabsOnProcess(process, 4); TestHelpers.PressEnterOnProcess(process); @@ -103,7 +116,7 @@ public void WinformsControlsTest_MultipleControlsTest() [Fact] public void WinformsControlsTest_DataGridViewTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressTabsOnProcess(process, 5); TestHelpers.PressEnterOnProcess(process); @@ -118,7 +131,7 @@ public void WinformsControlsTest_DataGridViewTest() [Fact] public void WinformsControlsTest_MenusTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressTabsOnProcess(process, 6); TestHelpers.PressEnterOnProcess(process); @@ -133,7 +146,7 @@ public void WinformsControlsTest_MenusTest() [Fact] public void WinformsControlsTest_PanelsTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressTabsOnProcess(process, 7); TestHelpers.PressEnterOnProcess(process); @@ -148,7 +161,7 @@ public void WinformsControlsTest_PanelsTest() [Fact] public void WinformsControlsTest_SplitterTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressTabsOnProcess(process, 8); TestHelpers.PressEnterOnProcess(process); @@ -163,7 +176,7 @@ public void WinformsControlsTest_SplitterTest() [Fact] public void WinformsControlsTest_ComboBoxesTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressTabsOnProcess(process, 9); TestHelpers.PressEnterOnProcess(process); @@ -178,7 +191,7 @@ public void WinformsControlsTest_ComboBoxesTest() [Fact] public void WinformsControlsTest_MDIParentTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressTabsOnProcess(process, 10); TestHelpers.PressEnterOnProcess(process); @@ -193,7 +206,7 @@ public void WinformsControlsTest_MDIParentTest() [Fact] public void WinformsControlsTest_PropertyGridTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressTabsOnProcess(process, 11); TestHelpers.PressEnterOnProcess(process); @@ -209,7 +222,7 @@ public void WinformsControlsTest_PropertyGridTest() // Commenting this out until this is fixed // public void WinformsControlsTest_ListViewTest() // { - // var process = TestHelpers.StartProcess(PathToTestFromBin); + // var process = TestHelpers.StartProcess(GetPathToTestFromBin()); // TestHelpers.PressTabsOnProcess(process, 12); // TestHelpers.PressEnterOnProcess(process); @@ -224,7 +237,7 @@ public void WinformsControlsTest_PropertyGridTest() [Fact] public void WinformsControlsTest_DateTimePickerTest() { - var process = TestHelpers.StartProcess(PathToTestFromBin); + var process = TestHelpers.StartProcess(GetPathToTestFromBin()); TestHelpers.PressTabsOnProcess(process, 13); TestHelpers.PressEnterOnProcess(process); From b33b41b64e23b922437f43664861dd13f8cbc003 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 11 Dec 2018 14:05:26 -0800 Subject: [PATCH 41/82] Revert "hopefully a fix for the different build versions" This reverts commit 2f62ee5e1da5c0b0339052fd8256fb058bbdfe66. --- .../IFunctionalPathTest.cs | 9 ---- .../WinformsControlsTest.cs | 47 +++++++------------ 2 files changed, 17 insertions(+), 39 deletions(-) delete mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/IFunctionalPathTest.cs diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/IFunctionalPathTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/IFunctionalPathTest.cs deleted file mode 100644 index be64fd4d35c..00000000000 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/IFunctionalPathTest.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace System.Windows.Forms.Func.Tests -{ - public interface IFunctionalPathTest - { - string GetPathToTestFromBin(); - } -} \ No newline at end of file diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs index 7dc28918e1c..b0904e1ccfe 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs @@ -1,31 +1,18 @@ using System; using System.Diagnostics; using Xunit; -using Xunit.Abstractions; namespace System.Windows.Forms.Func.Tests { - - - public class WinformsControlsTestTests : IFunctionalPathTest + public class WinformsControlsTestTests { - public string GetPathToTestFromBin() - { - string buildType = "Release"; - - #if DEBUG - buildType = "Debug"; - #endif - - return "WinformsControlsTest\\" + buildType + "\\netcoreapp3.0\\WinformsControlsTest.exe"; - } + public const string PathToTestFromBin = "WinformsControlsTest\\Debug\\netcoreapp3.0\\WinformsControlsTest.exe"; [Fact] public void WinformsControlsTest_OpenAndClose() { - - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); Assert.NotNull(process); Assert.NotNull(Process.GetProcessById(process.Id)); @@ -40,7 +27,7 @@ public void WinformsControlsTest_OpenAndClose() [Fact] public void WinformsControlsTest_ButtonsTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressEnterOnProcess(process); @@ -55,7 +42,7 @@ public void WinformsControlsTest_ButtonsTest() [Fact] public void WinformsControlsTest_CalendarTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressTabsOnProcess(process, 1); TestHelpers.PressEnterOnProcess(process); @@ -71,7 +58,7 @@ public void WinformsControlsTest_CalendarTest() // Commenting out until this gets fixed // public void WinformsControlsTest_TreeViewAndImageListTest() // { - // var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + // var process = TestHelpers.StartProcess(PathToTestFromBin); // TestHelpers.PressTabsOnProcess(process, 2); // TestHelpers.PressEnterOnProcess(process); @@ -86,7 +73,7 @@ public void WinformsControlsTest_CalendarTest() [Fact] public void WinformsControlsTest_ContentAlignmentTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressTabsOnProcess(process, 3); TestHelpers.PressEnterOnProcess(process); @@ -101,7 +88,7 @@ public void WinformsControlsTest_ContentAlignmentTest() [Fact] public void WinformsControlsTest_MultipleControlsTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressTabsOnProcess(process, 4); TestHelpers.PressEnterOnProcess(process); @@ -116,7 +103,7 @@ public void WinformsControlsTest_MultipleControlsTest() [Fact] public void WinformsControlsTest_DataGridViewTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressTabsOnProcess(process, 5); TestHelpers.PressEnterOnProcess(process); @@ -131,7 +118,7 @@ public void WinformsControlsTest_DataGridViewTest() [Fact] public void WinformsControlsTest_MenusTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressTabsOnProcess(process, 6); TestHelpers.PressEnterOnProcess(process); @@ -146,7 +133,7 @@ public void WinformsControlsTest_MenusTest() [Fact] public void WinformsControlsTest_PanelsTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressTabsOnProcess(process, 7); TestHelpers.PressEnterOnProcess(process); @@ -161,7 +148,7 @@ public void WinformsControlsTest_PanelsTest() [Fact] public void WinformsControlsTest_SplitterTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressTabsOnProcess(process, 8); TestHelpers.PressEnterOnProcess(process); @@ -176,7 +163,7 @@ public void WinformsControlsTest_SplitterTest() [Fact] public void WinformsControlsTest_ComboBoxesTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressTabsOnProcess(process, 9); TestHelpers.PressEnterOnProcess(process); @@ -191,7 +178,7 @@ public void WinformsControlsTest_ComboBoxesTest() [Fact] public void WinformsControlsTest_MDIParentTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressTabsOnProcess(process, 10); TestHelpers.PressEnterOnProcess(process); @@ -206,7 +193,7 @@ public void WinformsControlsTest_MDIParentTest() [Fact] public void WinformsControlsTest_PropertyGridTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressTabsOnProcess(process, 11); TestHelpers.PressEnterOnProcess(process); @@ -222,7 +209,7 @@ public void WinformsControlsTest_PropertyGridTest() // Commenting this out until this is fixed // public void WinformsControlsTest_ListViewTest() // { - // var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + // var process = TestHelpers.StartProcess(PathToTestFromBin); // TestHelpers.PressTabsOnProcess(process, 12); // TestHelpers.PressEnterOnProcess(process); @@ -237,7 +224,7 @@ public void WinformsControlsTest_PropertyGridTest() [Fact] public void WinformsControlsTest_DateTimePickerTest() { - var process = TestHelpers.StartProcess(GetPathToTestFromBin()); + var process = TestHelpers.StartProcess(PathToTestFromBin); TestHelpers.PressTabsOnProcess(process, 13); TestHelpers.PressEnterOnProcess(process); From 5df31146f4fd431a0a3447b6cf4f3775dc769c37 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Wed, 12 Dec 2018 10:36:58 -0600 Subject: [PATCH 42/82] really merged from master --- eng/common/templates/steps/send-to-helix.yml | 26 -------------------- 1 file changed, 26 deletions(-) diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml index 4e77c5e81fe..4b31b5e3b69 100644 --- a/eng/common/templates/steps/send-to-helix.yml +++ b/eng/common/templates/steps/send-to-helix.yml @@ -1,29 +1,4 @@ parameters: -<<<<<<< HEAD - HelixSource: 'pr/default' # required - HelixType: 'tests/default/' # required - HelixBuild: $(Build.BuildNumber) # required - HelixTargetQueues: '' # required - HelixAccessToken: '' # required - HelixPreCommands: '' - HelixPostCommands: '' - WorkItemDirectory: '' - WorkItemCommand: '' - CorrelationPayloadDirectory: '' - XUnitProjects: '' - XUnitPublishTargetFramework: '' - XUnitRuntimeTargetFramework: '' - XUnitRunnerVersion: '' - IncludeDotNetCli: false - DotNetCliPackageType: '' - DotNetCliVersion: '' - EnableXUnitReporter: false - WaitForWorkItemCompletion: true - IsExternal: false - Creator: '' - condition: succeeded() - continueOnError: false -======= HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number @@ -47,7 +22,6 @@ parameters: Creator: '' # optional -- if the build is external, use this to specify who is sending the job condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false ->>>>>>> master steps: - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' From fdb412e9dd67229b6a797de242ad9a7b3c6b69e5 Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Wed, 12 Dec 2018 10:41:57 -0600 Subject: [PATCH 43/82] fixed arcade sdk version --- global.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/global.json b/global.json index 0e4d05d483a..96b3da0c975 100644 --- a/global.json +++ b/global.json @@ -6,7 +6,7 @@ "version": "3.0.100-preview-009820" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.18611.4", - "Microsoft.DotNet.Helix.Sdk": "1.0.0-beta.18611.4" + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.18611.14", + "Microsoft.DotNet.Helix.Sdk": "1.0.0-beta.18611.14" } -} +} \ No newline at end of file From 08ef95a7099654aed662cda94e49b1220003b1bb Mon Sep 17 00:00:00 2001 From: Adam Yoblick Date: Wed, 12 Dec 2018 14:34:33 -0600 Subject: [PATCH 44/82] fix xunit runtime framework version --- eng/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index adb5685ed2d..3ec9f08c7ab 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -142,8 +142,10 @@ jobs: HelixTargetQueues: $(_HelixAgentPool) HelixAccessToken: $(helix-token) XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' + # This needs to be whatever tfm will work for our test projects for `dotnet publish` XUnitPublishTargetFramework: netcoreapp3.0 - #XUnitRuntimeTargetFramework: netcoreapp3.0 + # This controls what tfm to pick from the xunit package, it must exist in that package or the helix job will fail + XUnitRuntimeTargetFramework: netcoreapp2.0 IncludeDotNetCli: true DotNetCliPackageType: 'sdk' # This version MUST be in the official releases at https://dotnet.microsoft.com/download/dotnet-core/3.0 @@ -151,12 +153,12 @@ jobs: DotNetCliVersion: '3.0.100-preview-009812' #EnableXUnitReporter: true WaitForWorkItemCompletion: true - IsExternal: false + #IsExternal: false condition: succeeded() continueOnError: false # Publish the nuget package as a build artifact - # Only do this if the build is internal AND the config is released (this ensures package contents are real signed) + # Only do this if the build is internal AND the config is 'Release' (this ensures package contents are real signed) - ${{ if eq(parameters.runAsPublic, 'false') }}: - task: PublishPipelineArtifact@0 inputs: From 617ff2e278cc02984469ec4f79b7f49c4ed28269 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 14:05:48 -0800 Subject: [PATCH 45/82] xunit versions --- eng/Versions.props | 1 + eng/ci.yml | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 269a5acd812..7db79a7d81f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -27,6 +27,7 @@ 4.6.0-alpha-27122-5 + 2.4.1 0.3.5 4.10.0 1.0.0 diff --git a/eng/ci.yml b/eng/ci.yml index 39296ad7ad0..5cf86166868 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -113,6 +113,8 @@ jobs: - template: /eng/common/templates/steps/send-to-helix.yml parameters: HelixSource: $(_HelixSource) + HelixType: 'tests/default/' + HelixBuild: $(Build.BuildNumber) HelixTargetQueues: $(_HelixAgentPool) HelixAccessToken: $(helix-token) XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' @@ -120,6 +122,8 @@ jobs: XUnitPublishTargetFramework: netcoreapp3.0 # This controls what tfm to pick from the xunit package, it must exist in that package or the helix job will fail XUnitRuntimeTargetFramework: netcoreapp2.0 + # Should match XUnitRunnerConsoleVersion in eng/Versions.props + XUnitRunnerVersion: '2.4.1' IncludeDotNetCli: true DotNetCliPackageType: 'sdk' # This version MUST be in the official releases (build apps - SDK) at https://dotnet.microsoft.com/download/dotnet-core/3.0 @@ -127,7 +131,6 @@ jobs: DotNetCliVersion: '3.0.100-preview-010184' #EnableXUnitReporter: true WaitForWorkItemCompletion: true - #IsExternal: false condition: succeeded() continueOnError: false From f77b2fea9cf59d508dbc031d41366b54012a87b8 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 14:22:24 -0800 Subject: [PATCH 46/82] broke sln --- Winforms.sln | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Winforms.sln b/Winforms.sln index aff0db881a7..98ec4359cae 100644 --- a/Winforms.sln +++ b/Winforms.sln @@ -115,8 +115,6 @@ Global {238195CE-7CCE-4469-ACD8-EA00E88D947A}.Debug|Any CPU.Build.0 = Debug|Any CPU {238195CE-7CCE-4469-ACD8-EA00E88D947A}.Release|Any CPU.ActiveCfg = Release|Any CPU {238195CE-7CCE-4469-ACD8-EA00E88D947A}.Release|Any CPU.Build.0 = Release|Any CPU -<<<<<<< HEAD -======= {F1B0790A-1A40-4487-A607-36D21D827E44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F1B0790A-1A40-4487-A607-36D21D827E44}.Debug|Any CPU.Build.0 = Debug|Any CPU {F1B0790A-1A40-4487-A607-36D21D827E44}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -125,7 +123,6 @@ Global {3603561D-907D-494B-9E3C-29D7001018F6}.Debug|Any CPU.Build.0 = Debug|Any CPU {3603561D-907D-494B-9E3C-29D7001018F6}.Release|Any CPU.ActiveCfg = Release|Any CPU {3603561D-907D-494B-9E3C-29D7001018F6}.Release|Any CPU.Build.0 = Release|Any CPU ->>>>>>> master EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -147,11 +144,8 @@ Global {583F1292-AE8D-4511-B8D8-A81FE4642DDC} = {DF68A171-D27B-4E6A-8A7E-63A651622355} {680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A} = {DF68A171-D27B-4E6A-8A7E-63A651622355} {238195CE-7CCE-4469-ACD8-EA00E88D947A} = {680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A} -<<<<<<< HEAD -======= {F1B0790A-1A40-4487-A607-36D21D827E44} = {434C00C3-E498-4BA7-9764-9F0FC8CFE457} {3603561D-907D-494B-9E3C-29D7001018F6} = {DF68A171-D27B-4E6A-8A7E-63A651622355} ->>>>>>> master EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7B1B0433-F612-4E5A-BE7E-FCF5B9F6E136} From 058f73c588ed458ef41671b55b2a43393390afae Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 14:37:43 -0800 Subject: [PATCH 47/82] headers required --- .../System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs | 6 +++++- .../System.Windows.Forms.Func.Tests/TestHelpers.cs | 6 +++++- .../System.Windows.Forms.Func.Tests/WinformsControlsTest.cs | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs index d2c066a422e..661d0b477ea 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs @@ -1,4 +1,8 @@ -using System.Runtime.InteropServices; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Runtime.InteropServices; namespace System.Windows.Forms.Func.Tests { diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs index dca955473c3..50cf3de970a 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs @@ -1,4 +1,8 @@ -using System.Diagnostics; +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Diagnostics; using System.Threading; using System.IO; using System.Reflection; diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs index b0904e1ccfe..c017375e341 100644 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs +++ b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs @@ -1,3 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + using System; using System.Diagnostics; using Xunit; From f164c96abe436606e20ba9f8e797d09cb207e06c Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 14:52:06 -0800 Subject: [PATCH 48/82] helix token only for internal --- eng/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 5cf86166868..51a71260424 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -50,8 +50,10 @@ jobs: value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\System.Windows.Forms.Func.Tests\$(_BuildConfig)\netcoreapp3.0 - name: _HelixStagingDir value: $(BUILD.STAGINGDIRECTORY)\helix\functests + - name: _HelixToken + value: '' - # Override some values if we're building internally + # Override some values if we're building internally (not public) - ${{ if eq(parameters.runAsPublic, 'false') }}: # note: You have to use list syntax here (-name: value) or you will get errors about declaring the same variable multiple times @@ -84,6 +86,8 @@ jobs: # When ready, change value to 'Windows.10.Amd64' - name: _HelixAgentPool value: 'Windows.10.Amd64' + - name: _HelixToken + value: '$(helix-token)' strategy: matrix: @@ -116,7 +120,7 @@ jobs: HelixType: 'tests/default/' HelixBuild: $(Build.BuildNumber) HelixTargetQueues: $(_HelixAgentPool) - HelixAccessToken: $(helix-token) + HelixAccessToken: $(_HelixToken) XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' # This needs to be whatever tfm will work for our test projects for `dotnet publish` XUnitPublishTargetFramework: netcoreapp3.0 From 37808b311288b1d4f90753f56db579a577505c63 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 15:02:26 -0800 Subject: [PATCH 49/82] require Creator --- eng/ci.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 51a71260424..33240f3e86d 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -121,18 +121,14 @@ jobs: HelixBuild: $(Build.BuildNumber) HelixTargetQueues: $(_HelixAgentPool) HelixAccessToken: $(_HelixToken) + Creator: $(helixRepo) # for external (no access token) XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' - # This needs to be whatever tfm will work for our test projects for `dotnet publish` - XUnitPublishTargetFramework: netcoreapp3.0 - # This controls what tfm to pick from the xunit package, it must exist in that package or the helix job will fail - XUnitRuntimeTargetFramework: netcoreapp2.0 - # Should match XUnitRunnerConsoleVersion in eng/Versions.props - XUnitRunnerVersion: '2.4.1' + XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` + XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail + XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props IncludeDotNetCli: true DotNetCliPackageType: 'sdk' - # This version MUST be in the official releases (build apps - SDK) at https://dotnet.microsoft.com/download/dotnet-core/3.0 - # and does not necessarily match the internal dot net sdk we build against - DotNetCliVersion: '3.0.100-preview-010184' + DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against #EnableXUnitReporter: true WaitForWorkItemCompletion: true condition: succeeded() From b210d440e41be9b6037d7c622224051e829f8e94 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 15:18:19 -0800 Subject: [PATCH 50/82] remove doubel source, this explains the need for headers earlier, also helixRepo needs to be available earlier --- Winforms.sln | 2 - eng/ci.yml | 20 +- .../ExternalTestHelpers.cs | 27 -- .../System.Windows.Forms.Func.Tests.csproj | 18 -- .../TestHelpers.cs | 248 ------------------ .../WinformsControlsTest.cs | 243 ----------------- 6 files changed, 9 insertions(+), 549 deletions(-) delete mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs delete mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/System.Windows.Forms.Func.Tests.csproj delete mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs delete mode 100644 src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs diff --git a/Winforms.sln b/Winforms.sln index 98ec4359cae..f3234917b32 100644 --- a/Winforms.sln +++ b/Winforms.sln @@ -43,8 +43,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{583F1292-A EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "func", "func", "{680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Func.Tests", "src\System.Windows.Forms\tests\FuncTests\System.Windows.Forms.Func.Tests\System.Windows.Forms.Func.Tests.csproj", "{238195CE-7CCE-4469-ACD8-EA00E88D947A}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "integration", "integration", "{680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.IntegrationTests", "src\System.Windows.Forms\tests\IntegrationTests\System.Windows.Forms.IntegrationTests\System.Windows.Forms.IntegrationTests.csproj", "{238195CE-7CCE-4469-ACD8-EA00E88D947A}" diff --git a/eng/ci.yml b/eng/ci.yml index 33240f3e86d..7d5a3751570 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -1,8 +1,8 @@ parameters: - # Needed because agent pool can't be read from a user-defined variable (Azure DevOps limitation) - agentPool: dotnet-external-temp-vs2019 - # Needed because runAsPublic is used in template expressions, which can't read from user-defined variables - runAsPublic: true + # This section is required because agent pool can't be read from a user-defined variable (Azure DevOps limitation) + agentPool: dotnet-external-temp-vs2019 + runAsPublic: true + repoName: dotnet/winforms jobs: - template: /eng/common/templates/jobs/jobs.yml @@ -13,7 +13,6 @@ jobs: enablePublishTestResults: true enablePublishBuildAssets: true enableTelemetry: true - helixRepo: dotnet/winforms jobs: - job: Windows_NT @@ -68,9 +67,8 @@ jobs: - name: _PublishBlobFeedUrl value: https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json - # note: Even though they are referenced here, user defined variables (like $(_SignType)) are not resolved - # until the agent is running on the machine. They can be overridden any time before they are resolved, - # like in the job matrix below (see Build_Debug) + # note: Even though they are referenced here, user defined variables (like $(_SignType)) are not resolved until the agent + # is running on the machine. They can be overridden any time before they are resolved, like in the job matrix below (see Build_Debug) - name: _SignArgs value: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName) /p:Sign=$(_Sign) - name: _PublishArgs @@ -116,12 +114,12 @@ jobs: # Run unit tests on Helix - template: /eng/common/templates/steps/send-to-helix.yml parameters: - HelixSource: $(_HelixSource) + HelixSource: $(repoName) HelixType: 'tests/default/' HelixBuild: $(Build.BuildNumber) HelixTargetQueues: $(_HelixAgentPool) - HelixAccessToken: $(_HelixToken) - Creator: $(helixRepo) # for external (no access token) + HelixAccessToken: $(_HelixToken) # only defined for internal CI + Creator: $(repoName) # required for public / external (when there is no access token) XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs deleted file mode 100644 index 661d0b477ea..00000000000 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/ExternalTestHelpers.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.InteropServices; - -namespace System.Windows.Forms.Func.Tests -{ - public class ExternalTestHelpers - { - [DllImport("User32.dll")] - static extern int SetForegroundWindow(IntPtr point); - - [DllImport("User32.dll")] - static extern IntPtr GetForegroundWindow(); - - public static int TrySetForegroundWindow(IntPtr point) - { - return SetForegroundWindow(point); - } - - public static IntPtr TryGetForegroundWindow() - { - return GetForegroundWindow(); - } - } -} diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/System.Windows.Forms.Func.Tests.csproj b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/System.Windows.Forms.Func.Tests.csproj deleted file mode 100644 index 66a0132e833..00000000000 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/System.Windows.Forms.Func.Tests.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netcoreapp3.0 - - false - - - - - - - - - - - - diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs deleted file mode 100644 index 50cf3de970a..00000000000 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/TestHelpers.cs +++ /dev/null @@ -1,248 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; -using System.Threading; -using System.IO; -using System.Reflection; - -namespace System.Windows.Forms.Func.Tests -{ - public class TestHelpers - { - - /// - /// Calls StartProcess for the ProcessStartInfo containing the bin path of this directory plus the given byPathFromBinToExe; also ensures that repo\.dotnet\dotnet.exe exists - /// - /// The string path to add onto the end of the bin path in order to reach the exe to run; trimed for tailing \'s - /// - /// - /// - /// - /// Throws ArgumentException if string byPathFromBin is null - /// The new Process - public static Process StartProcess(string byPathFromBinToExe) - { - if(byPathFromBinToExe == null) - { - throw new ArgumentNullException(nameof(byPathFromBinToExe)); - } - - if (!byPathFromBinToExe.EndsWith(".exe", StringComparison.CurrentCultureIgnoreCase)) - { - throw new ArgumentException(nameof(byPathFromBinToExe) + " must end in a .exe"); - } - - var dotnetPath = DotNetPath(); - if (!Directory.Exists(dotnetPath)) - { - throw new DirectoryNotFoundException(dotnetPath + " directory cannot be found."); - } - - ProcessStartInfo startInfo = new ProcessStartInfo(); - startInfo.FileName = Path.Combine(BinPath(), byPathFromBinToExe.Trim('\\')); - startInfo.EnvironmentVariables["DOTNET_ROOT"] = dotnetPath; - // ... - - return StartProcess(startInfo); - } - - /// - /// Calls Process.Start() on the given ProcessStartInfo; waits 500 ms - /// - /// The info with which to start the process - /// - /// - /// Throws ArgumentException if ProcessStartInfo info is null - /// The new Process - public static Process StartProcess(ProcessStartInfo info) - { - Process process = new Process(); - - process.StartInfo = info ?? throw new ArgumentException(nameof(info) + " must not be null."); - process.Start(); - - Thread.Sleep(500); - - return process; - } - - /// - /// Returns the bin directory of this project on a given machine - /// - /// Returns the entire path of this project if the bin is not part of it - /// The bin path as a string; example: example:\Project\bin\ - public static string BinPath() - { - return RelativePathForwardTo("bin"); - } - - - public static string DotNetPath() - { - return RelativePathBackwardsUntilFind(".dotnet"); - } - - /// - /// Returns the stop directory of this project on a given machine - /// - /// The string to stop at in the path; compared all lower - /// - /// - /// - /// Returns the entire path of this project if the stop is not part of it - /// The path as a string; example: example:\Project\bin\ given "bin" if bin is present in the path - public static string RelativePathForwardTo(string stop) - { - if(string.IsNullOrEmpty(stop)) - { - throw new ArgumentException(nameof(stop) + " must not be null or empty."); - } - - string ret = string.Empty; - var path = AppDomain.CurrentDomain.BaseDirectory; - var pathParts = path.Split(Path.DirectorySeparatorChar); - uint i = 0; - while (i < pathParts.Length) - { - ret = Path.Combine(ret, pathParts[i]); - if (pathParts[i].Equals(stop, StringComparison.CurrentCultureIgnoreCase)) - { - break; - } - i++; - } - return ret; - } - - /// - /// Looks backwards form the current executing directory until it finds a sibling directory seek, then returns the full path of that sibling - /// - /// The sibling directory to look for - /// - /// - /// - /// - /// - /// - /// The full path of the first sibling directory by the current executing directory, away from the root - public static string RelativePathBackwardsUntilFind(string seek) - { - if (string.IsNullOrEmpty(seek)) - { - throw new ArgumentNullException(nameof(seek)); - } - - var codeBaseUrl = new Uri(Assembly.GetExecutingAssembly().CodeBase); - var codeBasePath = Uri.UnescapeDataString(codeBaseUrl.AbsolutePath); - var currentDirectory = Path.GetDirectoryName(codeBasePath); - var root = Directory.GetDirectoryRoot(currentDirectory); - while (!currentDirectory.Equals(root, StringComparison.CurrentCultureIgnoreCase)) - { - if (Directory.GetDirectories(currentDirectory, seek, SearchOption.TopDirectoryOnly).Length == 1) - { - var ret = Path.Combine(currentDirectory, seek); - return ret; - } - currentDirectory = Directory.GetParent(currentDirectory).FullName; - } - throw new Exception("no " + nameof(seek) + " sibling folder was found"); - } - - /// - /// Presses Enter on the given process if it can be made the foreground process - /// - /// The process to send the Enter key to - /// Whether or not the Enter key was pressed on the process - /// - public static bool PressEnterOnProcess(Process process) - { - return PressOnProcess(process, "~"); - } - - /// - /// Presses Tab on the given process if it can be made the foreground process - /// - /// The process to send the Tab key to - /// Whether or not the Tab key was pressed on the process - /// - public static bool PressTabOnProcess(Process process) - { - return PressOnProcess(process, "{TAB}"); - } - - /// - /// Presses Tab any number of times on the given process if it can be made the foreground process - /// - /// The process to send the Tab key(s) to - /// The number of times to press tab in a row - /// Throws an ArgumentException if number of times is zero; this is unlikely to be intended. - /// Whether or not the Tab key(s) were pressed on the process - /// - public static bool PressTabsOnProcess(Process process, uint times) - { - if (times == 0) - { - throw new ArgumentException(nameof(times) + " may not be zero."); - } - - string keys = ""; - for (uint i = 0; i < times; i++) - { - keys += "{TAB}"; - } - return PressOnProcess(process, keys); - } - - /// - /// Presses the given keys on the given process, then waits 200ms - /// - /// The process to send the key(s) to - /// The key(s) to send to the process - /// Throws an ArgumentException if the process is null or has exited. - /// Throws an ArgumentException if the given key(s) is null or the empty string. - /// Whether or not the key(s) were pressed on the process - /// - /// - /// - /// - /// - internal static bool PressOnProcess(Process process, string keys) - { - if (null == process) - { - throw new ArgumentException(nameof(process) + " must not be null."); - } - - if (process.HasExited) - { - throw new ArgumentException(nameof(process) + " must not have exited."); - } - - if (string.IsNullOrEmpty(keys)) - { - throw new ArgumentException(nameof(keys) + " must not be null or empty."); - } - - var handle = process.MainWindowHandle; - ExternalTestHelpers.TrySetForegroundWindow(handle); - - if (handle.Equals(ExternalTestHelpers.TryGetForegroundWindow())) - { - SendKeys.SendWait(keys); - - Thread.Sleep(200); - - return true; - } - else - { - Debug.Assert(true, "Given process could not be made to be the ForegroundWindow"); - - return false; - } - } - - } -} diff --git a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs b/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs deleted file mode 100644 index c017375e341..00000000000 --- a/src/System.Windows.Forms/tests/functests/System.Windows.Forms.Func.Tests/WinformsControlsTest.cs +++ /dev/null @@ -1,243 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Diagnostics; -using Xunit; - -namespace System.Windows.Forms.Func.Tests -{ - public class WinformsControlsTestTests - { - - public const string PathToTestFromBin = "WinformsControlsTest\\Debug\\netcoreapp3.0\\WinformsControlsTest.exe"; - - [Fact] - public void WinformsControlsTest_OpenAndClose() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - - Assert.NotNull(process); - Assert.NotNull(Process.GetProcessById(process.Id)); - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_ButtonsTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_CalendarTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 1); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - // [Fact] - // Commenting out until this gets fixed - // public void WinformsControlsTest_TreeViewAndImageListTest() - // { - // var process = TestHelpers.StartProcess(PathToTestFromBin); - // TestHelpers.PressTabsOnProcess(process, 2); - // TestHelpers.PressEnterOnProcess(process); - - // Assert.False(process.HasExited); - - // process.Kill(); - // process.WaitForExit(); - - // Assert.True(process.HasExited); - // } - - [Fact] - public void WinformsControlsTest_ContentAlignmentTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 3); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_MultipleControlsTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 4); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_DataGridViewTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 5); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_MenusTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 6); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_PanelsTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 7); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_SplitterTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 8); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_ComboBoxesTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 9); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_MDIParentTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 10); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - [Fact] - public void WinformsControlsTest_PropertyGridTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 11); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - - // [Fact] - // Commenting this out until this is fixed - // public void WinformsControlsTest_ListViewTest() - // { - // var process = TestHelpers.StartProcess(PathToTestFromBin); - // TestHelpers.PressTabsOnProcess(process, 12); - // TestHelpers.PressEnterOnProcess(process); - - // Assert.False(process.HasExited); - - // process.Kill(); - // process.WaitForExit(); - - // Assert.True(process.HasExited); - // } - - [Fact] - public void WinformsControlsTest_DateTimePickerTest() - { - var process = TestHelpers.StartProcess(PathToTestFromBin); - TestHelpers.PressTabsOnProcess(process, 13); - TestHelpers.PressEnterOnProcess(process); - - Assert.False(process.HasExited); - - process.Kill(); - process.WaitForExit(); - - Assert.True(process.HasExited); - } - } -} From 7b54cfd4a62bff82740743ef81e1b188895abd71 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 15:19:39 -0800 Subject: [PATCH 51/82] need helixRepo --- eng/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/ci.yml b/eng/ci.yml index 7d5a3751570..a15f6459efe 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -13,6 +13,7 @@ jobs: enablePublishTestResults: true enablePublishBuildAssets: true enableTelemetry: true + helixRepo: $(repoName) jobs: - job: Windows_NT From 51df9f5d1856dcdaeb15f8ae83e77b02107ddf60 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 15:32:32 -0800 Subject: [PATCH 52/82] displayName --- eng/ci.yml | 5 +- eng/common/templates/steps/send-to-helix.yml | 53 ++++++++++---------- 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index a15f6459efe..3b3b38084c2 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -43,7 +43,7 @@ jobs: # needed for helix jobs - name: _HelixAgentPool - value: 'Windows.10.Amd64.Open' + value: 'Windows.81.Amd64.Open' - name: _WinformsControlsTestBinDir value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\WinformsControlsTest\$(_BuildConfig)\netcoreapp3.0 - name: _WinformsFuncTestBinDir @@ -84,7 +84,7 @@ jobs: # The win10 pool isn't ready for us yet, so using Windows.81.Amd64 in the meantime # When ready, change value to 'Windows.10.Amd64' - name: _HelixAgentPool - value: 'Windows.10.Amd64' + value: 'Windows.81.Amd64' - name: _HelixToken value: '$(helix-token)' @@ -130,6 +130,7 @@ jobs: DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against #EnableXUnitReporter: true WaitForWorkItemCompletion: true + DisplayNamePrefix: 'Send Unit Tests to Helix' condition: succeeded() continueOnError: false diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml index 1fbf8b88973..5d750a04997 100644 --- a/eng/common/templates/steps/send-to-helix.yml +++ b/eng/common/templates/steps/send-to-helix.yml @@ -1,32 +1,33 @@ parameters: - HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ - HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' - HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number - HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/api/2018-03-14/info/queues for a list of queues - HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group - HelixPreCommands: '' # optional -- commands to run before Helix work item execution - HelixPostCommands: '' # optional -- commands to run after Helix work item execution - WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects - WorkItemCommand: '' # optional -- a command to execute on the payload; requires WorkItemDirectory; incompatible with XUnitProjects - WorkItemTimeout: '' # optional -- a timeout in seconds for the work item command; requires WorkItemDirectory; incompatible with XUnitProjects - CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload - XUnitProjects: '' # optional -- semicolon delimited list of XUnitProjects to parse and send to Helix; requires XUnitRuntimeTargetFramework, XUnitPublishTargetFramework, XUnitRunnerVersion, and IncludeDotNetCli=true - XUnitPublishTargetFramework: '' # optional -- framework to use to publish your xUnit projects - XUnitRuntimeTargetFramework: '' # optional -- framework to use for the xUnit console runner - XUnitRunnerVersion: '' # optional -- version of the xUnit nuget package you wish to use on Helix; required for XUnitProjects - IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion - DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json - DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json - EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control - WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." - IsExternal: false # [DEPRECATED] -- doesn't do anything, jobs are external if HelixAccessToken is empty and Creator is set - Creator: '' # optional -- if the build is external, use this to specify who is sending the job - condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() - continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false + HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ + HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' + HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number + HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/api/2018-03-14/info/queues for a list of queues + HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group + HelixPreCommands: '' # optional -- commands to run before Helix work item execution + HelixPostCommands: '' # optional -- commands to run after Helix work item execution + WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects + WorkItemCommand: '' # optional -- a command to execute on the payload; requires WorkItemDirectory; incompatible with XUnitProjects + WorkItemTimeout: '' # optional -- a timeout in seconds for the work item command; requires WorkItemDirectory; incompatible with XUnitProjects + CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload + XUnitProjects: '' # optional -- semicolon delimited list of XUnitProjects to parse and send to Helix; requires XUnitRuntimeTargetFramework, XUnitPublishTargetFramework, XUnitRunnerVersion, and IncludeDotNetCli=true + XUnitPublishTargetFramework: '' # optional -- framework to use to publish your xUnit projects + XUnitRuntimeTargetFramework: '' # optional -- framework to use for the xUnit console runner + XUnitRunnerVersion: '' # optional -- version of the xUnit nuget package you wish to use on Helix; required for XUnitProjects + IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion + DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control + WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." + IsExternal: false # [DEPRECATED] -- doesn't do anything, jobs are external if HelixAccessToken is empty and Creator is set + Creator: '' # optional -- if the build is external, use this to specify who is sending the job + DisplayNamePrefix: 'Send job to Helix' # optional -- rename the beginning of the displayName of the steps in AzDO + condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() + continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false steps: - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj /restore /t:Test /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' - displayName: Send job to Helix (Windows) + displayName: $(DisplayNamePrefix) (Windows) env: BuildConfig: $(_BuildConfig) HelixSource: ${{ parameters.HelixSource }} @@ -53,7 +54,7 @@ steps: condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) continueOnError: ${{ parameters.continueOnError }} - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/helixpublish.proj /restore /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog - displayName: Send job to Helix (Unix) + displayName: $(DisplayNamePrefix) (Unix) env: BuildConfig: $(_BuildConfig) HelixSource: ${{ parameters.HelixSource }} From e1cf65b1c1fa916fb375cbf10315c513c1bda5ce Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 15:36:23 -0800 Subject: [PATCH 53/82] parameters --- eng/ci.yml | 2 +- eng/common/templates/steps/send-to-helix.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 3b3b38084c2..9f6ef45d246 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -115,7 +115,7 @@ jobs: # Run unit tests on Helix - template: /eng/common/templates/steps/send-to-helix.yml parameters: - HelixSource: $(repoName) + HelixSource: ${{ parameters.repoName }} HelixType: 'tests/default/' HelixBuild: $(Build.BuildNumber) HelixTargetQueues: $(_HelixAgentPool) diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml index 5d750a04997..38e14381872 100644 --- a/eng/common/templates/steps/send-to-helix.yml +++ b/eng/common/templates/steps/send-to-helix.yml @@ -27,7 +27,7 @@ parameters: steps: - powershell: 'powershell "$env:BUILD_SOURCESDIRECTORY\eng\common\msbuild.ps1 $env:BUILD_SOURCESDIRECTORY\eng\common\helixpublish.proj /restore /t:Test /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\$env:BuildConfig\SendToHelix.binlog"' - displayName: $(DisplayNamePrefix) (Windows) + displayName: ${{ parameters.DisplayNamePrefix }} (Windows) env: BuildConfig: $(_BuildConfig) HelixSource: ${{ parameters.HelixSource }} @@ -54,7 +54,7 @@ steps: condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) continueOnError: ${{ parameters.continueOnError }} - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/helixpublish.proj /restore /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog - displayName: $(DisplayNamePrefix) (Unix) + displayName: ${{ parameters.DisplayNamePrefix }} (Unix) env: BuildConfig: $(_BuildConfig) HelixSource: ${{ parameters.HelixSource }} From 6afb86abb48070732e6a8b19620fbce8d55614d0 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 15:51:33 -0800 Subject: [PATCH 54/82] parameterization --- eng/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/ci.yml b/eng/ci.yml index 9f6ef45d246..b8a81d347ec 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -120,7 +120,7 @@ jobs: HelixBuild: $(Build.BuildNumber) HelixTargetQueues: $(_HelixAgentPool) HelixAccessToken: $(_HelixToken) # only defined for internal CI - Creator: $(repoName) # required for public / external (when there is no access token) + Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail From 566bea60a52e3bc33f014bcfdf16d1e24079b197 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 15:57:03 -0800 Subject: [PATCH 55/82] back to 10? --- eng/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index b8a81d347ec..d79e25f83af 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -43,7 +43,7 @@ jobs: # needed for helix jobs - name: _HelixAgentPool - value: 'Windows.81.Amd64.Open' + value: 'Windows.10.Amd64.Open' - name: _WinformsControlsTestBinDir value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\WinformsControlsTest\$(_BuildConfig)\netcoreapp3.0 - name: _WinformsFuncTestBinDir @@ -84,7 +84,7 @@ jobs: # The win10 pool isn't ready for us yet, so using Windows.81.Amd64 in the meantime # When ready, change value to 'Windows.10.Amd64' - name: _HelixAgentPool - value: 'Windows.81.Amd64' + value: 'Windows.10.Amd64' - name: _HelixToken value: '$(helix-token)' @@ -121,7 +121,7 @@ jobs: HelixTargetQueues: $(_HelixAgentPool) HelixAccessToken: $(_HelixToken) # only defined for internal CI Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' # **/*.Tests.csproj XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props From c10e9fe63df97c390f0eed50a55b788bc26a4deb Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 16:12:18 -0800 Subject: [PATCH 56/82] try to wildcard all the tests --- eng/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index d79e25f83af..e57eb9f517b 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -81,8 +81,7 @@ jobs: - name: _OfficialBuildIdArgs value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) - # The win10 pool isn't ready for us yet, so using Windows.81.Amd64 in the meantime - # When ready, change value to 'Windows.10.Amd64' + # Windows.81.Amd64 will fail on Debug.Assert in TryGetSystemMetricsForDpi in UnsafeNativeMethods - name: _HelixAgentPool value: 'Windows.10.Amd64' - name: _HelixToken @@ -121,7 +120,7 @@ jobs: HelixTargetQueues: $(_HelixAgentPool) HelixAccessToken: $(_HelixToken) # only defined for internal CI Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj' # **/*.Tests.csproj + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/**/*.Tests.csproj' # System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props From 6264dfe36949950ac02c05342b1b3232338d36f3 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 16:30:24 -0800 Subject: [PATCH 57/82] fix folder structure of System.Windows.Forms.Design to match other binaries --- Winforms.sln | 2 +- eng/ci.yml | 5 +++-- .../System.Windows.Forms.Design.Tests.csproj | 15 --------------- .../tests/{ => UnitTests}/ControlDesignerTests.cs | 0 .../{ => UnitTests}/Mocks/MockControlDesigner.cs | 0 .../System.Windows.Forms.Design.Tests.csproj | 15 +++++++++++++++ .../Drawing/Design/ToolboxItemCollectionTests.cs | 0 .../System/Drawing/Design/ToolboxItemTests.cs | 0 8 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 src/System.Windows.Forms.Design/tests/System.Windows.Forms.Design.Tests.csproj rename src/System.Windows.Forms.Design/tests/{ => UnitTests}/ControlDesignerTests.cs (100%) rename src/System.Windows.Forms.Design/tests/{ => UnitTests}/Mocks/MockControlDesigner.cs (100%) create mode 100644 src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj rename src/System.Windows.Forms.Design/tests/{ => UnitTests}/System/Drawing/Design/ToolboxItemCollectionTests.cs (100%) rename src/System.Windows.Forms.Design/tests/{ => UnitTests}/System/Drawing/Design/ToolboxItemTests.cs (100%) diff --git a/Winforms.sln b/Winforms.sln index f3234917b32..7312ae3db8d 100644 --- a/Winforms.sln +++ b/Winforms.sln @@ -19,7 +19,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Design EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Design.Editors.Tests", "src\System.Windows.Forms.Design.Editors\tests\UnitTests\System.Windows.Forms.Design.Editors.Tests.csproj", "{27F24D0C-5F0A-472E-AE12-98B386A13D50}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Design.Tests", "src\System.Windows.Forms.Design\tests\System.Windows.Forms.Design.Tests.csproj", "{F977CA8C-FBF9-4D82-80BA-FE5B2F33486E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Design.Tests", "src\System.Windows.Forms.Design\tests\UnitTests\System.Windows.Forms.Design.Tests.csproj", "{F977CA8C-FBF9-4D82-80BA-FE5B2F33486E}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Design", "src\System.Windows.Forms.Design\src\System.Windows.Forms.Design.csproj", "{61D06BBD-B0CF-4CE1-9139-1CC4B82F0F9B}" EndProject diff --git a/eng/ci.yml b/eng/ci.yml index e57eb9f517b..c560624f433 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -115,12 +115,13 @@ jobs: - template: /eng/common/templates/steps/send-to-helix.yml parameters: HelixSource: ${{ parameters.repoName }} - HelixType: 'tests/default/' + HelixType: 'tests/default' HelixBuild: $(Build.BuildNumber) HelixTargetQueues: $(_HelixAgentPool) HelixAccessToken: $(_HelixToken) # only defined for internal CI Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/**/*.Tests.csproj' # System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj + # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj' XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props diff --git a/src/System.Windows.Forms.Design/tests/System.Windows.Forms.Design.Tests.csproj b/src/System.Windows.Forms.Design/tests/System.Windows.Forms.Design.Tests.csproj deleted file mode 100644 index 59a07a863ae..00000000000 --- a/src/System.Windows.Forms.Design/tests/System.Windows.Forms.Design.Tests.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - System.Windows.Forms.Design.Tests - netcoreapp3.0 - 7.3 - - - - - - - - - diff --git a/src/System.Windows.Forms.Design/tests/ControlDesignerTests.cs b/src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs similarity index 100% rename from src/System.Windows.Forms.Design/tests/ControlDesignerTests.cs rename to src/System.Windows.Forms.Design/tests/UnitTests/ControlDesignerTests.cs diff --git a/src/System.Windows.Forms.Design/tests/Mocks/MockControlDesigner.cs b/src/System.Windows.Forms.Design/tests/UnitTests/Mocks/MockControlDesigner.cs similarity index 100% rename from src/System.Windows.Forms.Design/tests/Mocks/MockControlDesigner.cs rename to src/System.Windows.Forms.Design/tests/UnitTests/Mocks/MockControlDesigner.cs diff --git a/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj b/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj new file mode 100644 index 00000000000..c7a9241902a --- /dev/null +++ b/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj @@ -0,0 +1,15 @@ + + + + System.Windows.Forms.Design.Tests + netcoreapp3.0 + 7.3 + + + + + + + + + diff --git a/src/System.Windows.Forms.Design/tests/System/Drawing/Design/ToolboxItemCollectionTests.cs b/src/System.Windows.Forms.Design/tests/UnitTests/System/Drawing/Design/ToolboxItemCollectionTests.cs similarity index 100% rename from src/System.Windows.Forms.Design/tests/System/Drawing/Design/ToolboxItemCollectionTests.cs rename to src/System.Windows.Forms.Design/tests/UnitTests/System/Drawing/Design/ToolboxItemCollectionTests.cs diff --git a/src/System.Windows.Forms.Design/tests/System/Drawing/Design/ToolboxItemTests.cs b/src/System.Windows.Forms.Design/tests/UnitTests/System/Drawing/Design/ToolboxItemTests.cs similarity index 100% rename from src/System.Windows.Forms.Design/tests/System/Drawing/Design/ToolboxItemTests.cs rename to src/System.Windows.Forms.Design/tests/UnitTests/System/Drawing/Design/ToolboxItemTests.cs From de315ffc3e53b739fed4db134318e01ff2c0b84f Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 16:30:47 -0800 Subject: [PATCH 58/82] Enable XUnitReporter --- eng/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/ci.yml b/eng/ci.yml index c560624f433..0bf1e338eae 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -128,7 +128,7 @@ jobs: IncludeDotNetCli: true DotNetCliPackageType: 'sdk' DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against - #EnableXUnitReporter: true + EnableXUnitReporter: true WaitForWorkItemCompletion: true DisplayNamePrefix: 'Send Unit Tests to Helix' condition: succeeded() From fd5eebe681c3855a6d868a8b09c7e409e999cb4e Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 16:39:10 -0800 Subject: [PATCH 59/82] let me make sure about this --- eng/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 0bf1e338eae..f7ba008a44c 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -120,8 +120,8 @@ jobs: HelixTargetQueues: $(_HelixAgentPool) HelixAccessToken: $(_HelixToken) # only defined for internal CI Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) - # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj' + # Should be $(BUILD.SOURCESDIRECTOR)/System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed + XUnitProjects: '$(BUILD.SOURCESDIRECTOR)/System.Windows.Forms/src/**/*.Tests.csproj' #'$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj' XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props From a07c03ef12fe34ea2be0512ca545c6b8e42a556d Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 16:41:40 -0800 Subject: [PATCH 60/82] / --- eng/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/ci.yml b/eng/ci.yml index f7ba008a44c..3f4c30f3b07 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -121,7 +121,7 @@ jobs: HelixAccessToken: $(_HelixToken) # only defined for internal CI Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) # Should be $(BUILD.SOURCESDIRECTOR)/System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed - XUnitProjects: '$(BUILD.SOURCESDIRECTOR)/System.Windows.Forms/src/**/*.Tests.csproj' #'$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj' + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj' XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props From ba4c5f15e4000d16fa985c3359bb1fac98c818a9 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 16:48:22 -0800 Subject: [PATCH 61/82] whack not slack --- eng/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/ci.yml b/eng/ci.yml index 3f4c30f3b07..bbf6cc25c39 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -121,7 +121,7 @@ jobs: HelixAccessToken: $(_HelixToken) # only defined for internal CI Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) # Should be $(BUILD.SOURCESDIRECTOR)/System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj' + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\System.Windows.Forms.Design\tests\UnitTests\System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\System.Windows.Forms.Design.Editors\tests\UnitTests\System.Windows.Forms.Design.Editors.Tests.csproj' XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props From f97d3f15b2c9a139de1cc2c08639b8e5fd846409 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Mon, 4 Mar 2019 16:52:52 -0800 Subject: [PATCH 62/82] src --- eng/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index bbf6cc25c39..5ed6b89be5f 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -120,8 +120,8 @@ jobs: HelixTargetQueues: $(_HelixAgentPool) HelixAccessToken: $(_HelixToken) # only defined for internal CI Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) - # Should be $(BUILD.SOURCESDIRECTOR)/System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\System.Windows.Forms.Design\tests\UnitTests\System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\System.Windows.Forms.Design.Editors\tests\UnitTests\System.Windows.Forms.Design.Editors.Tests.csproj' + # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj' XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props From 9cdcfabc3417cbe0f661c8eae3bda0cf3bd72395 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 5 Mar 2019 09:19:24 -0800 Subject: [PATCH 63/82] try this --- eng/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/ci.yml b/eng/ci.yml index 5ed6b89be5f..aec0168f4d1 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -138,6 +138,7 @@ jobs: - script: eng\cibuild.cmd -configuration $(_BuildConfig) $(_OfficialBuildIdArgs) + -test -integrationTest /bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\IntegrationTest.binlog displayName: Run Integration Tests From 90496639a558e984304312f06389b78c3804a880 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 5 Mar 2019 09:49:55 -0800 Subject: [PATCH 64/82] include moq and stafact in all of these --- .../System.Windows.Forms.Design.Editors.Tests.csproj | 1 + .../tests/UnitTests/System.Windows.Forms.Design.Tests.csproj | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj b/src/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj index 66182c1e0eb..cfc914f9f80 100644 --- a/src/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj +++ b/src/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj @@ -6,6 +6,7 @@ + diff --git a/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj b/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj index c7a9241902a..72fa43c115d 100644 --- a/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj +++ b/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj @@ -6,6 +6,11 @@ 7.3 + + + + + From bcaacdb62018fb82fe6c95705ac7cd2265267f86 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 5 Mar 2019 12:14:10 -0800 Subject: [PATCH 65/82] SYSTEM_ACCESSTOKEN --- eng/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/ci.yml b/eng/ci.yml index aec0168f4d1..680445680fc 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -52,6 +52,9 @@ jobs: value: $(BUILD.STAGINGDIRECTORY)\helix\functests - name: _HelixToken value: '' + - name: SYSTEM_ACCESSTOKEN + value: $(System.AccessToken) # sets EnableAzurePipelinesReporter to true by default + # Override some values if we're building internally (not public) - ${{ if eq(parameters.runAsPublic, 'false') }}: From dac6d40feda5586626fc37f4eae181edc88d139b Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 5 Mar 2019 13:18:36 -0800 Subject: [PATCH 66/82] make changes to send-to-helix matching arcade#2171 --- eng/ci.yml | 2 -- eng/common/templates/steps/send-to-helix.yml | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 680445680fc..08a161ea491 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -52,8 +52,6 @@ jobs: value: $(BUILD.STAGINGDIRECTORY)\helix\functests - name: _HelixToken value: '' - - name: SYSTEM_ACCESSTOKEN - value: $(System.AccessToken) # sets EnableAzurePipelinesReporter to true by default # Override some values if we're building internally (not public) diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml index 38e14381872..992c2106632 100644 --- a/eng/common/templates/steps/send-to-helix.yml +++ b/eng/common/templates/steps/send-to-helix.yml @@ -51,6 +51,7 @@ steps: EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }} WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} Creator: ${{ parameters.Creator }} + SYSTEM_ACCESSTOKEN: $(System.AccessToken) condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) continueOnError: ${{ parameters.continueOnError }} - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/helixpublish.proj /restore /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog @@ -78,5 +79,6 @@ steps: EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }} WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} Creator: ${{ parameters.Creator }} + SYSTEM_ACCESSTOKEN: $(System.AccessToken) condition: and(${{ parameters.condition }}, ne(variables['Agent.Os'], 'Windows_NT')) continueOnError: ${{ parameters.continueOnError }} From 43ead2d81f3f89a72dccab844a565489efbc2476 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 5 Mar 2019 13:31:32 -0800 Subject: [PATCH 67/82] get rid of func folder dup; add integration tests helix call --- Winforms.sln | 2 -- eng/ci.yml | 26 ++++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Winforms.sln b/Winforms.sln index 7312ae3db8d..5708e244097 100644 --- a/Winforms.sln +++ b/Winforms.sln @@ -41,8 +41,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "facade", "facade", "{434C00 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unit", "unit", "{583F1292-AE8D-4511-B8D8-A81FE4642DDC}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "func", "func", "{680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "integration", "integration", "{680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.IntegrationTests", "src\System.Windows.Forms\tests\IntegrationTests\System.Windows.Forms.IntegrationTests\System.Windows.Forms.IntegrationTests.csproj", "{238195CE-7CCE-4469-ACD8-EA00E88D947A}" diff --git a/eng/ci.yml b/eng/ci.yml index 08a161ea491..ee428713bc2 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -131,15 +131,37 @@ jobs: DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against EnableXUnitReporter: true WaitForWorkItemCompletion: true - DisplayNamePrefix: 'Send Unit Tests to Helix' + DisplayNamePrefix: 'Run Unit Tests on Helix' condition: succeeded() continueOnError: false + # Run unit tests on Helix + - template: /eng/common/templates/steps/send-to-helix.yml + parameters: + HelixSource: ${{ parameters.repoName }} + HelixType: 'tests/default' + HelixBuild: $(Build.BuildNumber) + HelixTargetQueues: $(_HelixAgentPool) + HelixAccessToken: $(_HelixToken) # only defined for internal CI + Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) + # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj' + XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` + XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail + XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props + IncludeDotNetCli: true + DotNetCliPackageType: 'sdk' + DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against + EnableXUnitReporter: true + WaitForWorkItemCompletion: true + DisplayNamePrefix: 'Run Integration Tests on Helix' + condition: succeeded() + continueOnError: false + # Run integration tests and rename binlog - script: eng\cibuild.cmd -configuration $(_BuildConfig) $(_OfficialBuildIdArgs) - -test -integrationTest /bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\IntegrationTest.binlog displayName: Run Integration Tests From b0e73c01cafdeec50bfed1514be69ee6556b9cc6 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 5 Mar 2019 13:42:35 -0800 Subject: [PATCH 68/82] remove set of environment variable DOTNET_PATH from TestHelpers --- .../System.Windows.Forms.IntegrationTests/TestHelpers.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs index efa922880ae..c2d3fb6fd48 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs @@ -34,15 +34,8 @@ public static Process StartProcess(string byPathFromBinToExe) throw new ArgumentException(nameof(byPathFromBinToExe) + " must end in a .exe"); } - var dotnetPath = DotNetPath(); - if (!Directory.Exists(dotnetPath)) - { - throw new DirectoryNotFoundException(dotnetPath + " directory cannot be found."); - } - ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = Path.Combine(BinPath(), byPathFromBinToExe.Trim('\\')); - startInfo.EnvironmentVariables["DOTNET_ROOT"] = dotnetPath; // ... return StartProcess(startInfo); From 1462fdda4699b6508901940d7d931e3dde373d1a Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 5 Mar 2019 13:56:29 -0800 Subject: [PATCH 69/82] include WinformsControlsTest in project references for IntegrationTests.csproj --- .../System.Windows.Forms.IntegrationTests.csproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj index 66a0132e833..ffb63b963b7 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj +++ b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj @@ -13,6 +13,8 @@ + + From 5374f4f89966d17480658aa1d66572e83f391fa6 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 5 Mar 2019 14:04:57 -0800 Subject: [PATCH 70/82] try setting xUnitVersion --- eng/Versions.props | 1 + eng/ci.yml | 23 ------------------- ...stem.Windows.Forms.IntegrationTests.csproj | 2 -- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 4cfdff60b47..9cd867ff51a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -27,6 +27,7 @@ 4.6.0-alpha-27122-5 + 2.4.1 2.4.1 0.3.5 4.10.0 diff --git a/eng/ci.yml b/eng/ci.yml index ee428713bc2..29b541ccfac 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -134,29 +134,6 @@ jobs: DisplayNamePrefix: 'Run Unit Tests on Helix' condition: succeeded() continueOnError: false - - # Run unit tests on Helix - - template: /eng/common/templates/steps/send-to-helix.yml - parameters: - HelixSource: ${{ parameters.repoName }} - HelixType: 'tests/default' - HelixBuild: $(Build.BuildNumber) - HelixTargetQueues: $(_HelixAgentPool) - HelixAccessToken: $(_HelixToken) # only defined for internal CI - Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) - # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj' - XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` - XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail - XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props - IncludeDotNetCli: true - DotNetCliPackageType: 'sdk' - DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against - EnableXUnitReporter: true - WaitForWorkItemCompletion: true - DisplayNamePrefix: 'Run Integration Tests on Helix' - condition: succeeded() - continueOnError: false # Run integration tests and rename binlog - script: eng\cibuild.cmd diff --git a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj index ffb63b963b7..66a0132e833 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj +++ b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj @@ -13,8 +13,6 @@ - - From 2141f2feac760fe50c35c6e04f28801cadcf2bbd Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Tue, 5 Mar 2019 14:16:07 -0800 Subject: [PATCH 71/82] add XUnitAssertVersion, XUnitRunnerVisualStudioVersion, and make all the same as XUnitVersion --- eng/Versions.props | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 9cd867ff51a..6d27a6ebfd7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -24,12 +24,17 @@ 1.0.0-beta.19154.14 2.4.0-beta.19154.14 - + - 4.6.0-alpha-27122-5 2.4.1 - 2.4.1 + $(XUnitVersion) + $(XUnitVersion) + $(xunitVersion) 0.3.5 + + + + 4.6.0-alpha-27122-5 4.10.0 1.0.0 From f2f6a18e57733701fdedc7fb45cd5c464138c500 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 6 Mar 2019 09:38:58 -0800 Subject: [PATCH 72/82] add more xunit depenencies --- eng/Versions.props | 5 +++-- .../InternalUtilitiesForTests.csproj | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 6d27a6ebfd7..cb9b8be809e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -26,10 +26,11 @@ - 2.4.1 + 2.4.1-pre.build.4059 $(XUnitVersion) $(XUnitVersion) - $(xunitVersion) + $(XUnitVersion) + $(XUnitVersion) 0.3.5 diff --git a/src/Common/tests/InternalUtilitiesForTests/InternalUtilitiesForTests.csproj b/src/Common/tests/InternalUtilitiesForTests/InternalUtilitiesForTests.csproj index 8bfcd13b8bf..f9ca6024255 100644 --- a/src/Common/tests/InternalUtilitiesForTests/InternalUtilitiesForTests.csproj +++ b/src/Common/tests/InternalUtilitiesForTests/InternalUtilitiesForTests.csproj @@ -10,7 +10,7 @@ - + From 545a08d528bcadb0a8235a8164678be240c22966 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 6 Mar 2019 09:45:29 -0800 Subject: [PATCH 73/82] update tools from Arcade --- eng/Version.Details.xml | 16 ++++++++-------- eng/Versions.props | 4 ++-- global.json | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e47f6ceaff8..d635e1fc797 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -45,21 +45,21 @@ Note: if the Uri is a new place, you will need to add a subscription from that p https://github.com/dotnet/corefx 8a730a6ecd96fef04d74e1807c8b1d193e0a5f16 - + https://github.com/dotnet/arcade - 2e18c1c82f57a7bc4fe864f04ab11608efc9ad4f + b94a591377451bda3ac80e597d7faff03a06c29e - + https://github.com/dotnet/arcade - 2e18c1c82f57a7bc4fe864f04ab11608efc9ad4f + b94a591377451bda3ac80e597d7faff03a06c29e - + https://github.com/dotnet/arcade - 2e18c1c82f57a7bc4fe864f04ab11608efc9ad4f + b94a591377451bda3ac80e597d7faff03a06c29e - + https://github.com/dotnet/arcade - 52b1fefd87fc574cbe6200325a3fdc0be89dd63a + b94a591377451bda3ac80e597d7faff03a06c29e diff --git a/eng/Versions.props b/eng/Versions.props index 42f1aa5bd8e..82938d23b4a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -21,8 +21,8 @@ - 1.0.0-beta.19155.29 - 2.4.0-beta.19155.29 + 1.0.0-beta.19156.1 + 2.4.0-beta.19156.1 diff --git a/global.json b/global.json index 3f041a09b37..9652f3648d1 100644 --- a/global.json +++ b/global.json @@ -9,7 +9,7 @@ "version": "3.0.100-preview-010024" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19155.29", - "Microsoft.DotNet.Helix.Sdk": "1.0.0-beta.19155.29" + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19156.1", + "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19156.1" } } From 9936e7bcdd409bb9eb43444916645ab49f8c35bc Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 6 Mar 2019 10:18:54 -0800 Subject: [PATCH 74/82] add back DOTNET_ROOT --- .../System.Windows.Forms.IntegrationTests/TestHelpers.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs index c2d3fb6fd48..8967170d532 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs @@ -34,8 +34,15 @@ public static Process StartProcess(string byPathFromBinToExe) throw new ArgumentException(nameof(byPathFromBinToExe) + " must end in a .exe"); } + var dotnetPath = DotNetPath(); + if (!Directory.Exists(dotnetPath)) + { + throw new DirectoryNotFoundException(dotnetPath + " directory cannot be found."); + } + ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = Path.Combine(BinPath(), byPathFromBinToExe.Trim('\\')); + startInfo.EnvironmentVariables["DOTNET_ROOT"] = dotnetPath; // ... return StartProcess(startInfo); From cbed7e8fbb400e5316a4ec024ec65bd48991f113 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 6 Mar 2019 11:13:10 -0800 Subject: [PATCH 75/82] rename _HelixAgentPool variable, add WinformsControlsTest to project includes --- eng/ci.yml | 6 +++--- .../System.Windows.Forms.IntegrationTests.csproj | 1 + .../System.Windows.Forms.IntegrationTests/TestHelpers.cs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 29b541ccfac..ae473dc6beb 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -42,7 +42,7 @@ jobs: value: '' # needed for helix jobs - - name: _HelixAgentPool + - name: _UnitTestHelixAgentPool value: 'Windows.10.Amd64.Open' - name: _WinformsControlsTestBinDir value: $(BUILD.SOURCESDIRECTORY)\artifacts\bin\WinformsControlsTest\$(_BuildConfig)\netcoreapp3.0 @@ -83,7 +83,7 @@ jobs: value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) # Windows.81.Amd64 will fail on Debug.Assert in TryGetSystemMetricsForDpi in UnsafeNativeMethods - - name: _HelixAgentPool + - name: _UnitTestHelixAgentPool value: 'Windows.10.Amd64' - name: _HelixToken value: '$(helix-token)' @@ -118,7 +118,7 @@ jobs: HelixSource: ${{ parameters.repoName }} HelixType: 'tests/default' HelixBuild: $(Build.BuildNumber) - HelixTargetQueues: $(_HelixAgentPool) + HelixTargetQueues: $(_UnitTestHelixAgentPool) HelixAccessToken: $(_HelixToken) # only defined for internal CI Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed diff --git a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj index 66a0132e833..0a96110b08c 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj +++ b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/System.Windows.Forms.IntegrationTests.csproj @@ -13,6 +13,7 @@ + diff --git a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs index 8967170d532..d60f58dc7f7 100644 --- a/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs +++ b/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.IntegrationTests/TestHelpers.cs @@ -42,7 +42,7 @@ public static Process StartProcess(string byPathFromBinToExe) ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = Path.Combine(BinPath(), byPathFromBinToExe.Trim('\\')); - startInfo.EnvironmentVariables["DOTNET_ROOT"] = dotnetPath; + startInfo.EnvironmentVariables["DOTNET_ROOT"] = dotnetPath; // required // ... return StartProcess(startInfo); From f8b603221a3965ff97fff0543fed0b1faf7bc5c6 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 6 Mar 2019 11:16:18 -0800 Subject: [PATCH 76/82] run integration tests on helix and change slashed for paths --- eng/ci.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/eng/ci.yml b/eng/ci.yml index ae473dc6beb..27f07387e39 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -122,7 +122,7 @@ jobs: HelixAccessToken: $(_HelixToken) # only defined for internal CI Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms/tests/UnitTests/System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms.Design/tests/UnitTests/System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)/src/System.Windows.Forms.Design.Editors/tests/UnitTests/System.Windows.Forms.Design.Editors.Tests.csproj' + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design\tests\System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design.Editors\tests\UnitTests\System.Windows.Forms.Design.Editors.Tests.csproj' XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props @@ -134,6 +134,28 @@ jobs: DisplayNamePrefix: 'Run Unit Tests on Helix' condition: succeeded() continueOnError: false + + - template: /eng/common/templates/steps/send-to-helix.yml + parameters: + HelixSource: ${{ parameters.repoName }} + HelixType: 'tests/default' + HelixBuild: $(Build.BuildNumber) + HelixTargetQueues: $(_UnitTestHelixAgentPool) + HelixAccessToken: $(_HelixToken) # only defined for internal CI + Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) + # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms\tests\IntegrationTests\System.Windows.Forms.IntegrationTests\System.Windows.Forms.IntegrationTests.csproj' + XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` + XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail + XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props + IncludeDotNetCli: true + DotNetCliPackageType: 'sdk' + DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against + EnableXUnitReporter: true + WaitForWorkItemCompletion: true + DisplayNamePrefix: 'Run Integration Tests on Helix' + condition: succeeded() + continueOnError: false # Run integration tests and rename binlog - script: eng\cibuild.cmd From c5599d005a9dafae551953580df66b86ef9da193 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 6 Mar 2019 11:24:13 -0800 Subject: [PATCH 77/82] relative path for design was wrong? --- eng/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/ci.yml b/eng/ci.yml index 27f07387e39..fb1186b4abb 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -122,7 +122,7 @@ jobs: HelixAccessToken: $(_HelixToken) # only defined for internal CI Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design\tests\System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design.Editors\tests\UnitTests\System.Windows.Forms.Design.Editors.Tests.csproj' + XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design\tests\UnitTests\System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design.Editors\tests\UnitTests\System.Windows.Forms.Design.Editors.Tests.csproj' XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props From b79237aa84056eb97482213ecce06a838646e43f Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 6 Mar 2019 11:41:45 -0800 Subject: [PATCH 78/82] do not run integration tests on helix yet --- eng/ci.yml | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index fb1186b4abb..c8e47180bc5 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -134,30 +134,11 @@ jobs: DisplayNamePrefix: 'Run Unit Tests on Helix' condition: succeeded() continueOnError: false - - - template: /eng/common/templates/steps/send-to-helix.yml - parameters: - HelixSource: ${{ parameters.repoName }} - HelixType: 'tests/default' - HelixBuild: $(Build.BuildNumber) - HelixTargetQueues: $(_UnitTestHelixAgentPool) - HelixAccessToken: $(_HelixToken) # only defined for internal CI - Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) - # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed - XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms\tests\IntegrationTests\System.Windows.Forms.IntegrationTests\System.Windows.Forms.IntegrationTests.csproj' - XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` - XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail - XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props - IncludeDotNetCli: true - DotNetCliPackageType: 'sdk' - DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against - EnableXUnitReporter: true - WaitForWorkItemCompletion: true - DisplayNamePrefix: 'Run Integration Tests on Helix' - condition: succeeded() - continueOnError: false # Run integration tests and rename binlog + # These are not ready to run on Helix because: + # 1. Helix doesn't build projects (it only uses publish); we need .dotnet and also bin from build + # 2. we need an interactive pool for SendKeys to work - script: eng\cibuild.cmd -configuration $(_BuildConfig) $(_OfficialBuildIdArgs) From ee9de87d078493b6d6540a6d035dc7fdc5b234b0 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 6 Mar 2019 15:23:59 -0800 Subject: [PATCH 79/82] additional yml --- eng/ci.yml | 16 +--------------- eng/helixtest.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 eng/helixtest.yml diff --git a/eng/ci.yml b/eng/ci.yml index c8e47180bc5..6715b51900f 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -113,27 +113,13 @@ jobs: displayName: Build # Run unit tests on Helix - - template: /eng/common/templates/steps/send-to-helix.yml + - template: /eng/helixtest.yml parameters: HelixSource: ${{ parameters.repoName }} - HelixType: 'tests/default' - HelixBuild: $(Build.BuildNumber) HelixTargetQueues: $(_UnitTestHelixAgentPool) HelixAccessToken: $(_HelixToken) # only defined for internal CI - Creator: ${{ parameters.repoName }} # required for public / external (when there is no access token) # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design\tests\UnitTests\System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design.Editors\tests\UnitTests\System.Windows.Forms.Design.Editors.Tests.csproj' - XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` - XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail - XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props - IncludeDotNetCli: true - DotNetCliPackageType: 'sdk' - DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against - EnableXUnitReporter: true - WaitForWorkItemCompletion: true - DisplayNamePrefix: 'Run Unit Tests on Helix' - condition: succeeded() - continueOnError: false # Run integration tests and rename binlog # These are not ready to run on Helix because: diff --git a/eng/helixtest.yml b/eng/helixtest.yml new file mode 100644 index 00000000000..af90cd4a82c --- /dev/null +++ b/eng/helixtest.yml @@ -0,0 +1,28 @@ +parameters: + # All parameters are required for our purposes; see send-to-helix.yml for details + RepoName: '' + HelixTargetQueue: '' + HelixToken: '' + XUnitProject: '' + +steps: +- template: /eng/common/templates/steps/send-to-helix.yml + parameters: + HelixSource: ${{ parameters.RepoName }} + HelixType: 'tests/default' + HelixBuild: $(Build.BuildNumber) + HelixTargetQueues: ${{ parameters.HelixTargetQueue }} + HelixAccessToken: ${{ parameters.HelixToken }} # only defined for internal CI + Creator: ${{ parameters.RepoName }} # required for public / external (when there is no access token) + XUnitProjects: ${{ parameters.XUnitProject }} + XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` + XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail + XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props + IncludeDotNetCli: true + DotNetCliPackageType: 'sdk' + DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against + EnableXUnitReporter: true + WaitForWorkItemCompletion: true + DisplayNamePrefix: 'Run Unit Tests on Helix' + condition: succeeded() + continueOnError: false \ No newline at end of file From 53c2de3a0587bf4c83ce23621cac038aa97d81d6 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 6 Mar 2019 15:28:32 -0800 Subject: [PATCH 80/82] fix name errors --- eng/ci.yml | 2 +- eng/helixtest.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eng/ci.yml b/eng/ci.yml index 6715b51900f..e75098d6be5 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -115,7 +115,7 @@ jobs: # Run unit tests on Helix - template: /eng/helixtest.yml parameters: - HelixSource: ${{ parameters.repoName }} + RepoName: ${{ parameters.repoName }} HelixTargetQueues: $(_UnitTestHelixAgentPool) HelixAccessToken: $(_HelixToken) # only defined for internal CI # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed diff --git a/eng/helixtest.yml b/eng/helixtest.yml index af90cd4a82c..07c2257bbfb 100644 --- a/eng/helixtest.yml +++ b/eng/helixtest.yml @@ -1,9 +1,9 @@ parameters: # All parameters are required for our purposes; see send-to-helix.yml for details RepoName: '' - HelixTargetQueue: '' - HelixToken: '' - XUnitProject: '' + HelixTargetQueues: '' + HelixAccessToken: '' + XUnitProjects: '' steps: - template: /eng/common/templates/steps/send-to-helix.yml @@ -11,10 +11,10 @@ steps: HelixSource: ${{ parameters.RepoName }} HelixType: 'tests/default' HelixBuild: $(Build.BuildNumber) - HelixTargetQueues: ${{ parameters.HelixTargetQueue }} - HelixAccessToken: ${{ parameters.HelixToken }} # only defined for internal CI + HelixTargetQueues: ${{ parameters.HelixTargetQueues }} + HelixAccessToken: ${{ parameters.HelixAccessToken }} # only defined for internal CI Creator: ${{ parameters.RepoName }} # required for public / external (when there is no access token) - XUnitProjects: ${{ parameters.XUnitProject }} + XUnitProjects: ${{ parameters.XUnitProjects }} XUnitPublishTargetFramework: netcoreapp3.0 # Whatever tfm will work for our test projects for `dotnet publish` XUnitRuntimeTargetFramework: netcoreapp2.0 # Whatever tfm to pick from the xunit package, it must exist in that package or the helix job will fail XUnitRunnerVersion: '2.4.1' # Should match XUnitRunnerConsoleVersion in eng/Versions.props From d5a444e0496910c951fe69c967b2b9f27e31989a Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Wed, 6 Mar 2019 15:44:08 -0800 Subject: [PATCH 81/82] rename, add naming --- eng/{helixtest.yml => ci-helix-test.yml} | 5 +++-- eng/ci.yml | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) rename eng/{helixtest.yml => ci-helix-test.yml} (92%) diff --git a/eng/helixtest.yml b/eng/ci-helix-test.yml similarity index 92% rename from eng/helixtest.yml rename to eng/ci-helix-test.yml index 07c2257bbfb..2f0b54e6b40 100644 --- a/eng/helixtest.yml +++ b/eng/ci-helix-test.yml @@ -3,7 +3,8 @@ parameters: RepoName: '' HelixTargetQueues: '' HelixAccessToken: '' - XUnitProjects: '' + XUnitProjects: '' + DisplayNamePrefix: '' steps: - template: /eng/common/templates/steps/send-to-helix.yml @@ -23,6 +24,6 @@ steps: DotNetCliVersion: '3.0.100-preview-010184' # MUST be official release: https://dotnet.microsoft.com/download/dotnet-core/3.0 ; does not need to match sdk we build against EnableXUnitReporter: true WaitForWorkItemCompletion: true - DisplayNamePrefix: 'Run Unit Tests on Helix' + DisplayNamePrefix: ${{ parameters.DisplayNamePrefix }} condition: succeeded() continueOnError: false \ No newline at end of file diff --git a/eng/ci.yml b/eng/ci.yml index e75098d6be5..9511a519872 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -113,13 +113,14 @@ jobs: displayName: Build # Run unit tests on Helix - - template: /eng/helixtest.yml + - template: /eng/ci-helix-test.yml parameters: RepoName: ${{ parameters.repoName }} HelixTargetQueues: $(_UnitTestHelixAgentPool) HelixAccessToken: $(_HelixToken) # only defined for internal CI # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed XUnitProjects: '$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms\tests\UnitTests\System.Windows.Forms.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design\tests\UnitTests\System.Windows.Forms.Design.Tests.csproj;$(BUILD.SOURCESDIRECTORY)\src\System.Windows.Forms.Design.Editors\tests\UnitTests\System.Windows.Forms.Design.Editors.Tests.csproj' + DisplayNamePrefix: 'Send Unit Tests (Windows.10) to Helix' # Run integration tests and rename binlog # These are not ready to run on Helix because: From ab795872240d94d27f5e612c95571b427fa6b9b0 Mon Sep 17 00:00:00 2001 From: Zachary Danz Date: Thu, 7 Mar 2019 12:57:38 -0800 Subject: [PATCH 82/82] helix type --- eng/ci-helix-test.yml | 7 ++++--- eng/ci.yml | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/eng/ci-helix-test.yml b/eng/ci-helix-test.yml index 2f0b54e6b40..301d83cdaab 100644 --- a/eng/ci-helix-test.yml +++ b/eng/ci-helix-test.yml @@ -1,6 +1,7 @@ parameters: - # All parameters are required for our purposes; see send-to-helix.yml for details - RepoName: '' + # All parameters are required for our purposes (except HelixType); see send-to-helix.yml for details + RepoName: '' + HelixType: 'tests/default' HelixTargetQueues: '' HelixAccessToken: '' XUnitProjects: '' @@ -10,7 +11,7 @@ steps: - template: /eng/common/templates/steps/send-to-helix.yml parameters: HelixSource: ${{ parameters.RepoName }} - HelixType: 'tests/default' + HelixType: ${{ parameters.HelixType }} HelixBuild: $(Build.BuildNumber) HelixTargetQueues: ${{ parameters.HelixTargetQueues }} HelixAccessToken: ${{ parameters.HelixAccessToken }} # only defined for internal CI diff --git a/eng/ci.yml b/eng/ci.yml index 9511a519872..5d9a4eb6736 100644 --- a/eng/ci.yml +++ b/eng/ci.yml @@ -116,6 +116,7 @@ jobs: - template: /eng/ci-helix-test.yml parameters: RepoName: ${{ parameters.repoName }} + HelixType: 'tests/unit' HelixTargetQueues: $(_UnitTestHelixAgentPool) HelixAccessToken: $(_HelixToken) # only defined for internal CI # Should be $(BUILD.SOURCESDIRECTOR)System.Windows.Forms/src/**/*.Tests.csproj, but cannot until https://github.com/dotnet/arcade/issues/2156 is fixed