diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2019-06-27 10:34:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-27 10:34:58 +0300 |
commit | a8cc97b50f1fece90690febd43761c157e773fe8 (patch) | |
tree | 490c086ba5d2bd39f9aa650b8cc8c672ebcbfcc7 | |
parent | 37e7bedb14ea06790e6002dfc22ce889229cb006 (diff) | |
parent | 4aeb87b9698b982b1da6289466619b72000350c7 (diff) |
Merge pull request #7901 from mono/type-system-perf-tests
[Perf Tests] Add type system perf test
5 files changed, 79 insertions, 13 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs index d98cc71894..b3f0717fdb 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectFile.cs @@ -331,7 +331,7 @@ namespace MonoDevelop.Projects var oldLink = link; link = value; - OnVirtualPathChanged (oldLink, link); + VirtualPathChanged?.Invoke (this, new ProjectFileVirtualPathChangedEventArgs (this, oldLink, link)); OnChanged ("Link"); } } @@ -479,7 +479,7 @@ namespace MonoDevelop.Projects base.OnProjectSet (); if (Project != null) { base.Include = Include; - OnVirtualPathChanged (FilePath.Null, ProjectVirtualPath); + VirtualPathChanged?.Invoke (this, new ProjectFileVirtualPathChangedEventArgs (this, FilePath.Null, ProjectVirtualPath)); } } @@ -507,14 +507,6 @@ namespace MonoDevelop.Projects internal event EventHandler<ProjectFileVirtualPathChangedEventArgs> VirtualPathChanged; - void OnVirtualPathChanged (FilePath oldVirtualPath, FilePath newVirtualPath) - { - var handler = VirtualPathChanged; - - if (handler != null) - handler (this, new ProjectFileVirtualPathChangedEventArgs (this, oldVirtualPath, newVirtualPath)); - } - internal event EventHandler<ProjectFilePathChangedEventArgs> PathChanged; void OnPathChanged (FilePath oldPath, FilePath newPath, FilePath oldVirtualPath, FilePath newVirtualPath) diff --git a/main/tests/performance/MonoDevelop.Ide.PerfTests/Baseline_MonoDevelop.Ide.PerfTests.xml b/main/tests/performance/MonoDevelop.Ide.PerfTests/Baseline_MonoDevelop.Ide.PerfTests.xml index cbd28e6425..8e245af78f 100644 --- a/main/tests/performance/MonoDevelop.Ide.PerfTests/Baseline_MonoDevelop.Ide.PerfTests.xml +++ b/main/tests/performance/MonoDevelop.Ide.PerfTests/Baseline_MonoDevelop.Ide.PerfTests.xml @@ -61,6 +61,16 @@ </test-case> </results> </test-suite> + <test-suite type="TestFixture" name="TestTypeSystemServiceLoad" executed="True" result="Success" success="True" time="28.637" asserts="0"> + <results> + <test-case name="MonoDevelop.Ide.PerfTests.TestTypeSystemServiceLoad.TestLoad" executed="True" result="Success" success="True" time="28.633" asserts="1"> + <properties> + <property name="Time" value="3.95" /> + <property name="Tolerance" value="0.3" /> + </properties> + </test-case> + </results> + </test-suite> </results> </test-suite> </results> diff --git a/main/tests/performance/MonoDevelop.Ide.PerfTests/MonoDevelop.Ide.PerfTests.csproj b/main/tests/performance/MonoDevelop.Ide.PerfTests/MonoDevelop.Ide.PerfTests.csproj index 7a38d00097..91393d9f59 100644 --- a/main/tests/performance/MonoDevelop.Ide.PerfTests/MonoDevelop.Ide.PerfTests.csproj +++ b/main/tests/performance/MonoDevelop.Ide.PerfTests/MonoDevelop.Ide.PerfTests.csproj @@ -48,6 +48,7 @@ <Compile Include="TestSolutionLoad.cs" /> <Compile Include="TestSolutionBuild.cs" /> <Compile Include="TestFileWatcherHandlers.cs" /> + <Compile Include="TestTypeSystemServiceLoad.cs" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/main/tests/performance/MonoDevelop.Ide.PerfTests/TestTypeSystemServiceLoad.cs b/main/tests/performance/MonoDevelop.Ide.PerfTests/TestTypeSystemServiceLoad.cs new file mode 100644 index 0000000000..702bbb124e --- /dev/null +++ b/main/tests/performance/MonoDevelop.Ide.PerfTests/TestTypeSystemServiceLoad.cs @@ -0,0 +1,57 @@ +// +// TestTypeSystemServiceLoad.cs +// +// Author: +// Matt Ward <matt.ward@microsoft.com> +// +// Copyright (c) 2019 Microsoft +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using MonoDevelop.Core.Instrumentation; +using MonoDevelop.PerformanceTesting; +using MonoDevelop.UserInterfaceTesting; +using NUnit.Framework; + +namespace MonoDevelop.Ide.PerfTests +{ + public class TestTypeSystemServiceLoad : UITestBase + { + public override void SetUp () + { + InstrumentationService.Enabled = true; + PreStart (); + } + + [Test] + [Benchmark (Tolerance = 0.3)] + public void TestLoad () + { + OpenApplicationAndWait (); + + Session.RunAndWaitForTimer (() => { + OpenSolutionAndWait (out _, "console-with-libs", "console-with-libs.sln"); + }, "Ide.CodeAnalysis"); + + var t = Session.GetTimerDuration ("Ide.CodeAnalysis"); + + Benchmark.SetTime (t.TotalSeconds); + } + } +} diff --git a/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting/UITestBase.cs b/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting/UITestBase.cs index fa2a3178d4..06da71ed20 100644 --- a/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting/UITestBase.cs +++ b/main/tests/ui/MonoDevelop.UserInterfaceTesting/MonoDevelop.UserInterfaceTesting/UITestBase.cs @@ -1,4 +1,4 @@ -// +// // UserInterfaceTest.cs // // Author: @@ -115,6 +115,7 @@ namespace MonoDevelop.UserInterfaceTesting public void PreStart () { + UnitTests.Util.ClearTmpDir (); SetupTestResultFolder (); SetupTestLogger (); SetupScreenshotsFolder (); @@ -143,7 +144,12 @@ namespace MonoDevelop.UserInterfaceTesting public string OpenExampleSolutionAndWait (out bool waitForPackages) { - var sln = UnitTests.Util.GetSampleProject ("performance", "sdk-library", "sdk-library.sln"); + return OpenSolutionAndWait (out waitForPackages, "performance", "sdk-library", "sdk-library.sln"); + } + + public string OpenSolutionAndWait (out bool waitForPackages, params string[] projectName) + { + FilePath sln = UnitTests.Util.GetSampleProject (projectName); if (!File.Exists (sln)) { throw new FileNotFoundException ("Could not find test solution", sln); @@ -151,7 +157,7 @@ namespace MonoDevelop.UserInterfaceTesting // Tell the app to track time to code Session.GlobalInvoke ("MonoDevelop.Ide.IdeStartupTracker.StartupTracker.StartTimeToCodeLoadTimer", null); - Session.RunAndWaitForTimer (() => Session.GlobalInvoke ("MonoDevelop.Ide.IdeApp.Workspace.OpenWorkspaceItem", (Core.FilePath)sln), "Ide.Shell.SolutionOpened", 60000); + Session.RunAndWaitForTimer (() => Session.GlobalInvoke ("MonoDevelop.Ide.IdeApp.Workspace.OpenWorkspaceItem", sln), "Ide.Shell.SolutionOpened", 60000); Session.GlobalInvoke ("MonoDevelop.Ide.IdeStartupTracker.StartupTracker.TrackTimeToCode", MonoDevelop.Ide.TimeToCodeMetadata.DocumentType.Solution); // Currently we only have one solution which needs packages waited for. |