From 2df11b4bb87b503337d0ec93588fe76748403db9 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Thu, 5 Sep 2024 17:09:41 -0400 Subject: [PATCH] Don't try and use a repo GitHub token if testing OD exclusively --- tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs | 3 ++- tests/Tgstation.Server.Tests/Live/Instance/RepositoryTest.cs | 3 ++- tests/Tgstation.Server.Tests/Live/TestLiveServer.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs index 67ed9e2178..8bcd5ae04b 100644 --- a/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs +++ b/tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs @@ -274,7 +274,8 @@ namespace Tgstation.Server.Tests.Live.Instance var configSetupTask = new ConfigurationTest(instanceClient.Configuration, instanceClient.Metadata).SetupDMApiTests(true, cancellationToken); - if (!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("TGS_TEST_GITHUB_TOKEN"))) + if (!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("TGS_TEST_GITHUB_TOKEN")) + && !(Boolean.TryParse(Environment.GetEnvironmentVariable("TGS_TEST_OD_EXCLUSIVE"), out var odExclusive) && odExclusive)) await instanceClient.Repository.Update(new RepositoryUpdateRequest { CreateGitHubDeployments = true, diff --git a/tests/Tgstation.Server.Tests/Live/Instance/RepositoryTest.cs b/tests/Tgstation.Server.Tests/Live/Instance/RepositoryTest.cs index 06de611545..4179a82cc1 100644 --- a/tests/Tgstation.Server.Tests/Live/Instance/RepositoryTest.cs +++ b/tests/Tgstation.Server.Tests/Live/Instance/RepositoryTest.cs @@ -128,7 +128,8 @@ namespace Tgstation.Server.Tests.Live.Instance updated = await Checkout(new RepositoryUpdateRequest { Reference = "master" }, false, true, cancellationToken); // enable the good shit if possible - if (!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("TGS_TEST_GITHUB_TOKEN"))) + if (!String.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("TGS_TEST_GITHUB_TOKEN")) + && !(Boolean.TryParse(Environment.GetEnvironmentVariable("TGS_TEST_OD_EXCLUSIVE"), out var odExclusive) && odExclusive)) await repositoryClient.Update(new RepositoryUpdateRequest { CreateGitHubDeployments = true, diff --git a/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs b/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs index b34b14f066..7ead802091 100644 --- a/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs +++ b/tests/Tgstation.Server.Tests/Live/TestLiveServer.cs @@ -1228,7 +1228,7 @@ namespace Tgstation.Server.Tests.Live [TestMethod] public Task TestOpenDreamExclusiveTgsOperation() { - if (Environment.GetEnvironmentVariable("TGS_TEST_OD_EXCLUSIVE") != "true") + if (!Boolean.TryParse(Environment.GetEnvironmentVariable("TGS_TEST_OD_EXCLUSIVE"), out var odExclusive) || !odExclusive) Assert.Inconclusive("This test is covered by TestStandardTgsOperation"); return TestStandardTgsOperation(true);