mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Fix profiling setup
"build profiling" is back to a working state. --HG-- branch : dev
This commit is contained in:
parent
cb1b29ff8f
commit
a6eb5740e7
@ -1,17 +1,17 @@
|
||||
Feature: Profiling
|
||||
In order to profile the site
|
||||
As a developer
|
||||
I want to generate a fixed number of repeatable requests
|
||||
In order to profile the site
|
||||
As a developer
|
||||
I want to generate a fixed number of repeatable requests
|
||||
|
||||
Scenario: Warmup
|
||||
Given I am logged in
|
||||
When I go to "/admin"
|
||||
When I go to "/blog0"
|
||||
When I go to "/"
|
||||
Given I am logged in
|
||||
When I go to "/admin"
|
||||
When I go to "/blog0"
|
||||
When I go to "/"
|
||||
|
||||
Scenario: Dashboard
|
||||
Given I am logged in
|
||||
When I go to "/admin" 40 times
|
||||
Given I am logged in
|
||||
When I go to "/admin" 40 times
|
||||
|
||||
Scenario: Hitting blogs
|
||||
Given I am logged in
|
||||
|
38
src/Orchard.Profile/Tests/Profiling.feature.cs
generated
38
src/Orchard.Profile/Tests/Profiling.feature.cs
generated
@ -1,18 +1,21 @@
|
||||
// ------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by SpecFlow (http://www.specflow.org/).
|
||||
// SpecFlow Version:1.2.0.0
|
||||
// Runtime Version:2.0.50727.4927
|
||||
// SpecFlow Version:1.3.2.0
|
||||
// Runtime Version:4.0.30319.1
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
// ------------------------------------------------------------------------------
|
||||
namespace Orchard.Profile.Tests
|
||||
#region Designer generated code
|
||||
namespace Orchard.Specs.Le.Tests
|
||||
{
|
||||
using TechTalk.SpecFlow;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.3.2.0")]
|
||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[NUnit.Framework.TestFixtureAttribute()]
|
||||
[NUnit.Framework.DescriptionAttribute("Profiling")]
|
||||
public partial class ProfilingFeature
|
||||
@ -58,13 +61,13 @@ namespace Orchard.Profile.Tests
|
||||
#line 6
|
||||
this.ScenarioSetup(scenarioInfo);
|
||||
#line 7
|
||||
testRunner.Given("I am logged in");
|
||||
testRunner.Given("I am logged in");
|
||||
#line 8
|
||||
testRunner.When("I go to \"/admin\"");
|
||||
testRunner.When("I go to \"/admin\"");
|
||||
#line 9
|
||||
testRunner.When("I go to \"/blog0\"");
|
||||
testRunner.When("I go to \"/blog0\"");
|
||||
#line 10
|
||||
testRunner.When("I go to \"/\"");
|
||||
testRunner.When("I go to \"/\"");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
@ -77,9 +80,9 @@ this.ScenarioSetup(scenarioInfo);
|
||||
#line 12
|
||||
this.ScenarioSetup(scenarioInfo);
|
||||
#line 13
|
||||
testRunner.Given("I am logged in");
|
||||
testRunner.Given("I am logged in");
|
||||
#line 14
|
||||
testRunner.When("I go to \"/admin\" 40 times");
|
||||
testRunner.When("I go to \"/admin\" 40 times");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
@ -92,17 +95,17 @@ this.ScenarioSetup(scenarioInfo);
|
||||
#line 16
|
||||
this.ScenarioSetup(scenarioInfo);
|
||||
#line 17
|
||||
testRunner.Given("I am logged in");
|
||||
testRunner.Given("I am logged in");
|
||||
#line 18
|
||||
testRunner.When("I go to \"/blog0\" 10 times");
|
||||
testRunner.When("I go to \"/blog0\" 10 times");
|
||||
#line 19
|
||||
testRunner.When("I go to \"/blog1\" 10 times");
|
||||
testRunner.When("I go to \"/blog1\" 10 times");
|
||||
#line 20
|
||||
testRunner.When("I go to \"/blog2\" 10 times");
|
||||
testRunner.When("I go to \"/blog2\" 10 times");
|
||||
#line 21
|
||||
testRunner.When("I go to \"/blog3\" 10 times");
|
||||
testRunner.When("I go to \"/blog3\" 10 times");
|
||||
#line 22
|
||||
testRunner.When("I go to \"/blog4\" 10 times");
|
||||
testRunner.When("I go to \"/blog4\" 10 times");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
@ -115,11 +118,12 @@ this.ScenarioSetup(scenarioInfo);
|
||||
#line 24
|
||||
this.ScenarioSetup(scenarioInfo);
|
||||
#line 25
|
||||
testRunner.Given("I am logged in");
|
||||
testRunner.Given("I am logged in");
|
||||
#line 26
|
||||
testRunner.When("I go to \"/\" 40 times");
|
||||
testRunner.When("I go to \"/\" 40 times");
|
||||
#line hidden
|
||||
testRunner.CollectScenarioErrors();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
@ -1,3 +1,3 @@
|
||||
setup /SiteName:Profiling /AdminUsername:admin /AdminPassword:profiling-secret /DatabaseProvider:SqlCe /EnabledFeatures:Orchard.Framework,Common,Dashboard,Feeds,HomePage,Navigation,Scheduling,Settings,XmlRpc,Orchard.Users,Orchard.Roles,TinyMce,Orchard.Modules,Orchard.Themes,Orchard.MultiTenancy,Orchard.Pages,Orchard.Blogs,Orchard.Comments,Futures.Widgets,Orchard.Media,Orchard.Tags,Orchard.DevTools
|
||||
setup /SiteName:Profiling /AdminUsername:admin /AdminPassword:profiling-secret /DatabaseProvider:SqlCe /EnabledFeatures:Profiling,Orchard.Framework,Routable,Common,Dashboard,Feeds,PublishLater,HomePage,Contents,Navigation,Reports,Scheduling,Indexing,Settings,Localization,XmlRpc,Orchard.Users,Orchard.Roles,TinyMce,Orchard.Modules,Orchard.Themes,Orchard.MultiTenancy,Orchard.Pages,Orchard.Blogs,Orchard.Comments,Orchard.Modules,Futures.Widgets,Orchard.Media,Orchard.Tags,Orchard.DevTools
|
||||
add profiling data
|
||||
feature disable Orchard.DevTools
|
||||
|
@ -2,6 +2,7 @@ using JetBrains.Annotations;
|
||||
using Orchard.Blogs.Drivers;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Routable.Models;
|
||||
using Orchard.Data;
|
||||
|
||||
@ -10,6 +11,7 @@ namespace Orchard.Blogs.Handlers {
|
||||
public class BlogHandler : ContentHandler {
|
||||
public BlogHandler(IRepository<BlogRecord> repository) {
|
||||
Filters.Add(new ActivatingFilter<Blog>(BlogDriver.ContentType.Name));
|
||||
Filters.Add(new ActivatingFilter<CommonAspect>(BlogDriver.ContentType.Name));
|
||||
Filters.Add(new ActivatingFilter<IsRoutable>(BlogDriver.ContentType.Name));
|
||||
Filters.Add(StorageFilter.For(repository));
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ namespace Orchard.DevTools.Commands {
|
||||
var page = _contentManager.Create("Page", VersionOptions.Draft);
|
||||
page.As<ICommonAspect>().Owner = admin;
|
||||
page.As<IsRoutable>().Slug = pageName;
|
||||
page.As<IsRoutable>().Path = pageName;
|
||||
page.As<IsRoutable>().Title = pageName;
|
||||
page.As<BodyAspect>().Text = pageName;
|
||||
page.As<MenuPart>().OnMainMenu = true;
|
||||
@ -39,6 +40,7 @@ namespace Orchard.DevTools.Commands {
|
||||
var blog = _contentManager.New("Blog");
|
||||
blog.As<ICommonAspect>().Owner = admin;
|
||||
blog.As<IsRoutable>().Slug = blogName;
|
||||
blog.As<IsRoutable>().Path = blogName;
|
||||
blog.As<IsRoutable>().Title = blogName;
|
||||
blog.As<MenuPart>().OnMainMenu = true;
|
||||
blog.As<MenuPart>().MenuPosition = "6." + index;
|
||||
|
Loading…
Reference in New Issue
Block a user