From d74ec6e1302f71c4e5840d4199f6a2bbd6cee2e8 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Fri, 16 Oct 2020 07:08:50 +0200 Subject: [PATCH] Changed default test setting to Boot=false Signed-off-by: Bjarke Berg --- .../Testing/UmbracoTestAttribute.cs | 2 +- .../Testing/UmbracoIntegrationTest.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Tests.Common/Testing/UmbracoTestAttribute.cs b/src/Umbraco.Tests.Common/Testing/UmbracoTestAttribute.cs index 3a0ce39493..9248a45d78 100644 --- a/src/Umbraco.Tests.Common/Testing/UmbracoTestAttribute.cs +++ b/src/Umbraco.Tests.Common/Testing/UmbracoTestAttribute.cs @@ -50,7 +50,7 @@ namespace Umbraco.Tests.Testing /// /// Default is to use the global tests plugin manager. public UmbracoTestOptions.TypeLoader TypeLoader { get => _typeLoader.ValueOrDefault(UmbracoTestOptions.TypeLoader.Default); set => _typeLoader.Set(value); } - public bool Boot { get => _boot.ValueOrDefault(true); set => _boot.Set(value); } + public bool Boot { get => _boot.ValueOrDefault(false); set => _boot.Set(value); } private readonly Settable _boot = new Settable(); diff --git a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs index 795fc07f79..950104062f 100644 --- a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs +++ b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs @@ -92,7 +92,8 @@ namespace Umbraco.Tests.Integration.Testing var host = hostBuilder.StartAsync().GetAwaiter().GetResult(); Services = host.Services; var app = new ApplicationBuilder(host.Services); - Configure(app); + Configure(app); //Takes around 200 ms + OnFixtureTearDown(() => host.Dispose()); } @@ -274,14 +275,13 @@ namespace Umbraco.Tests.Integration.Testing public virtual void Configure(IApplicationBuilder app) { - Services.GetRequiredService().EnsureBackofficeSecurity(); - Services.GetRequiredService().EnsureUmbracoContext(); - - // get the currently set options + //get the currently set options var testOptions = TestOptionAttributeBase.GetTestOptions(); if (testOptions.Boot) { - app.UseUmbracoCore(); + Services.GetRequiredService().EnsureBackofficeSecurity(); + Services.GetRequiredService().EnsureUmbracoContext(); + app.UseUmbracoCore(); // Takes 200 ms } }