-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
11291: [auto/go] Test remote operations r=justinvp a=justinvp Also cleans up some error messages to be consistent with the CLI and other languages. Related: - #11290 - #11292 - #11293 - #11294 11294: [auto/dotnet] Test remote operations r=justinvp a=justinvp Also cleans up some error messages to be consistent with the CLI and other languages. Related: - #11290 - #11291 - #11292 - #11293 Co-authored-by: Justin Van Patten <jvp@justinvp.com>
- Loading branch information
Showing
7 changed files
with
473 additions
and
31 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
sdk/dotnet/Pulumi.Automation.Tests/DeploymentsApiFactAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2016-2022, Pulumi Corporation | ||
|
||
using System; | ||
using Xunit; | ||
|
||
namespace Pulumi.Automation.Tests | ||
{ | ||
public sealed class DeploymentsApiFactAttribute : FactAttribute | ||
{ | ||
public DeploymentsApiFactAttribute() | ||
{ | ||
if (Environment.GetEnvironmentVariable("PULUMI_ACCESS_TOKEN") is null) | ||
{ | ||
Skip = "PULUMI_ACCESS_TOKEN not set"; | ||
} | ||
else if (Environment.GetEnvironmentVariable("PULUMI_TEST_DEPLOYMENTS_API") is null) | ||
{ | ||
Skip = "PULUMI_TEST_DEPLOYMENTS_API not set"; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
199 changes: 199 additions & 0 deletions
199
sdk/dotnet/Pulumi.Automation.Tests/RemoteWorkspaceTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2016-2022, Pulumi Corporation | ||
|
||
using System; | ||
using System.Linq; | ||
|
||
namespace Pulumi.Automation.Tests | ||
{ | ||
public static class Utility | ||
{ | ||
public static string GetTestSuffix() | ||
{ | ||
var random = new Random(); | ||
var result = random.Next(); // 31 bits, highest bit will be 0 (signed) | ||
return result.ToString("x"); // 8 hex characters | ||
} | ||
|
||
public static string RandomStackName() | ||
{ | ||
const string chars = "abcdefghijklmnopqrstuvwxyz"; | ||
return new string(Enumerable.Range(1, 8).Select(_ => chars[new Random().Next(chars.Length)]).ToArray()); | ||
} | ||
|
||
public static string GetTestOrg() | ||
=> Environment.GetEnvironmentVariable("PULUMI_TEST_ORG") ?? "pulumi-test"; | ||
|
||
public static string FullyQualifiedStackName(string org, string project, string stack) | ||
=> $"{org}/{project}/{stack}"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.