Don't try and use a repo GitHub token if testing OD exclusively

This commit is contained in:
Jordan Dominion
2024-09-05 17:09:41 -04:00
parent 1c234b184d
commit 2df11b4bb8
3 changed files with 5 additions and 3 deletions
@@ -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,
@@ -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,
@@ -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);