From 95197f6ae7eedb9df8740eeadfa309a762e399c0 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Fri, 16 Oct 2020 10:45:22 +0200 Subject: [PATCH] Debug info for tests, to debug on Azure Devops Signed-off-by: Bjarke Berg --- .../Testing/UmbracoIntegrationTest.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs index ad861251ba..461afeabb7 100644 --- a/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs +++ b/src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs @@ -85,25 +85,22 @@ namespace Umbraco.Tests.Integration.Testing FirstTestInFixture = false; FirstTestInSession = false; - _stopWatch.Stop(); - TestContext.Progress.WriteLine($" Total: {_stopWatch.Elapsed}, Step1: {_stopWatchStep1}, Step1: {_stopWatchStep2}"); + TestContext.Progress.Write($" {TestContext.CurrentContext.Result.Outcome.Status}"); } [SetUp] public virtual void Setup() { TestContext.Progress.Write($"Start test {_testCount++}: {TestContext.CurrentContext.Test.Name}"); - _stopWatch = new Stopwatch(); - _stopWatch.Start(); + var hostBuilder = CreateHostBuilder(); var host = hostBuilder.Start(); - _stopWatchStep1 = _stopWatch.Elapsed; + Services = host.Services; var app = new ApplicationBuilder(host.Services); - Configure(app); //Takes around 200 ms - _stopWatchStep2 = _stopWatch.Elapsed; + Configure(app); OnFixtureTearDown(() => host.Dispose()); } @@ -500,9 +497,6 @@ namespace Umbraco.Tests.Integration.Testing protected static bool FirstTestInSession = true; protected bool FirstTestInFixture = true; - private Stopwatch _stopWatch; private static int _testCount = 1; - private TimeSpan _stopWatchStep1; - private TimeSpan _stopWatchStep2; } }