Remove the spuriously failing repository test

This commit is contained in:
Jordan Brown
2020-06-16 12:56:37 -04:00
parent 751546308c
commit 0687892b9d
@@ -80,26 +80,26 @@ namespace Tgstation.Server.Tests.Instance
// checkout V3 and back
cloned.Reference = "V3";
var updated = await Checkout(cloned, false, true, true, cancellationToken);
var updated = await Checkout(cloned, false, true, cancellationToken);
// Specific SHA
updated.CheckoutSha = "f43f5bd";
await ApiAssert.ThrowsException<ApiConflictException>(() => Checkout(updated, false, false, false, cancellationToken), ErrorCode.RepoMismatchShaAndReference);
await ApiAssert.ThrowsException<ApiConflictException>(() => Checkout(updated, false, false, cancellationToken), ErrorCode.RepoMismatchShaAndReference);
updated.Reference = null;
updated = await Checkout(updated, false, false, false, cancellationToken);
updated = await Checkout(updated, false, false, cancellationToken);
// Fake SHA
updated.Reference = null;
updated.CheckoutSha = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
updated = await Checkout(updated, true, false, false, cancellationToken);
updated = await Checkout(updated, true, false, cancellationToken);
// Fake ref
updated.Reference = "Tgs4IntegrationTestFakeBranchNeverNameABranchThis";
updated = await Checkout(updated, true, true, false, cancellationToken);
updated = await Checkout(updated, true, true, cancellationToken);
// Back
updated.Reference = workingBranch;
updated = await Checkout(updated, false, true, false, cancellationToken);
updated = await Checkout(updated, false, true, cancellationToken);
var testPRString = Environment.GetEnvironmentVariable("TGS4_TEST_PULL_REQUEST_NUMBER");
if (String.IsNullOrWhiteSpace(testPRString))
@@ -118,13 +118,11 @@ namespace Tgstation.Server.Tests.Instance
await TestMergeTests(updated, prNumber, cancellationToken);
}
async Task<Repository> Checkout(Repository updated, bool expectFailure, bool isRef, bool checkBusy, CancellationToken cancellationToken)
async Task<Repository> Checkout(Repository updated, bool expectFailure, bool isRef, CancellationToken cancellationToken)
{
var newRef = isRef ? updated.Reference : updated.CheckoutSha;
var checkingOut = await repositoryClient.Update(updated, cancellationToken);
Assert.IsNotNull(checkingOut.ActiveJob);
if(checkBusy)
await ApiAssert.ThrowsException<ConflictException>(() => repositoryClient.Read(cancellationToken), ErrorCode.RepoBusy);
await WaitForJob(checkingOut.ActiveJob, 30, expectFailure, cancellationToken);
var result = await repositoryClient.Read(cancellationToken);