More test fixes

This commit is contained in:
Timothy Baldridge 2020-08-12 22:14:35 -06:00
parent 091f342709
commit b181d48722
5 changed files with 15 additions and 4 deletions

View File

@ -5,7 +5,6 @@ using System.Reactive.Disposables;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Wabbajack.Common
{
public class AsyncLock

View File

@ -98,11 +98,13 @@ namespace Wabbajack.Lib.Downloaders
var bufferSize = 1024 * 32;
Utils.Status($"Starting Download {a.Name ?? Url}", Percent.Zero);
var response = await client.GetAsync(Url);
var response = await client.GetAsync(Url, errorsAsExceptions:false, retry:false);
TOP:
if (!response.IsSuccessStatusCode)
if (!response.IsSuccessStatusCode)
{
return false;
}
Stream stream;
try

View File

@ -170,7 +170,8 @@ namespace Wabbajack.BuildServer.Test
Consts.ModlistSummaryURL = MakeURL("lists/status.json");
Consts.ServerWhitelistURL = MakeURL("ServerWhitelist.yaml");
Consts.UnlistedModlistMetadataURL = MakeURL("lists/none.json");
}
public WorkQueue Queue { get; set; }

View File

@ -4,6 +4,7 @@ using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
using Wabbajack.Common;
using Wabbajack.Lib;
using Wabbajack.Lib.Downloaders;
@ -54,6 +55,10 @@ namespace Wabbajack.BuildServer.Test
[Fact]
public async Task CanValidateModLists()
{
var sql = Fixture.GetService<SqlService>();
await using var conn = await sql.Open();
await conn.ExecuteAsync("DELETE from Patches");
var modlists = await MakeModList("CanValidateModlistsFile.txt");
Consts.ModlistMetadataURL = modlists.ToString();
Utils.Log("Updating modlists");

View File

@ -170,6 +170,10 @@ namespace Wabbajack.Server.Services
var lst = p.Split("_", StringSplitOptions.RemoveEmptyEntries).Select(Hash.FromHex).ToArray();
return (lst[0], lst[1]);
}
catch (ArgumentException ex)
{
return default;
}
catch (FormatException ex)
{
return default;