@@ -50,13 +50,13 @@ func TestWorkspaceAgent(t *testing.T) {
50
50
OrganizationID : user .OrganizationID ,
51
51
OwnerID : anotherUser .ID ,
52
52
})
53
- dbfake .WorkspaceBuild (t , db , ws , database. WorkspaceBuild {}, & proto.Resource {
53
+ dbfake .NewWorkspaceBuildBuilder (t , db , ws ). Resource ( & proto.Resource {
54
54
Name : "aws_instance" ,
55
55
Agents : []* proto.Agent {{
56
56
Id : uuid .NewString (),
57
57
Directory : tmpDir ,
58
58
}},
59
- })
59
+ }). Do ()
60
60
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitLong )
61
61
defer cancel ()
62
62
workspace , err := anotherClient .Workspace (ctx , ws .ID )
@@ -75,13 +75,13 @@ func TestWorkspaceAgent(t *testing.T) {
75
75
OrganizationID : user .OrganizationID ,
76
76
OwnerID : user .UserID ,
77
77
})
78
- dbfake .WorkspaceBuild (t , db , ws , database. WorkspaceBuild {}, & proto.Resource {
78
+ dbfake .NewWorkspaceBuildBuilder (t , db , ws ). Resource ( & proto.Resource {
79
79
Name : "aws_instance" ,
80
80
Agents : []* proto.Agent {{
81
81
Id : uuid .NewString (),
82
82
Directory : tmpDir ,
83
83
}},
84
- })
84
+ }). Do ()
85
85
86
86
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitMedium )
87
87
defer cancel ()
@@ -107,7 +107,7 @@ func TestWorkspaceAgent(t *testing.T) {
107
107
OwnerID : user .UserID ,
108
108
OrganizationID : user .OrganizationID ,
109
109
})
110
- dbfake .WorkspaceBuild (t , db , ws , database. WorkspaceBuild {}, & proto.Resource {
110
+ dbfake .NewWorkspaceBuildBuilder (t , db , ws ). Resource ( & proto.Resource {
111
111
Name : "example" ,
112
112
Type : "aws_instance" ,
113
113
Agents : []* proto.Agent {{
@@ -119,7 +119,7 @@ func TestWorkspaceAgent(t *testing.T) {
119
119
ConnectionTimeoutSeconds : 1 ,
120
120
TroubleshootingUrl : wantTroubleshootingURL ,
121
121
}},
122
- })
122
+ }). Do ()
123
123
124
124
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitMedium )
125
125
defer cancel ()
@@ -156,7 +156,7 @@ func TestWorkspaceAgent(t *testing.T) {
156
156
PortForwardingHelper : true ,
157
157
SshHelper : true ,
158
158
}
159
- dbfake .WorkspaceBuild (t , db , ws , database. WorkspaceBuild {}, & proto.Resource {
159
+ dbfake .NewWorkspaceBuildBuilder (t , db , ws ). Resource ( & proto.Resource {
160
160
Agents : []* proto.Agent {
161
161
{
162
162
Directory : tmpDir ,
@@ -166,7 +166,7 @@ func TestWorkspaceAgent(t *testing.T) {
166
166
DisplayApps : apps ,
167
167
},
168
168
},
169
- })
169
+ }). Do ()
170
170
171
171
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitLong )
172
172
defer cancel ()
@@ -196,7 +196,7 @@ func TestWorkspaceAgent(t *testing.T) {
196
196
OrganizationID : user .OrganizationID ,
197
197
OwnerID : user .UserID ,
198
198
})
199
- dbfake .WorkspaceBuild (t , db , ws , database. WorkspaceBuild {}, & proto.Resource {
199
+ dbfake .NewWorkspaceBuildBuilder (t , db , ws ). Resource ( & proto.Resource {
200
200
Agents : []* proto.Agent {
201
201
{
202
202
Directory : tmpDir ,
@@ -206,7 +206,7 @@ func TestWorkspaceAgent(t *testing.T) {
206
206
DisplayApps : apps ,
207
207
},
208
208
},
209
- })
209
+ }). Do ()
210
210
workspace , err = client .Workspace (ctx , ws .ID )
211
211
require .NoError (t , err )
212
212
@@ -543,14 +543,14 @@ func TestWorkspaceAgentListeningPorts(t *testing.T) {
543
543
OwnerID : user .UserID ,
544
544
})
545
545
authToken := uuid .NewString ()
546
- dbfake .WorkspaceBuild (t , db , ws , database. WorkspaceBuild {}, & proto.Resource {
546
+ dbfake .NewWorkspaceBuildBuilder (t , db , ws ). Resource ( & proto.Resource {
547
547
Agents : []* proto.Agent {{
548
548
Apps : apps ,
549
549
Auth : & proto.Agent_Token {
550
550
Token : authToken ,
551
551
},
552
552
}},
553
- })
553
+ }). Do ()
554
554
_ = agenttest .New (t , client .URL , authToken )
555
555
resources := coderdtest .AwaitWorkspaceAgents (t , client , ws .ID )
556
556
return client , uint16 (coderdPort ), resources [0 ].Agents [0 ].ID
@@ -776,7 +776,7 @@ func TestWorkspaceAgentAppHealth(t *testing.T) {
776
776
OrganizationID : user .OrganizationID ,
777
777
OwnerID : user .UserID ,
778
778
})
779
- dbfake .WorkspaceBuild (t , db , ws , database. WorkspaceBuild {}, & proto.Resource {
779
+ dbfake .NewWorkspaceBuildBuilder (t , db , ws ). Resource ( & proto.Resource {
780
780
Name : "example" ,
781
781
Type : "aws_instance" ,
782
782
Agents : []* proto.Agent {{
@@ -786,7 +786,7 @@ func TestWorkspaceAgentAppHealth(t *testing.T) {
786
786
},
787
787
Apps : apps ,
788
788
}},
789
- })
789
+ }). Do ()
790
790
791
791
ctx , cancel := context .WithTimeout (context .Background (), testutil .WaitLong )
792
792
defer cancel ()
@@ -984,7 +984,7 @@ func TestWorkspaceAgent_Metadata(t *testing.T) {
984
984
OrganizationID : user .OrganizationID ,
985
985
OwnerID : user .UserID ,
986
986
})
987
- dbfake .WorkspaceBuild (t , db , ws , database. WorkspaceBuild {}, & proto.Resource {
987
+ dbfake .NewWorkspaceBuildBuilder (t , db , ws ). Resource ( & proto.Resource {
988
988
Name : "example" ,
989
989
Type : "aws_instance" ,
990
990
Agents : []* proto.Agent {{
@@ -1016,7 +1016,7 @@ func TestWorkspaceAgent_Metadata(t *testing.T) {
1016
1016
Token : authToken ,
1017
1017
},
1018
1018
}},
1019
- })
1019
+ }). Do ()
1020
1020
workspace , err := client .Workspace (context .Background (), ws .ID )
1021
1021
require .NoError (t , err )
1022
1022
for _ , res := range workspace .LatestBuild .Resources {
@@ -1167,7 +1167,7 @@ func TestWorkspaceAgent_Metadata_CatchMemoryLeak(t *testing.T) {
1167
1167
OrganizationID : user .OrganizationID ,
1168
1168
OwnerID : user .UserID ,
1169
1169
})
1170
- dbfake .WorkspaceBuild (t , db , ws , database. WorkspaceBuild {}, & proto.Resource {
1170
+ dbfake .NewWorkspaceBuildBuilder (t , db , ws ). Resource ( & proto.Resource {
1171
1171
Name : "example" ,
1172
1172
Type : "aws_instance" ,
1173
1173
Agents : []* proto.Agent {{
@@ -1192,7 +1192,7 @@ func TestWorkspaceAgent_Metadata_CatchMemoryLeak(t *testing.T) {
1192
1192
Token : authToken ,
1193
1193
},
1194
1194
}},
1195
- })
1195
+ }). Do ()
1196
1196
workspace , err := client .Workspace (context .Background (), ws .ID )
1197
1197
require .NoError (t , err )
1198
1198
for _ , res := range workspace .LatestBuild .Resources {
0 commit comments