Skip to content

Commit

Permalink
Remove Run Task beta notes
Browse files Browse the repository at this point in the history
Pre-plan and Pre-Apply Run Tasks are now generally available. This commit
removes the beta notices.
  • Loading branch information
glennsarti committed Oct 24, 2022
1 parent 94a36e6 commit 2f93bc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 73 deletions.
4 changes: 2 additions & 2 deletions workspace_run_task.go
Expand Up @@ -60,15 +60,15 @@ 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"`
}

// WorkspaceRunTaskUpdateOptions represent the set of options for updating a workspace run task.
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
Expand Down
71 changes: 0 additions & 71 deletions workspace_run_task_integration_test.go
Expand Up @@ -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)
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 2f93bc3

Please sign in to comment.