From 2f93bc3e63d11ae3bd67db17d4a72d646cb57441 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Mon, 24 Oct 2022 15:04:48 +0800 Subject: [PATCH] Remove Run Task beta notes Pre-plan and Pre-Apply Run Tasks are now generally available. This commit removes the beta notices. --- workspace_run_task.go | 4 +- workspace_run_task_integration_test.go | 71 -------------------------- 2 files changed, 2 insertions(+), 73 deletions(-) diff --git a/workspace_run_task.go b/workspace_run_task.go index 6fe75c7d4..41bdef1d4 100644 --- a/workspace_run_task.go +++ b/workspace_run_task.go @@ -60,7 +60,7 @@ type WorkspaceRunTaskCreateOptions struct { EnforcementLevel TaskEnforcementLevel `jsonapi:"attr,enforcement-level"` // Required: The run task to attach to the workspace RunTask *RunTask `jsonapi:"relation,task"` - // Optional: The stage to run the task in. This is currently in BETA + // Optional: The stage to run the task in Stage *Stage `jsonapi:"attr,stage,omitempty"` } @@ -68,7 +68,7 @@ type WorkspaceRunTaskCreateOptions struct { type WorkspaceRunTaskUpdateOptions struct { Type string `jsonapi:"primary,workspace-tasks"` EnforcementLevel TaskEnforcementLevel `jsonapi:"attr,enforcement-level,omitempty"` - Stage *Stage `jsonapi:"attr,stage,omitempty"` // The stage to run the task in. This is currently in BETA + Stage *Stage `jsonapi:"attr,stage,omitempty"` // The stage to run the task in } // List all run tasks attached to a workspace diff --git a/workspace_run_task_integration_test.go b/workspace_run_task_integration_test.go index 13fd5adde..fe63974de 100644 --- a/workspace_run_task_integration_test.go +++ b/workspace_run_task_integration_test.go @@ -12,45 +12,8 @@ import ( ) func TestWorkspaceRunTasksCreate(t *testing.T) { - skipIfNotCINode(t) - skipIfFreeOnly(t) - - client := testClient(t) - ctx := context.Background() - - orgTest, orgTestCleanup := createOrganization(t, client) - defer orgTestCleanup() - - runTaskTest, runTaskTestCleanup := createRunTask(t, client, orgTest) - defer runTaskTestCleanup() - - wkspaceTest, wkspaceTestCleanup := createWorkspace(t, client, orgTest) - defer wkspaceTestCleanup() - - t.Run("attach run task to workspace", func(t *testing.T) { - wr, err := client.WorkspaceRunTasks.Create(ctx, wkspaceTest.ID, WorkspaceRunTaskCreateOptions{ - EnforcementLevel: Mandatory, - RunTask: runTaskTest, - }) - - require.NoError(t, err) - defer func() { - client.WorkspaceRunTasks.Delete(ctx, wkspaceTest.ID, wr.ID) - }() - - assert.NotEmpty(t, wr.ID) - assert.Equal(t, wr.EnforcementLevel, Mandatory) - - t.Run("ensure run task is deserialized properly", func(t *testing.T) { - assert.NotEmpty(t, wr.RunTask.ID) - }) - }) -} - -func TestWorkspaceRunTasksCreateBeta(t *testing.T) { // Once Pre-Plan Tasks are generally available, this can replace the above TestWorkspaceRunTasksCreate skipIfNotCINode(t) - skipIfBeta(t) skipIfFreeOnly(t) client := testClient(t) @@ -179,40 +142,6 @@ func TestWorkspaceRunTasksUpdate(t *testing.T) { wrTaskTest, wrTaskTestCleanup := createWorkspaceRunTask(t, client, wkspaceTest, runTaskTest) defer wrTaskTestCleanup() - t.Run("rename task", func(t *testing.T) { - wr, err := client.WorkspaceRunTasks.Update(ctx, wkspaceTest.ID, wrTaskTest.ID, WorkspaceRunTaskUpdateOptions{ - EnforcementLevel: Mandatory, - }) - require.NoError(t, err) - - wr, err = client.WorkspaceRunTasks.Read(ctx, wkspaceTest.ID, wr.ID) - require.NoError(t, err) - - assert.Equal(t, wr.EnforcementLevel, Mandatory) - }) -} - -func TestWorkspaceRunTasksUpdateBeta(t *testing.T) { - // Once Pre-Plan Tasks are generally available, this can replace the above TestWorkspaceRunTasksUpdate - skipIfNotCINode(t) - skipIfBeta(t) - skipIfFreeOnly(t) - - client := testClient(t) - ctx := context.Background() - - orgTest, orgTestCleanup := createOrganization(t, client) - defer orgTestCleanup() - - wkspaceTest, wkspaceTestCleanup := createWorkspace(t, client, orgTest) - defer wkspaceTestCleanup() - - runTaskTest, runTaskTestCleanup := createRunTask(t, client, orgTest) - defer runTaskTestCleanup() - - wrTaskTest, wrTaskTestCleanup := createWorkspaceRunTask(t, client, wkspaceTest, runTaskTest) - defer wrTaskTestCleanup() - t.Run("update task", func(t *testing.T) { stage := PrePlan wr, err := client.WorkspaceRunTasks.Update(ctx, wkspaceTest.ID, wrTaskTest.ID, WorkspaceRunTaskUpdateOptions{