File tree 1 file changed +21
-0
lines changed 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
11
11
12
12
"github.com/google/uuid"
13
13
"github.com/stretchr/testify/require"
14
+ "golang.org/x/xerrors"
14
15
15
16
"github.com/coder/coder/cli/clibase"
16
17
"github.com/coder/coder/cli/clitest"
@@ -251,6 +252,26 @@ func TestAgent(t *testing.T) {
251
252
},
252
253
wantErr : true ,
253
254
},
255
+ {
256
+ name : "Error during fetch" ,
257
+ opts : cliui.AgentOptions {
258
+ FetchInterval : time .Millisecond ,
259
+ Wait : true ,
260
+ },
261
+ iter : []func (context.Context , * codersdk.WorkspaceAgent , chan []codersdk.WorkspaceAgentStartupLog ) error {
262
+ func (_ context.Context , agent * codersdk.WorkspaceAgent , _ chan []codersdk.WorkspaceAgentStartupLog ) error {
263
+ agent .Status = codersdk .WorkspaceAgentConnecting
264
+ return nil
265
+ },
266
+ func (_ context.Context , agent * codersdk.WorkspaceAgent , _ chan []codersdk.WorkspaceAgentStartupLog ) error {
267
+ return xerrors .New ("bad" )
268
+ },
269
+ },
270
+ want : []string {
271
+ "⧗ Waiting for initial connection from the workspace agent" ,
272
+ },
273
+ wantErr : true ,
274
+ },
254
275
} {
255
276
tc := tc
256
277
t .Run (tc .name , func (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments