mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
Add gate for TFE tests that use the network (#997)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
@@ -38,7 +38,7 @@ func TestCloud_showMissingRun(t *testing.T) {
|
||||
mockSROWorkspace(t, b, testBackendSingleWorkspaceName)
|
||||
|
||||
absentRunID := "run-WwwwXxxxYyyyZzzz"
|
||||
_, err := b.ShowPlanForRun(context.Background(), absentRunID, "app.terraform.io", true)
|
||||
_, err := b.ShowPlanForRun(context.Background(), absentRunID, tfeHost, true)
|
||||
if !strings.Contains(err.Error(), "tofu login") {
|
||||
t.Fatalf("expected error message to suggest checking your login status, instead got: %s", err)
|
||||
}
|
||||
@@ -57,7 +57,7 @@ func TestCloud_showMissingUnredactedJson(t *testing.T) {
|
||||
t.Fatalf("failed to init test data: %s", err)
|
||||
}
|
||||
// Showing the human-formatted plan should still work as expected!
|
||||
redacted, err := b.ShowPlanForRun(ctx, runID, "app.terraform.io", true)
|
||||
redacted, err := b.ShowPlanForRun(ctx, runID, tfeHost, true)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to show plan for human, even though redacted json should be present: %s", err)
|
||||
}
|
||||
@@ -80,7 +80,7 @@ func TestCloud_showMissingUnredactedJson(t *testing.T) {
|
||||
}
|
||||
|
||||
// But show -json should result in a special error.
|
||||
_, err = b.ShowPlanForRun(ctx, runID, "app.terraform.io", false)
|
||||
_, err = b.ShowPlanForRun(ctx, runID, tfeHost, false)
|
||||
if err == nil {
|
||||
t.Fatalf("unexpected success: reading unredacted json without admin permissions should have errored")
|
||||
}
|
||||
@@ -102,7 +102,7 @@ func TestCloud_showIncludesUnredactedJson(t *testing.T) {
|
||||
t.Fatalf("failed to init test data: %s", err)
|
||||
}
|
||||
// Showing the human-formatted plan should work as expected:
|
||||
redacted, err := b.ShowPlanForRun(ctx, runID, "app.terraform.io", true)
|
||||
redacted, err := b.ShowPlanForRun(ctx, runID, tfeHost, true)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to show plan for human, even though redacted json should be present: %s", err)
|
||||
}
|
||||
@@ -110,7 +110,7 @@ func TestCloud_showIncludesUnredactedJson(t *testing.T) {
|
||||
t.Fatalf("show for human doesn't include expected redacted json content")
|
||||
}
|
||||
// Showing the external json plan format should work as expected:
|
||||
unredacted, err := b.ShowPlanForRun(ctx, runID, "app.terraform.io", false)
|
||||
unredacted, err := b.ShowPlanForRun(ctx, runID, tfeHost, false)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to show plan for robot, even though unredacted json should be present: %s", err)
|
||||
}
|
||||
@@ -131,7 +131,7 @@ func TestCloud_showNoChanges(t *testing.T) {
|
||||
t.Fatalf("failed to init test data: %s", err)
|
||||
}
|
||||
// Showing the human-formatted plan should work as expected:
|
||||
redacted, err := b.ShowPlanForRun(ctx, runID, "app.terraform.io", true)
|
||||
redacted, err := b.ShowPlanForRun(ctx, runID, tfeHost, true)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to show plan for human, even though redacted json should be present: %s", err)
|
||||
}
|
||||
@@ -163,7 +163,7 @@ func TestCloud_showFooterNotConfirmable(t *testing.T) {
|
||||
mc.Runs.Runs[runID].Actions.IsConfirmable = false
|
||||
|
||||
// Showing the human-formatted plan should work as expected:
|
||||
redacted, err := b.ShowPlanForRun(ctx, runID, "app.terraform.io", true)
|
||||
redacted, err := b.ShowPlanForRun(ctx, runID, tfeHost, true)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to show plan for human, even though redacted json should be present: %s", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user