Skip to content

Commit

Permalink
Don't try and use a repo GitHub token if testing OD exclusively
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberboss committed Sep 5, 2024
1 parent 1c234b1 commit 2df11b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/Tgstation.Server.Tests/Live/Instance/InstanceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ await Task.WhenAll(

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,
Expand Down
3 changes: 2 additions & 1 deletion tests/Tgstation.Server.Tests/Live/Instance/RepositoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ public async Task AbortLongCloneAndCloneSomethingQuick(Task<JobResponse> longClo
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,
Expand Down
2 changes: 1 addition & 1 deletion tests/Tgstation.Server.Tests/Live/TestLiveServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ await instanceClient.DreamDaemon.Update(new DreamDaemonRequest
[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);
Expand Down

0 comments on commit 2df11b4

Please sign in to comment.