From 44584531c4fc2c5c383d990d03e97039761e228f Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sun, 15 Sep 2024 11:23:26 -0400 Subject: [PATCH 1/4] Make `ProviderFactory` use `IOptionsMonitor` --- .../Components/Chat/Providers/DiscordProvider.cs | 15 ++++++++------- .../Components/Chat/Providers/ProviderFactory.cs | 14 +++++++------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs b/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs index 7012a94baf0..b1b384e814b 100644 --- a/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs +++ b/src/Tgstation.Server.Host/Components/Chat/Providers/DiscordProvider.cs @@ -9,6 +9,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; using Remora.Discord.API.Abstractions.Gateway.Commands; using Remora.Discord.API.Abstractions.Gateway.Events; @@ -72,9 +73,9 @@ public override string BotMention readonly IAssemblyInformationProvider assemblyInformationProvider; /// - /// The for the . + /// The for the . /// - readonly GeneralConfiguration generalConfiguration; + readonly IOptionsMonitor generalConfigurationOptions; /// /// The containing Discord services. @@ -141,18 +142,18 @@ public override string BotMention /// The for the . /// The value of . /// The for the . - /// The value of . + /// The value of . public DiscordProvider( IJobManager jobManager, IAsyncDelayer asyncDelayer, ILogger logger, IAssemblyInformationProvider assemblyInformationProvider, - ChatBot chatBot, - GeneralConfiguration generalConfiguration) + IOptionsMonitor generalConfigurationOptions, + ChatBot chatBot) : base(jobManager, asyncDelayer, logger, chatBot) { this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider)); - this.generalConfiguration = generalConfiguration ?? throw new ArgumentNullException(nameof(generalConfiguration)); + this.generalConfigurationOptions = generalConfigurationOptions ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); mappedChannels = new List(); connectDisconnectLock = new object(); @@ -921,7 +922,7 @@ List BuildUpdateEmbedFields( true), EngineType.OpenDream => new EmbedField( "OpenDream Version", - $"[{engineVersion.SourceSHA![..7]}]({generalConfiguration.OpenDreamGitUrl}/commit/{engineVersion.SourceSHA})", + $"[{engineVersion.SourceSHA![..7]}]({generalConfigurationOptions.CurrentValue.OpenDreamGitUrl}/commit/{engineVersion.SourceSHA})", true), _ => throw new InvalidOperationException($"Invaild EngineType: {engineVersion.Engine.Value}"), }; diff --git a/src/Tgstation.Server.Host/Components/Chat/Providers/ProviderFactory.cs b/src/Tgstation.Server.Host/Components/Chat/Providers/ProviderFactory.cs index ed3608b92da..08dea27de17 100644 --- a/src/Tgstation.Server.Host/Components/Chat/Providers/ProviderFactory.cs +++ b/src/Tgstation.Server.Host/Components/Chat/Providers/ProviderFactory.cs @@ -36,9 +36,9 @@ sealed class ProviderFactory : IProviderFactory readonly ILoggerFactory loggerFactory; /// - /// The for the . + /// The for the . /// - readonly GeneralConfiguration generalConfiguration; + readonly IOptionsMonitor generalConfigurationOptions; /// /// Initializes a new instance of the class. @@ -47,19 +47,19 @@ sealed class ProviderFactory : IProviderFactory /// The value of . /// The value of . /// The value of . - /// The containing the value of . + /// The value of . public ProviderFactory( IJobManager jobManager, IAssemblyInformationProvider assemblyInformationProvider, IAsyncDelayer asyncDelayer, ILoggerFactory loggerFactory, - IOptions generalConfigurationOptions) + IOptionsMonitor generalConfigurationOptions) { this.jobManager = jobManager ?? throw new ArgumentNullException(nameof(jobManager)); this.loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory)); this.asyncDelayer = asyncDelayer ?? throw new ArgumentNullException(nameof(asyncDelayer)); this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider)); - generalConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); + this.generalConfigurationOptions = generalConfigurationOptions ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); } /// @@ -79,8 +79,8 @@ public IProvider CreateProvider(Models.ChatBot settings) asyncDelayer, loggerFactory.CreateLogger(), assemblyInformationProvider, - settings, - generalConfiguration), + generalConfigurationOptions, + settings), _ => throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "Invalid ChatProvider: {0}", settings.Provider)), }; } From 74482638eefd86fec90216e15af66e865effbd82 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sun, 15 Sep 2024 11:28:40 -0400 Subject: [PATCH 2/4] Do not run CI on draft PRs --- .github/workflows/check-pr-has-milestone.yml | 1 + .github/workflows/ci-security.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-pr-has-milestone.yml b/.github/workflows/check-pr-has-milestone.yml index d2b5029d9a0..86d5c1b4736 100644 --- a/.github/workflows/check-pr-has-milestone.yml +++ b/.github/workflows/check-pr-has-milestone.yml @@ -13,6 +13,7 @@ concurrency: jobs: fail-on-bad-milestone: + if: github.event.pull_request.draft != true name: Fail if Pull Request has no Associated Version Milestone runs-on: ubuntu-latest steps: diff --git a/.github/workflows/ci-security.yml b/.github/workflows/ci-security.yml index a558d7c29b3..e9b0aa55e44 100644 --- a/.github/workflows/ci-security.yml +++ b/.github/workflows/ci-security.yml @@ -22,7 +22,7 @@ concurrency: jobs: security-checkpoint: name: Check CI Clearance - if: github.event_name == 'pull_request_target' && (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id || github.event.pull_request.user.id == 49699333) && github.event.pull_request.state == 'open' + if: github.event_name == 'pull_request_target' && (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id || github.event.pull_request.user.id == 49699333) && github.event.pull_request.state == 'open' && github.event.pull_request.draft != true runs-on: ubuntu-latest steps: - name: Generate App Token @@ -74,7 +74,7 @@ jobs: ci-pipline-workflow-call: name: CI Pipeline needs: security-checkpoint - if: (!(cancelled() || failure()) && (needs.security-checkpoint.result == 'success' || (github.event_name != 'pull_request_target' && github.event.pull_request.head.repo.id == github.event.pull_request.base.repo.id && github.event.pull_request.user.id != 49699333))) + if: (!(cancelled() || failure()) && (needs.security-checkpoint.result == 'success' || (github.event_name != 'pull_request_target' && github.event.pull_request.head.repo.id == github.event.pull_request.base.repo.id && github.event.pull_request.user.id != 49699333)) && github.event.pull_request.draft != true) uses: ./.github/workflows/ci-pipeline.yml secrets: inherit with: From 94e0e5611ef4b118f84692db3c1a515c636dbef7 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 19 Oct 2024 10:44:29 -0400 Subject: [PATCH 3/4] IOptionsMonitor for OpenDreamInstaller --- .../Components/Engine/OpenDreamInstaller.cs | 26 ++++++++++--------- .../Engine/WindowsOpenDreamInstaller.cs | 8 +++--- .../Engine/TestOpenDreamInstaller.cs | 8 +++--- .../Live/Instance/InstanceTest.cs | 6 ++--- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Engine/OpenDreamInstaller.cs b/src/Tgstation.Server.Host/Components/Engine/OpenDreamInstaller.cs index f37c4489b14..9a2915f38cf 100644 --- a/src/Tgstation.Server.Host/Components/Engine/OpenDreamInstaller.cs +++ b/src/Tgstation.Server.Host/Components/Engine/OpenDreamInstaller.cs @@ -54,12 +54,12 @@ class OpenDreamInstaller : EngineInstallerBase /// /// The for the . /// - protected GeneralConfiguration GeneralConfiguration { get; } + protected IOptionsMonitor GeneralConfiguration { get; } /// /// The for the . /// - protected SessionConfiguration SessionConfiguration { get; } + protected IOptionsMonitor SessionConfiguration { get; } /// /// The for the . @@ -101,8 +101,8 @@ public OpenDreamInstaller( IRepositoryManager repositoryManager, IAsyncDelayer asyncDelayer, IAbstractHttpClientFactory httpClientFactory, - IOptions generalConfigurationOptions, - IOptions sessionConfigurationOptions) + IOptionsMonitor generalConfigurationOptions, + IOptionsMonitor sessionConfigurationOptions) : base(ioManager, logger) { this.platformIdentifier = platformIdentifier ?? throw new ArgumentNullException(nameof(platformIdentifier)); @@ -110,8 +110,8 @@ public OpenDreamInstaller( this.repositoryManager = repositoryManager ?? throw new ArgumentNullException(nameof(repositoryManager)); this.asyncDelayer = asyncDelayer ?? throw new ArgumentNullException(nameof(asyncDelayer)); this.httpClientFactory = httpClientFactory ?? throw new ArgumentNullException(nameof(httpClientFactory)); - GeneralConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); - SessionConfiguration = sessionConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(sessionConfigurationOptions)); + GeneralConfiguration = generalConfigurationOptions ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); + SessionConfiguration = sessionConfigurationOptions ?? throw new ArgumentNullException(nameof(sessionConfigurationOptions)); } /// @@ -143,10 +143,11 @@ public override async ValueTask DownloadVersion(EngineV var progressSection1 = jobProgressReporter.CreateSection("Updating OpenDream git repository", 0.5f); IRepository? repo; + var generalConfig = GeneralConfiguration.CurrentValue; try { repo = await repositoryManager.CloneRepository( - GeneralConfiguration.OpenDreamGitUrl, + generalConfig.OpenDreamGitUrl, null, null, null, @@ -183,7 +184,7 @@ public override async ValueTask DownloadVersion(EngineV using (var progressSection2 = jobProgressReporter.CreateSection("Checking out OpenDream version", 0.5f)) { var committish = version.SourceSHA - ?? $"{GeneralConfiguration.OpenDreamGitTagPrefix}{version.Version!.Semver()}"; + ?? $"{generalConfig.OpenDreamGitTagPrefix}{version.Version!.Semver()}"; await repo.CheckoutObject( committish, @@ -259,6 +260,7 @@ await HandleExtremelyLongPathOperation( async shortenedPath => { var shortenedDeployPath = IOManager.ConcatPath(shortenedPath, DeployDir); + var generalConfig = GeneralConfiguration.CurrentValue; await using var buildProcess = await ProcessExecutor.LaunchProcess( dotnetPath, shortenedPath, @@ -266,17 +268,17 @@ await HandleExtremelyLongPathOperation( cancellationToken, null, null, - !GeneralConfiguration.OpenDreamSuppressInstallOutput, - !GeneralConfiguration.OpenDreamSuppressInstallOutput); + !generalConfig.OpenDreamSuppressInstallOutput, + !generalConfig.OpenDreamSuppressInstallOutput); - if (deploymentPipelineProcesses && SessionConfiguration.LowPriorityDeploymentProcesses) + if (deploymentPipelineProcesses && SessionConfiguration.CurrentValue.LowPriorityDeploymentProcesses) buildProcess.AdjustPriority(false); using (cancellationToken.Register(() => buildProcess.Terminate())) buildExitCode = await buildProcess.Lifetime; string? output; - if (!GeneralConfiguration.OpenDreamSuppressInstallOutput) + if (!GeneralConfiguration.CurrentValue.OpenDreamSuppressInstallOutput) { var buildOutputTask = buildProcess.GetCombinedOutput(cancellationToken); if (!buildOutputTask.IsCompleted) diff --git a/src/Tgstation.Server.Host/Components/Engine/WindowsOpenDreamInstaller.cs b/src/Tgstation.Server.Host/Components/Engine/WindowsOpenDreamInstaller.cs index 1cc8da52c5a..954197adec6 100644 --- a/src/Tgstation.Server.Host/Components/Engine/WindowsOpenDreamInstaller.cs +++ b/src/Tgstation.Server.Host/Components/Engine/WindowsOpenDreamInstaller.cs @@ -48,8 +48,8 @@ public WindowsOpenDreamInstaller( IRepositoryManager repositoryManager, IAsyncDelayer asyncDelayer, IAbstractHttpClientFactory httpClientFactory, - IOptions generalConfigurationOptions, - IOptions sessionConfigurationOptions, + IOptionsMonitor generalConfigurationOptions, + IOptionsMonitor sessionConfigurationOptions, IFilesystemLinkFactory linkFactory) : base( ioManager, @@ -108,7 +108,7 @@ protected override async ValueTask HandleExtremelyLongPathOperation(FuncA representing the running operation. async ValueTask AddServerFirewallException(EngineVersion version, string path, bool deploymentPipelineProcesses, CancellationToken cancellationToken) { - if (GeneralConfiguration.SkipAddingByondFirewallException) + if (GeneralConfiguration.CurrentValue.SkipAddingByondFirewallException) return; GetExecutablePaths(path, out var serverExePath, out _); @@ -126,7 +126,7 @@ async ValueTask AddServerFirewallException(EngineVersion version, string path, b Logger, ruleName, serverExePath, - deploymentPipelineProcesses && SessionConfiguration.LowPriorityDeploymentProcesses, + deploymentPipelineProcesses && SessionConfiguration.CurrentValue.LowPriorityDeploymentProcesses, cancellationToken); } catch (Exception ex) diff --git a/tests/Tgstation.Server.Host.Tests/Components/Engine/TestOpenDreamInstaller.cs b/tests/Tgstation.Server.Host.Tests/Components/Engine/TestOpenDreamInstaller.cs index 8950acc6ab6..148ade9ca07 100644 --- a/tests/Tgstation.Server.Host.Tests/Components/Engine/TestOpenDreamInstaller.cs +++ b/tests/Tgstation.Server.Host.Tests/Components/Engine/TestOpenDreamInstaller.cs @@ -36,13 +36,13 @@ public async Task TestDownloadsCloneRepositoryIfItDoesntExists() static async Task RepoDownloadTest(bool needsClone) { - var mockGeneralConfigOptions = new Mock>(); + var mockGeneralConfigOptions = new Mock>(); var generalConfig = new GeneralConfiguration(); - var mockSessionConfigOptions = new Mock>(); + var mockSessionConfigOptions = new Mock>(); var sessionConfig = new SessionConfiguration(); Assert.IsNotNull(generalConfig.OpenDreamGitUrl); - mockGeneralConfigOptions.SetupGet(x => x.Value).Returns(generalConfig); - mockSessionConfigOptions.SetupGet(x => x.Value).Returns(sessionConfig); + mockGeneralConfigOptions.SetupGet(x => x.CurrentValue).Returns(generalConfig); + mockSessionConfigOptions.SetupGet(x => x.CurrentValue).Returns(sessionConfig); var cloneAttempts = 0; var mockRepository = new Mock(); diff --git a/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs index 8bcd5ae04b2..76041a375f1 100644 --- a/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs +++ b/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs @@ -98,12 +98,12 @@ public static async ValueTask DownloadEngineVersion( "OpenDreamRepository"); var odRepoIoManager = new ResolvingIOManager(ioManager, odRepoDir); - var mockOptions = new Mock>(); + var mockOptions = new Mock>(); var genConfig = new GeneralConfiguration { OpenDreamGitUrl = openDreamUrl, }; - mockOptions.SetupGet(x => x.Value).Returns(genConfig); + mockOptions.SetupGet(x => x.CurrentValue).Returns(genConfig); IEngineInstaller byondInstaller = compatVersion.Engine == EngineType.OpenDream ? new OpenDreamInstaller( @@ -125,7 +125,7 @@ public static async ValueTask DownloadEngineVersion( Mock.Of(), Mock.Of(), mockOptions.Object, - Options.Create(new SessionConfiguration())) + Mock.Of>()) : new PlatformIdentifier().IsWindows ? new WindowsByondInstaller( Mock.Of(), From 5930b51e0b82904dba2eed458ea4474f6be83d5d Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 19 Oct 2024 10:52:54 -0400 Subject: [PATCH 4/4] IOptionsMonitor for WindowsByondInstaller --- .../Engine/WindowsByondInstaller.cs | 28 +++++++++---------- .../Live/Instance/EngineTest.cs | 8 +++--- .../Live/Instance/InstanceTest.cs | 5 ++-- tests/Tgstation.Server.Tests/TestVersions.cs | 16 +++++------ 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Engine/WindowsByondInstaller.cs b/src/Tgstation.Server.Host/Components/Engine/WindowsByondInstaller.cs index ce2c7704e22..971800885f1 100644 --- a/src/Tgstation.Server.Host/Components/Engine/WindowsByondInstaller.cs +++ b/src/Tgstation.Server.Host/Components/Engine/WindowsByondInstaller.cs @@ -77,14 +77,14 @@ sealed class WindowsByondInstaller : ByondInstallerBase, IDisposable readonly IProcessExecutor processExecutor; /// - /// The for the . + /// The for the . /// - readonly GeneralConfiguration generalConfiguration; + readonly IOptionsMonitor generalConfigurationOptions; /// - /// The for the . + /// The for the . /// - readonly SessionConfiguration sessionConfiguration; + readonly IOptionsMonitor sessionConfigurationOptions; /// /// The for the . @@ -100,8 +100,8 @@ sealed class WindowsByondInstaller : ByondInstallerBase, IDisposable /// Initializes a new instance of the class. /// /// The value of . - /// The containing the value of . - /// The containing the value of . + /// The containing the value of . + /// The containing the value of . /// The for the . /// The for the . /// The for the . @@ -109,14 +109,14 @@ public WindowsByondInstaller( IProcessExecutor processExecutor, IIOManager ioManager, IFileDownloader fileDownloader, - IOptions generalConfigurationOptions, - IOptions sessionConfigurationOptions, + IOptionsMonitor generalConfigurationOptions, + IOptionsMonitor sessionConfigurationOptions, ILogger logger) : base(ioManager, logger, fileDownloader) { this.processExecutor = processExecutor ?? throw new ArgumentNullException(nameof(processExecutor)); - generalConfiguration = generalConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); - sessionConfiguration = sessionConfigurationOptions?.Value ?? throw new ArgumentNullException(nameof(sessionConfigurationOptions)); + this.generalConfigurationOptions = generalConfigurationOptions ?? throw new ArgumentNullException(nameof(generalConfigurationOptions)); + this.sessionConfigurationOptions = sessionConfigurationOptions ?? throw new ArgumentNullException(nameof(sessionConfigurationOptions)); var useServiceSpecialTactics = Environment.Is64BitProcess && Environment.UserName == $"{Environment.MachineName}$"; @@ -150,7 +150,7 @@ public override ValueTask Install(EngineVersion version, string path, bool deplo installDirectXTask, }; - if (!generalConfiguration.SkipAddingByondFirewallException) + if (!generalConfigurationOptions.CurrentValue.SkipAddingByondFirewallException) { var firewallTask = AddDreamDaemonToFirewall(version, path, deploymentPipelineProcesses, cancellationToken); tasks.Add(firewallTask); @@ -165,7 +165,7 @@ public override async ValueTask UpgradeInstallation(EngineVersion version, strin CheckVersionValidity(version); ArgumentNullException.ThrowIfNull(path); - if (generalConfiguration.SkipAddingByondFirewallException) + if (generalConfigurationOptions.CurrentValue.SkipAddingByondFirewallException) return; if (version.Version < DDExeVersion) @@ -224,7 +224,7 @@ public override async ValueTask TrustDmbPath(EngineVersion version, string fullD /// protected override string GetDreamDaemonName(Version byondVersion, out bool supportsCli) { - supportsCli = byondVersion >= DDExeVersion && !sessionConfiguration.ForceUseDreamDaemonExe; + supportsCli = byondVersion >= DDExeVersion && !sessionConfigurationOptions.CurrentValue.ForceUseDreamDaemonExe; return supportsCli ? "dd.exe" : "dreamdaemon.exe"; } @@ -336,7 +336,7 @@ async ValueTask AddDreamDaemonToFirewall(EngineVersion version, string path, boo Logger, ruleName, dreamDaemonPath, - deploymentPipelineProcesses && sessionConfiguration.LowPriorityDeploymentProcesses, + deploymentPipelineProcesses && sessionConfigurationOptions.CurrentValue.LowPriorityDeploymentProcesses, cancellationToken); } catch (Exception ex) diff --git a/tests/Tgstation.Server.Tests/Live/Instance/EngineTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/EngineTest.cs index ffdaeb63e4a..dc19ed91de1 100644 --- a/tests/Tgstation.Server.Tests/Live/Instance/EngineTest.cs +++ b/tests/Tgstation.Server.Tests/Live/Instance/EngineTest.cs @@ -284,10 +284,10 @@ async Task TestNoVersion(CancellationToken cancellationToken) async Task TestCustomInstalls(CancellationToken cancellationToken) { - var generalConfigOptionsMock = new Mock>(); - generalConfigOptionsMock.SetupGet(x => x.Value).Returns(new GeneralConfiguration()); - var sessionConfigOptionsMock = new Mock>(); - sessionConfigOptionsMock.SetupGet(x => x.Value).Returns(new SessionConfiguration()); + var generalConfigOptionsMock = new Mock>(); + generalConfigOptionsMock.SetupGet(x => x.CurrentValue).Returns(new GeneralConfiguration()); + var sessionConfigOptionsMock = new Mock>(); + sessionConfigOptionsMock.SetupGet(x => x.CurrentValue).Returns(new SessionConfiguration()); var assemblyInformationProvider = new AssemblyInformationProvider(); diff --git a/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs index 76041a375f1..834cfb38370 100644 --- a/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs +++ b/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs @@ -103,6 +103,7 @@ public static async ValueTask DownloadEngineVersion( { OpenDreamGitUrl = openDreamUrl, }; + mockOptions.SetupGet(x => x.CurrentValue).Returns(genConfig); IEngineInstaller byondInstaller = compatVersion.Engine == EngineType.OpenDream @@ -131,8 +132,8 @@ public static async ValueTask DownloadEngineVersion( Mock.Of(), Mock.Of(), fileDownloader, - Options.Create(genConfig), - Options.Create(new SessionConfiguration()), + Mock.Of>(), + Mock.Of>(), Mock.Of>()) : new PosixByondInstaller( Mock.Of(), diff --git a/tests/Tgstation.Server.Tests/TestVersions.cs b/tests/Tgstation.Server.Tests/TestVersions.cs index a0809b78f6c..0f13dd830af 100644 --- a/tests/Tgstation.Server.Tests/TestVersions.cs +++ b/tests/Tgstation.Server.Tests/TestVersions.cs @@ -105,10 +105,10 @@ public void TestApiLibraryVersion() [TestMethod] public async Task TestDDExeByondVersion() { - var mockGeneralConfigurationOptions = new Mock>(); - mockGeneralConfigurationOptions.SetupGet(x => x.Value).Returns(new GeneralConfiguration()); - var mockSessionConfigurationOptions = new Mock>(); - mockSessionConfigurationOptions.SetupGet(x => x.Value).Returns(new SessionConfiguration()); + var mockGeneralConfigurationOptions = new Mock>(); + mockGeneralConfigurationOptions.SetupGet(x => x.CurrentValue).Returns(new GeneralConfiguration()); + var mockSessionConfigurationOptions = new Mock>(); + mockSessionConfigurationOptions.SetupGet(x => x.CurrentValue).Returns(new SessionConfiguration()); using var loggerFactory = LoggerFactory.Create(builder => { @@ -167,13 +167,13 @@ await byondInstaller.DownloadVersion( [TestMethod] public async Task TestMapThreadsByondVersion() { - var mockGeneralConfigurationOptions = new Mock>(); - mockGeneralConfigurationOptions.SetupGet(x => x.Value).Returns(new GeneralConfiguration + var mockGeneralConfigurationOptions = new Mock>(); + mockGeneralConfigurationOptions.SetupGet(x => x.CurrentValue).Returns(new GeneralConfiguration { SkipAddingByondFirewallException = true, }); - var mockSessionConfigurationOptions = new Mock>(); - mockSessionConfigurationOptions.SetupGet(x => x.Value).Returns(new SessionConfiguration()); + var mockSessionConfigurationOptions = new Mock>(); + mockSessionConfigurationOptions.SetupGet(x => x.CurrentValue).Returns(new SessionConfiguration()); using var loggerFactory = LoggerFactory.Create(builder => {