Run integration tests in parallel

Revert "Try to fix alpine integration tests"

This reverts commit d8cb86c5dd.

[common]
This commit is contained in:
ta264
2020-08-15 14:18:51 +01:00
parent ea909c6d99
commit 2b994fdc0c
6 changed files with 43 additions and 32 deletions

View File

@@ -1,24 +1,33 @@
using System.Threading;
using NLog;
using NUnit.Framework;
using NzbDrone.Core.Indexers.Newznab;
using NzbDrone.Test.Common;
using Readarr.Http.ClientSchema;
namespace NzbDrone.Integration.Test
{
[Parallelizable(ParallelScope.Fixtures)]
public abstract class IntegrationTest : IntegrationTestBase
{
protected static int StaticPort = 8787;
protected NzbDroneRunner _runner;
public override string AuthorRootFolder => GetTempDirectory("AuthorRootFolder");
protected override string RootUrl => "http://localhost:8787/";
protected int Port { get; private set; }
protected override string RootUrl => $"http://localhost:{Port}/";
protected override string ApiKey => _runner.ApiKey;
protected override void StartTestTarget()
{
_runner = new NzbDroneRunner(LogManager.GetCurrentClassLogger());
_runner.KillAll();
Port = Interlocked.Increment(ref StaticPort);
_runner = new NzbDroneRunner(LogManager.GetCurrentClassLogger(), Port);
_runner.Kill();
_runner.Start();
}
@@ -45,7 +54,7 @@ namespace NzbDrone.Integration.Test
protected override void StopTestTarget()
{
_runner.KillAll();
_runner.Kill();
}
}
}