From 26355180cdefb5c801054b54978c8290827c700a Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Wed, 29 Jun 2022 11:37:32 +0800 Subject: [PATCH] Revert "{WIP} Update run tasks as not beta" This reverts commit afae1620f38f1c55fa241b82055fd640e83b1060. --- helper_test.go | 11 ++++------- run_task.go | 9 +++++---- run_task_integration_test.go | 12 ++++++------ workspace_run_task_integration_test.go | 10 +++++----- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/helper_test.go b/helper_test.go index 08dbe1a02..cb3b8c2c6 100644 --- a/helper_test.go +++ b/helper_test.go @@ -1189,14 +1189,11 @@ func createWorkspaceWithOptions(t *testing.T, client *Client, org *Organization, return w, func() { if err := client.Workspaces.Delete(ctx, org.Name, w.Name); err != nil { - if errors.Is(err, ErrResourceNotFound) { - t.Logf("Cannot cleanup Workspace %s as it does not exist.", w.Name) - } else { - t.Errorf("Error destroying workspace! WARNING: Dangling resources\n"+ - "may exist! The full error is shown below.\n\n"+ - "Workspace: %s\nError: %s", w.Name, err) - } + t.Errorf("Error destroying workspace! WARNING: Dangling resources\n"+ + "may exist! The full error is shown below.\n\n"+ + "Workspace: %s\nError: %s", w.Name, err) } + if orgCleanup != nil { orgCleanup() } diff --git a/run_task.go b/run_task.go index 63e66f7f1..ffbaf0d17 100644 --- a/run_task.go +++ b/run_task.go @@ -11,7 +11,8 @@ var _ RunTasks = (*runTasks)(nil) // RunTasks represents all the run task related methods in the context of an organization // that the Terraform Cloud/Enterprise API supports. -// https://www.terraform.io/cloud-docs/api-docs/run-tasks/run-tasks#run-tasks-api +// **Note: This API is still in BETA and subject to change.** +// https://www.terraform.io/cloud-docs/api-docs/run-tasks#run-tasks-api type RunTasks interface { // Create a run task for an organization Create(ctx context.Context, organization string, options RunTaskCreateOptions) (*RunTask, error) @@ -60,7 +61,7 @@ type RunTaskList struct { } // RunTaskIncludeOpt represents the available options for include query params. -// https://www.terraform.io/cloud-docs/api-docs/run-tasks/run-tasks#list-run-tasks +// https://www.terraform.io/cloud-docs/api-docs/run-tasks#list-run-tasks type RunTaskIncludeOpt string const ( @@ -72,14 +73,14 @@ const ( type RunTaskListOptions struct { ListOptions // Optional: A list of relations to include with a run task. See available resources: - // https://www.terraform.io/cloud-docs/api-docs/run-tasks/run-tasks#list-run-tasks + // https://www.terraform.io/cloud-docs/api-docs/run-tasks#list-run-tasks Include []RunTaskIncludeOpt `url:"include,omitempty"` } // RunTaskReadOptions represents the set of options for reading a run task type RunTaskReadOptions struct { // Optional: A list of relations to include with a run task. See available resources: - // https://www.terraform.io/cloud-docs/api-docs/run-tasks/run-tasks#list-run-tasks + // https://www.terraform.io/cloud-docs/api-docs/run-tasks#list-run-tasks Include []RunTaskIncludeOpt `url:"include,omitempty"` } diff --git a/run_task_integration_test.go b/run_task_integration_test.go index baf9ab6d8..e9d08a4d3 100644 --- a/run_task_integration_test.go +++ b/run_task_integration_test.go @@ -13,7 +13,7 @@ import ( ) func TestRunTasksCreate(t *testing.T) { - skipIfFreeOnly(t) + skipIfBeta(t) client := testClient(t) ctx := context.Background() @@ -49,7 +49,7 @@ func TestRunTasksCreate(t *testing.T) { } func TestRunTasksList(t *testing.T) { - skipIfFreeOnly(t) + skipIfBeta(t) client := testClient(t) ctx := context.Background() @@ -75,7 +75,7 @@ func TestRunTasksList(t *testing.T) { } func TestRunTasksRead(t *testing.T) { - skipIfFreeOnly(t) + skipIfBeta(t) client := testClient(t) ctx := context.Background() @@ -125,7 +125,7 @@ func TestRunTasksRead(t *testing.T) { } func TestRunTasksUpdate(t *testing.T) { - skipIfFreeOnly(t) + skipIfBeta(t) client := testClient(t) ctx := context.Background() @@ -151,7 +151,7 @@ func TestRunTasksUpdate(t *testing.T) { } func TestRunTasksDelete(t *testing.T) { - skipIfFreeOnly(t) + skipIfBeta(t) client := testClient(t) ctx := context.Background() @@ -181,7 +181,7 @@ func TestRunTasksDelete(t *testing.T) { } func TestRunTasksAttachToWorkspace(t *testing.T) { - skipIfFreeOnly(t) + skipIfBeta(t) client := testClient(t) ctx := context.Background() diff --git a/workspace_run_task_integration_test.go b/workspace_run_task_integration_test.go index 87eae63fc..234033588 100644 --- a/workspace_run_task_integration_test.go +++ b/workspace_run_task_integration_test.go @@ -12,7 +12,7 @@ import ( ) func TestWorkspaceRunTasksCreate(t *testing.T) { - skipIfFreeOnly(t) + skipIfBeta(t) client := testClient(t) ctx := context.Background() @@ -43,7 +43,7 @@ func TestWorkspaceRunTasksCreate(t *testing.T) { } func TestWorkspaceRunTasksList(t *testing.T) { - skipIfFreeOnly(t) + skipIfBeta(t) client := testClient(t) ctx := context.Background() @@ -77,7 +77,7 @@ func TestWorkspaceRunTasksList(t *testing.T) { } func TestWorkspaceRunTasksRead(t *testing.T) { - skipIfFreeOnly(t) + skipIfBeta(t) client := testClient(t) ctx := context.Background() @@ -112,7 +112,7 @@ func TestWorkspaceRunTasksRead(t *testing.T) { } func TestWorkspaceRunTasksUpdate(t *testing.T) { - skipIfFreeOnly(t) + skipIfBeta(t) client := testClient(t) ctx := context.Background() @@ -143,7 +143,7 @@ func TestWorkspaceRunTasksUpdate(t *testing.T) { } func TestWorkspaceRunTasksDelete(t *testing.T) { - skipIfFreeOnly(t) + skipIfBeta(t) client := testClient(t) ctx := context.Background()