@@ -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 .WorkspaceBuildBuilder (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 .WorkspaceBuildBuilder (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 .WorkspaceBuildBuilder (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 .WorkspaceBuildBuilder (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 .WorkspaceBuildBuilder (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 .WorkspaceBuildBuilder (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 .WorkspaceBuildBuilder (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 ()
@@ -958,7 +958,7 @@ func TestWorkspaceAgent_Metadata(t *testing.T) {
958
958
OrganizationID : user .OrganizationID ,
959
959
OwnerID : user .UserID ,
960
960
})
961
- dbfake .WorkspaceBuild (t , db , ws , database. WorkspaceBuild {}, & proto.Resource {
961
+ dbfake .WorkspaceBuildBuilder (t , db , ws ). Resource ( & proto.Resource {
962
962
Name : "example" ,
963
963
Type : "aws_instance" ,
964
964
Agents : []* proto.Agent {{
@@ -990,7 +990,7 @@ func TestWorkspaceAgent_Metadata(t *testing.T) {
990
990
Token : authToken ,
991
991
},
992
992
}},
993
- })
993
+ }). Do ()
994
994
workspace , err := client .Workspace (context .Background (), ws .ID )
995
995
require .NoError (t , err )
996
996
for _ , res := range workspace .LatestBuild .Resources {
@@ -1141,7 +1141,7 @@ func TestWorkspaceAgent_Metadata_CatchMemoryLeak(t *testing.T) {
1141
1141
OrganizationID : user .OrganizationID ,
1142
1142
OwnerID : user .UserID ,
1143
1143
})
1144
- dbfake .WorkspaceBuild (t , db , ws , database. WorkspaceBuild {}, & proto.Resource {
1144
+ dbfake .WorkspaceBuildBuilder (t , db , ws ). Resource ( & proto.Resource {
1145
1145
Name : "example" ,
1146
1146
Type : "aws_instance" ,
1147
1147
Agents : []* proto.Agent {{
@@ -1166,7 +1166,7 @@ func TestWorkspaceAgent_Metadata_CatchMemoryLeak(t *testing.T) {
1166
1166
Token : authToken ,
1167
1167
},
1168
1168
}},
1169
- })
1169
+ }). Do ()
1170
1170
workspace , err := client .Workspace (context .Background (), ws .ID )
1171
1171
require .NoError (t , err )
1172
1172
for _ , res := range workspace .LatestBuild .Resources {
0 commit comments