diff --git a/src/NzbDrone.Integration.Test/ApiTests/ArtistEditorFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/ArtistEditorFixture.cs index fd7e16b86..a9f819cba 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/ArtistEditorFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/ArtistEditorFixture.cs @@ -11,6 +11,8 @@ namespace NzbDrone.Integration.Test.ApiTests { private void GivenExistingArtist() { + WaitForCompletion(() => Profiles.All().Count > 0); + foreach (var name in new[] { "Alien Ant Farm", "Kiss" }) { var newArtist = Artist.Lookup(name).First(); diff --git a/src/NzbDrone.Integration.Test/IntegrationTest.cs b/src/NzbDrone.Integration.Test/IntegrationTest.cs index 4b18bffba..a177efb97 100644 --- a/src/NzbDrone.Integration.Test/IntegrationTest.cs +++ b/src/NzbDrone.Integration.Test/IntegrationTest.cs @@ -2,6 +2,7 @@ using System.Threading; using Lidarr.Http.ClientSchema; using NLog; using NUnit.Framework; +using NzbDrone.Common.Extensions; using NzbDrone.Core.Indexers.Newznab; using NzbDrone.Test.Common; @@ -34,6 +35,9 @@ namespace NzbDrone.Integration.Test protected override void InitializeTestTarget() { + // Make sure tasks have been initialized so the config put below doesn't cause errors + WaitForCompletion(() => Tasks.All().SelectList(x => x.TaskName).Contains("RssSync")); + Indexers.Post(new Lidarr.Api.V1.Indexers.IndexerResource { EnableRss = false, diff --git a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs index edc1bdef2..522e353c7 100644 --- a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs +++ b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs @@ -13,6 +13,7 @@ using Lidarr.Api.V1.DownloadClient; using Lidarr.Api.V1.History; using Lidarr.Api.V1.Profiles.Quality; using Lidarr.Api.V1.RootFolders; +using Lidarr.Api.V1.System.Tasks; using Lidarr.Api.V1.Tags; using Microsoft.AspNetCore.SignalR.Client; using NLog; @@ -38,6 +39,7 @@ namespace NzbDrone.Integration.Test public ClientBase Blacklist; public CommandClient Commands; + public ClientBase Tasks; public DownloadClientClient DownloadClients; public AlbumClient Albums; public TrackClient Tracks; @@ -103,6 +105,7 @@ namespace NzbDrone.Integration.Test Blacklist = new ClientBase(RestClient, ApiKey); Commands = new CommandClient(RestClient, ApiKey); + Tasks = new ClientBase(RestClient, ApiKey, "system/task"); DownloadClients = new DownloadClientClient(RestClient, ApiKey); Albums = new AlbumClient(RestClient, ApiKey); Tracks = new TrackClient(RestClient, ApiKey);