Forgot to return the current cron in the API

This commit is contained in:
Jordan Dominion
2024-07-06 11:16:05 -04:00
parent 43ff4b75d6
commit 95c26b52b1
2 changed files with 9 additions and 2 deletions
@@ -69,6 +69,7 @@ namespace Tgstation.Server.Host.Models
public InstanceResponse ToApi() => new()
{
AutoUpdateInterval = AutoUpdateInterval,
AutoUpdateCron = AutoUpdateCron,
ConfigurationType = ConfigurationType,
Id = Id,
Name = Name,
@@ -179,19 +179,25 @@ namespace Tgstation.Server.Tests.Live
}, cancellationToken), ErrorCode.ModelValidationFailure);
// regression check
await instanceManagerClient.Update(new InstanceUpdateRequest
var updated = await instanceManagerClient.Update(new InstanceUpdateRequest
{
Id = firstTest.Id,
AutoUpdateInterval = 9999,
}, cancellationToken);
Assert.AreEqual(String.Empty, updated.AutoUpdateCron);
Assert.AreEqual(9999U, updated.AutoUpdateInterval);
// check regular 6-part crons succeed
await instanceManagerClient.Update(new InstanceUpdateRequest
updated = await instanceManagerClient.Update(new InstanceUpdateRequest
{
Id = firstTest.Id,
AutoUpdateCron = "0 0 0 1 1 *"
}, cancellationToken);
Assert.AreEqual("0 0 0 1 1 *", updated.AutoUpdateCron);
Assert.AreEqual(0U, updated.AutoUpdateInterval);
//can't move online instance
await ApiAssert.ThrowsException<ConflictException, InstanceResponse>(() => instanceManagerClient.Update(new InstanceUpdateRequest
{