Debug info for tests, to debug on Azure Devops

Signed-off-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Bjarke Berg
2020-10-16 08:38:25 +02:00
parent d74ec6e130
commit 38897c297f

View File

@@ -27,6 +27,7 @@ using System.Collections.Generic;
using Microsoft.Extensions.Configuration;
using System.Data.SqlClient;
using System.Data.Common;
using System.Diagnostics;
using System.IO;
using Umbraco.Core.Configuration.Models;
using Microsoft.Extensions.Options;
@@ -83,12 +84,19 @@ namespace Umbraco.Tests.Integration.Testing
_testTeardown = null;
FirstTestInFixture = false;
FirstTestInSession = false;
_stopWatch.Stop();
TestContext.Progress.WriteLine($" {_stopWatch.Elapsed}");
}
[SetUp]
public virtual void Setup()
{
TestContext.Progress.Write($"Start test {_testCount++}: ");
_stopWatch = new Stopwatch();
_stopWatch.Start();
var hostBuilder = CreateHostBuilder();
var host = hostBuilder.StartAsync().GetAwaiter().GetResult();
Services = host.Services;
var app = new ApplicationBuilder(host.Services);
@@ -490,5 +498,7 @@ namespace Umbraco.Tests.Integration.Testing
protected static bool FirstTestInSession = true;
protected bool FirstTestInFixture = true;
private Stopwatch _stopWatch;
private static int _testCount = 1;
}
}