Randomize file hashes so we don't kill the tests so much

This commit is contained in:
Timothy Baldridge 2020-08-07 22:20:49 -06:00
parent 536e790e55
commit 5179d7f3f3
3 changed files with 4 additions and 3 deletions

View File

@ -128,11 +128,12 @@ namespace Wabbajack.Lib.Downloaders
Utils.Log($"Looking for patch for {archive.Name} ({(long)archive.Hash} {archive.Hash.ToHex()} -> {(long)result.Archive!.Hash} {result.Archive!.Hash.ToHex()})");
var patchResult = await ClientAPI.GetModUpgrade(archive, result.Archive!);
Utils.Log($"Downloading patch for {archive.Name}");
Utils.Log($"Downloading patch for {archive.Name} from {patchResult}");
var tempFile = new TempFile();
using var response = await (await ClientAPI.GetClient()).GetAsync(patchResult);
await tempFile.Path.WriteAllAsync(await response.Content.ReadAsStreamAsync());
response.Dispose();

View File

@ -105,7 +105,7 @@ namespace Wabbajack.Server.Test
patcher.NoCleaning = true;
var sql = Fixture.GetService<SqlService>();
var oldFileData = Encoding.UTF8.GetBytes("Cheese for Everyone!");
var oldFileData = Encoding.UTF8.GetBytes("Cheese for Everyone!" + Guid.NewGuid());
var newFileData = Encoding.UTF8.GetBytes("Forks for Everyone!");
var oldDataHash = oldFileData.xxHash();
var newDataHash = newFileData.xxHash();

View File

@ -203,7 +203,7 @@ namespace Wabbajack.Server.Services
try
{
_logger.Log(LogLevel.Information,
$"Uploading {patchFile.Size.ToFileSizeString()} patch file to CDN");
$"Uploading {patchFile.Size.ToFileSizeString()} patch file to CDN {patchName}");
using var client = await GetBunnyCdnFtpClient();
await client.UploadFileAsync((string)patchFile, patchName, FtpRemoteExists.Overwrite);