Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/clitest/golden.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ExtractCommandPathsLoop:
for _, tt := range cases {
t.Run(tt.Name, func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)

var outBuf bytes.Buffer

Expand Down Expand Up @@ -249,7 +249,7 @@ func extractVisibleCommandPaths(cmdPath []string, cmds []*serpent.Command) [][]s
func prepareTestData(t *testing.T) (*codersdk.Client, map[string]string) {
t.Helper()

ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitSuperLong)
defer cancel()

// This needs to be a fixed timezone because timezones increase the length
Expand Down
42 changes: 21 additions & 21 deletions cli/task_logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ func Test_TaskLogs_Golden(t *testing.T) {
t.Run("ByTaskName_JSON", func(t *testing.T) {
t.Parallel()

setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, fakeAgentAPITaskLogsOK(testMessages))

inv, root := clitest.New(t, "task", "logs", setup.task.Name, "--output", "json")
output := clitest.Capture(inv)
clitest.SetupConfig(t, setup.userClient, root)

ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)
err := inv.WithContext(ctx).Run()
require.NoError(t, err)

Expand All @@ -63,14 +63,14 @@ func Test_TaskLogs_Golden(t *testing.T) {
t.Run("ByTaskID_JSON", func(t *testing.T) {
t.Parallel()

setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, fakeAgentAPITaskLogsOK(testMessages))

inv, root := clitest.New(t, "task", "logs", setup.task.ID.String(), "--output", "json")
output := clitest.Capture(inv)
clitest.SetupConfig(t, setup.userClient, root)

ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)
err := inv.WithContext(ctx).Run()
require.NoError(t, err)

Expand All @@ -86,14 +86,14 @@ func Test_TaskLogs_Golden(t *testing.T) {
t.Run("ByTaskID_Table", func(t *testing.T) {
t.Parallel()

setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, fakeAgentAPITaskLogsOK(testMessages))

inv, root := clitest.New(t, "task", "logs", setup.task.ID.String())
output := clitest.Capture(inv)
clitest.SetupConfig(t, setup.userClient, root)

ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)
err := inv.WithContext(ctx).Run()
require.NoError(t, err)

Expand All @@ -103,7 +103,7 @@ func Test_TaskLogs_Golden(t *testing.T) {

t.Run("TaskNotFound_ByName", func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)

client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
owner := coderdtest.CreateFirstUser(t, client)
Expand All @@ -121,7 +121,7 @@ func Test_TaskLogs_Golden(t *testing.T) {

t.Run("TaskNotFound_ByID", func(t *testing.T) {
t.Parallel()
ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)

client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
owner := coderdtest.CreateFirstUser(t, client)
Expand All @@ -140,29 +140,29 @@ func Test_TaskLogs_Golden(t *testing.T) {
t.Run("ErrorFetchingLogs", func(t *testing.T) {
t.Parallel()

setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, fakeAgentAPITaskLogsErr(assert.AnError))

inv, root := clitest.New(t, "task", "logs", setup.task.ID.String())
clitest.SetupConfig(t, setup.userClient, root)

ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)
err := inv.WithContext(ctx).Run()
require.ErrorContains(t, err, assert.AnError.Error())
})

t.Run("SnapshotWithLogs_Table", func(t *testing.T) {
t.Parallel()

setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
client, task := setupCLITaskTestWithSnapshot(setupCtx, t, codersdk.TaskStatusPaused, testMessages)
userClient := client

inv, root := clitest.New(t, "task", "logs", task.Name)
output := clitest.Capture(inv)
clitest.SetupConfig(t, userClient, root)

ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)
err := inv.WithContext(ctx).Run()
require.NoError(t, err)

Expand All @@ -173,15 +173,15 @@ func Test_TaskLogs_Golden(t *testing.T) {
t.Run("SnapshotWithLogs_JSON", func(t *testing.T) {
t.Parallel()

setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
client, task := setupCLITaskTestWithSnapshot(setupCtx, t, codersdk.TaskStatusPaused, testMessages)
userClient := client

inv, root := clitest.New(t, "task", "logs", task.Name, "--output", "json")
output := clitest.Capture(inv)
clitest.SetupConfig(t, userClient, root)

ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)
err := inv.WithContext(ctx).Run()
require.NoError(t, err)

Expand All @@ -203,7 +203,7 @@ func Test_TaskLogs_Golden(t *testing.T) {
output := clitest.Capture(inv)
clitest.SetupConfig(t, userClient, root)

ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)
err := inv.WithContext(ctx).Run()
require.NoError(t, err)

Expand All @@ -223,15 +223,15 @@ func Test_TaskLogs_Golden(t *testing.T) {
},
}

setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
client, task := setupCLITaskTestWithSnapshot(setupCtx, t, codersdk.TaskStatusPending, singleMessage)
userClient := client

inv, root := clitest.New(t, "task", "logs", task.Name)
output := clitest.Capture(inv)
clitest.SetupConfig(t, userClient, root)

ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)
err := inv.WithContext(ctx).Run()
require.NoError(t, err)

Expand All @@ -242,15 +242,15 @@ func Test_TaskLogs_Golden(t *testing.T) {
t.Run("SnapshotEmptyLogs", func(t *testing.T) {
t.Parallel()

setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
client, task := setupCLITaskTestWithSnapshot(setupCtx, t, codersdk.TaskStatusInitializing, []agentapisdk.Message{})
userClient := client

inv, root := clitest.New(t, "task", "logs", task.Name)
output := clitest.Capture(inv)
clitest.SetupConfig(t, userClient, root)

ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)
err := inv.WithContext(ctx).Run()
require.NoError(t, err)

Expand All @@ -261,15 +261,15 @@ func Test_TaskLogs_Golden(t *testing.T) {
t.Run("InitializingTaskSnapshot", func(t *testing.T) {
t.Parallel()

setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
client, task := setupCLITaskTestWithSnapshot(setupCtx, t, codersdk.TaskStatusInitializing, testMessages)
userClient := client

inv, root := clitest.New(t, "task", "logs", task.Name)
output := clitest.Capture(inv)
clitest.SetupConfig(t, userClient, root)

ctx := testutil.Context(t, testutil.WaitLong)
ctx := testutil.Context(t, testutil.WaitSuperLong)
err := inv.WithContext(ctx).Run()
require.NoError(t, err)

Expand Down
10 changes: 5 additions & 5 deletions cli/task_pause_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestExpTaskPause(t *testing.T) {
t.Parallel()

// Given: A running task
setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, nil)

// When: We attempt to pause the task
Expand All @@ -44,7 +44,7 @@ func TestExpTaskPause(t *testing.T) {
t.Parallel()

// Given: A different user's running task
setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, nil)

// When: We attempt to pause their task
Expand All @@ -69,7 +69,7 @@ func TestExpTaskPause(t *testing.T) {

logger := testutil.Logger(t)
// Given: A running task
setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, nil)

// When: We attempt to pause the task
Expand Down Expand Up @@ -99,7 +99,7 @@ func TestExpTaskPause(t *testing.T) {

logger := testutil.Logger(t)
// Given: A running task
setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, nil)

// When: We attempt to pause the task
Expand All @@ -126,7 +126,7 @@ func TestExpTaskPause(t *testing.T) {
t.Parallel()

// Given: A running task
setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, nil)

// And: We paused the running task
Expand Down
12 changes: 6 additions & 6 deletions cli/task_resume_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestExpTaskResume(t *testing.T) {
t.Parallel()

// Given: A paused task
setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, nil)
pauseTask(setupCtx, t, setup.userClient, setup.task)

Expand All @@ -46,7 +46,7 @@ func TestExpTaskResume(t *testing.T) {
t.Parallel()

// Given: A different user's paused task
setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, nil)
pauseTask(setupCtx, t, setup.userClient, setup.task)

Expand All @@ -71,7 +71,7 @@ func TestExpTaskResume(t *testing.T) {
t.Parallel()

// Given: A paused task
setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, nil)
pauseTask(setupCtx, t, setup.userClient, setup.task)

Expand Down Expand Up @@ -101,7 +101,7 @@ func TestExpTaskResume(t *testing.T) {

logger := testutil.Logger(t)
// Given: A paused task
setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, nil)
pauseTask(setupCtx, t, setup.userClient, setup.task)

Expand Down Expand Up @@ -132,7 +132,7 @@ func TestExpTaskResume(t *testing.T) {

logger := testutil.Logger(t)
// Given: A paused task
setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, nil)
pauseTask(setupCtx, t, setup.userClient, setup.task)

Expand Down Expand Up @@ -160,7 +160,7 @@ func TestExpTaskResume(t *testing.T) {
t.Parallel()

// Given: A running task
setupCtx := testutil.Context(t, testutil.WaitLong)
setupCtx := testutil.Context(t, testutil.WaitSuperLong)
setup := setupCLITaskTest(setupCtx, t, nil)

// When: We attempt to resume the task that is not paused
Expand Down
Loading
Loading