diff --git a/Wabbajack.BuildServer.Test/ABuildServerSystemTest.cs b/Wabbajack.BuildServer.Test/ABuildServerSystemTest.cs index 33e30180..67fe9668 100644 --- a/Wabbajack.BuildServer.Test/ABuildServerSystemTest.cs +++ b/Wabbajack.BuildServer.Test/ABuildServerSystemTest.cs @@ -4,6 +4,8 @@ using System.Reactive.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Hosting; +using Wabbajack.BuildServer.Model.Models; +using Wabbajack.BuildServer.Models.JobQueue; using Wabbajack.Common; using Wabbajack.Common.Http; using Wabbajack.Common.StatusFeed; @@ -147,6 +149,19 @@ namespace Wabbajack.BuildServer.Test return "http://localhost:8080/" + path; } + protected async Task ClearJobQueue() + { + var sql = Fixture.GetService(); + while (true) + { + var job = await sql.GetJob(); + if (job == null) break; + + job.Result = JobResult.Success(); + await sql.FinishJob(job); + } + } + public override void Dispose() { Queue.Dispose(); diff --git a/Wabbajack.BuildServer.Test/IndexedFilesTests.cs b/Wabbajack.BuildServer.Test/IndexedFilesTests.cs index ff001810..e8d594bc 100644 --- a/Wabbajack.BuildServer.Test/IndexedFilesTests.cs +++ b/Wabbajack.BuildServer.Test/IndexedFilesTests.cs @@ -21,10 +21,13 @@ namespace Wabbajack.BuildServer.Test [Fact, Priority(1)] public async Task CanIngestExportedInis() { + var sql = Fixture.GetService(); var to = Fixture.ServerTempFolder.Combine("IniIngest"); await @"sql\DownloadStates".RelativeTo(AbsolutePath.EntryPoint).CopyDirectoryToAsync(to); var result = await _authedClient.GetStringAsync(MakeURL("indexed_files/ingest/IniIngest")); Assert.Equal("5", result); + + await ClearJobQueue(); } [Fact, Priority(2)] diff --git a/Wabbajack.BuildServer.Test/ModListValidationTests.cs b/Wabbajack.BuildServer.Test/ModListValidationTests.cs index 6c895424..cf3d9080 100644 --- a/Wabbajack.BuildServer.Test/ModListValidationTests.cs +++ b/Wabbajack.BuildServer.Test/ModListValidationTests.cs @@ -6,6 +6,7 @@ using System.Security.Policy; using System.Text; using System.Threading.Tasks; using Wabbajack.BuildServer.Model.Models; +using Wabbajack.BuildServer.Models; using Wabbajack.BuildServer.Models.JobQueue; using Wabbajack.BuildServer.Models.Jobs; using Wabbajack.Common; @@ -60,9 +61,20 @@ namespace Wabbajack.BuildServer.Test Assert.Single(data); Assert.Equal(0, data.First().ValidationSummary.Failed); Assert.Equal(1, data.First().ValidationSummary.Passed); + + await CheckListFeeds(0, 1); } + private async Task CheckListFeeds(int failed, int passed) + { + var statusJson = await _client.GetJsonAsync(MakeURL("lists/status/test_list.json")); + Assert.Equal(failed, statusJson.Archives.Count(a => a.IsFailing)); + Assert.Equal(passed, statusJson.Archives.Count(a => !a.IsFailing)); + + + } + private async Task MakeModList() {