@@ -42,11 +42,11 @@ func TestWorkspaceAgent(t *testing.T) {
42
42
tmpDir := t .TempDir ()
43
43
anotherClient ,anotherUser := coderdtest .CreateAnotherUser (t ,client ,user .OrganizationID )
44
44
45
- ws := dbfake .CreateWorkspace (t ,db , database.Workspace {
45
+ ws := dbfake .Workspace (t ,db , database.Workspace {
46
46
OrganizationID :user .OrganizationID ,
47
47
OwnerID :anotherUser .ID ,
48
48
})
49
- dbfake .CreateWorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
49
+ dbfake .WorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
50
50
Name :"aws_instance" ,
51
51
Agents : []* proto.Agent {{
52
52
Id :uuid .NewString (),
@@ -67,11 +67,11 @@ func TestWorkspaceAgent(t *testing.T) {
67
67
client ,db := coderdtest .NewWithDatabase (t ,nil )
68
68
user := coderdtest .CreateFirstUser (t ,client )
69
69
tmpDir := t .TempDir ()
70
- ws := dbfake .CreateWorkspace (t ,db , database.Workspace {
70
+ ws := dbfake .Workspace (t ,db , database.Workspace {
71
71
OrganizationID :user .OrganizationID ,
72
72
OwnerID :user .UserID ,
73
73
})
74
- dbfake .CreateWorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
74
+ dbfake .WorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
75
75
Name :"aws_instance" ,
76
76
Agents : []* proto.Agent {{
77
77
Id :uuid .NewString (),
@@ -99,11 +99,11 @@ func TestWorkspaceAgent(t *testing.T) {
99
99
100
100
wantTroubleshootingURL := "https://example.com/troubleshoot"
101
101
102
- ws := dbfake .CreateWorkspace (t ,db , database.Workspace {
102
+ ws := dbfake .Workspace (t ,db , database.Workspace {
103
103
OwnerID :user .UserID ,
104
104
OrganizationID :user .OrganizationID ,
105
105
})
106
- dbfake .CreateWorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
106
+ dbfake .WorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
107
107
Name :"example" ,
108
108
Type :"aws_instance" ,
109
109
Agents : []* proto.Agent {{
@@ -139,7 +139,7 @@ func TestWorkspaceAgent(t *testing.T) {
139
139
t .Parallel ()
140
140
client ,db := coderdtest .NewWithDatabase (t ,nil )
141
141
user := coderdtest .CreateFirstUser (t ,client )
142
- ws := dbfake .CreateWorkspace (t ,db , database.Workspace {
142
+ ws := dbfake .Workspace (t ,db , database.Workspace {
143
143
OrganizationID :user .OrganizationID ,
144
144
OwnerID :user .UserID ,
145
145
})
@@ -152,7 +152,7 @@ func TestWorkspaceAgent(t *testing.T) {
152
152
PortForwardingHelper :true ,
153
153
SshHelper :true ,
154
154
}
155
- dbfake .CreateWorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
155
+ dbfake .WorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
156
156
Name :"example" ,
157
157
Type :"aws_instance" ,
158
158
Agents : []* proto.Agent {
@@ -191,11 +191,11 @@ func TestWorkspaceAgent(t *testing.T) {
191
191
apps .WebTerminal = false
192
192
193
193
// Creating another workspace is easier
194
- ws = dbfake .CreateWorkspace (t ,db , database.Workspace {
194
+ ws = dbfake .Workspace (t ,db , database.Workspace {
195
195
OrganizationID :user .OrganizationID ,
196
196
OwnerID :user .UserID ,
197
197
})
198
- dbfake .CreateWorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
198
+ dbfake .WorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
199
199
Name :"example" ,
200
200
Type :"aws_instance" ,
201
201
Agents : []* proto.Agent {
@@ -225,7 +225,7 @@ func TestWorkspaceAgentLogs(t *testing.T) {
225
225
ctx := testutil .Context (t ,testutil .WaitMedium )
226
226
client ,db := coderdtest .NewWithDatabase (t ,nil )
227
227
user := coderdtest .CreateFirstUser (t ,client )
228
- ws ,authToken := dbfake .CreateWorkspaceWithAgent (t ,db , database.Workspace {
228
+ ws ,authToken := dbfake .WorkspaceWithAgent (t ,db , database.Workspace {
229
229
OrganizationID :user .OrganizationID ,
230
230
OwnerID :user .UserID ,
231
231
})
@@ -267,7 +267,7 @@ func TestWorkspaceAgentLogs(t *testing.T) {
267
267
ctx := testutil .Context (t ,testutil .WaitMedium )
268
268
client ,db := coderdtest .NewWithDatabase (t ,nil )
269
269
user := coderdtest .CreateFirstUser (t ,client )
270
- ws ,authToken := dbfake .CreateWorkspaceWithAgent (t ,db , database.Workspace {
270
+ ws ,authToken := dbfake .WorkspaceWithAgent (t ,db , database.Workspace {
271
271
OrganizationID :user .OrganizationID ,
272
272
OwnerID :user .UserID ,
273
273
})
@@ -309,7 +309,7 @@ func TestWorkspaceAgentLogs(t *testing.T) {
309
309
ctx := testutil .Context (t ,testutil .WaitMedium )
310
310
client ,db := coderdtest .NewWithDatabase (t ,nil )
311
311
user := coderdtest .CreateFirstUser (t ,client )
312
- ws ,authToken := dbfake .CreateWorkspaceWithAgent (t ,db , database.Workspace {
312
+ ws ,authToken := dbfake .WorkspaceWithAgent (t ,db , database.Workspace {
313
313
OrganizationID :user .OrganizationID ,
314
314
OwnerID :user .UserID ,
315
315
})
@@ -352,7 +352,7 @@ func TestWorkspaceAgentListen(t *testing.T) {
352
352
353
353
client ,db := coderdtest .NewWithDatabase (t ,nil )
354
354
user := coderdtest .CreateFirstUser (t ,client )
355
- ws ,authToken := dbfake .CreateWorkspaceWithAgent (t ,db , database.Workspace {
355
+ ws ,authToken := dbfake .WorkspaceWithAgent (t ,db , database.Workspace {
356
356
OrganizationID :user .OrganizationID ,
357
357
OwnerID :user .UserID ,
358
358
})
@@ -438,7 +438,7 @@ func TestWorkspaceAgentTailnet(t *testing.T) {
438
438
client ,db := coderdtest .NewWithDatabase (t ,nil )
439
439
user := coderdtest .CreateFirstUser (t ,client )
440
440
441
- ws ,authToken := dbfake .CreateWorkspaceWithAgent (t ,db , database.Workspace {
441
+ ws ,authToken := dbfake .WorkspaceWithAgent (t ,db , database.Workspace {
442
442
OrganizationID :user .OrganizationID ,
443
443
OwnerID :user .UserID ,
444
444
})
@@ -477,7 +477,7 @@ func TestWorkspaceAgentTailnetDirectDisabled(t *testing.T) {
477
477
DeploymentValues :dv ,
478
478
})
479
479
user := coderdtest .CreateFirstUser (t ,client )
480
- ws ,authToken := dbfake .CreateWorkspaceWithAgent (t ,db , database.Workspace {
480
+ ws ,authToken := dbfake .WorkspaceWithAgent (t ,db , database.Workspace {
481
481
OrganizationID :user .OrganizationID ,
482
482
OwnerID :user .UserID ,
483
483
})
@@ -540,7 +540,7 @@ func TestWorkspaceAgentListeningPorts(t *testing.T) {
540
540
require .NoError (t ,err )
541
541
542
542
user := coderdtest .CreateFirstUser (t ,client )
543
- ws ,authToken := dbfake .CreateWorkspaceWithAgent (t ,db , database.Workspace {
543
+ ws ,authToken := dbfake .WorkspaceWithAgent (t ,db , database.Workspace {
544
544
OrganizationID :user .OrganizationID ,
545
545
OwnerID :user .UserID ,
546
546
})
@@ -765,11 +765,11 @@ func TestWorkspaceAgentAppHealth(t *testing.T) {
765
765
},
766
766
},
767
767
}
768
- ws := dbfake .CreateWorkspace (t ,db , database.Workspace {
768
+ ws := dbfake .Workspace (t ,db , database.Workspace {
769
769
OrganizationID :user .OrganizationID ,
770
770
OwnerID :user .UserID ,
771
771
})
772
- dbfake .CreateWorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
772
+ dbfake .WorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
773
773
Name :"example" ,
774
774
Type :"aws_instance" ,
775
775
Agents : []* proto.Agent {{
@@ -840,7 +840,7 @@ func TestWorkspaceAgentReportStats(t *testing.T) {
840
840
841
841
client ,db := coderdtest .NewWithDatabase (t ,nil )
842
842
user := coderdtest .CreateFirstUser (t ,client )
843
- ws ,authToken := dbfake .CreateWorkspaceWithAgent (t ,db , database.Workspace {
843
+ ws ,authToken := dbfake .WorkspaceWithAgent (t ,db , database.Workspace {
844
844
OrganizationID :user .OrganizationID ,
845
845
OwnerID :user .UserID ,
846
846
})
@@ -881,7 +881,7 @@ func TestWorkspaceAgent_LifecycleState(t *testing.T) {
881
881
882
882
client ,db := coderdtest .NewWithDatabase (t ,nil )
883
883
user := coderdtest .CreateFirstUser (t ,client )
884
- ws ,authToken := dbfake .CreateWorkspaceWithAgent (t ,db , database.Workspace {
884
+ ws ,authToken := dbfake .WorkspaceWithAgent (t ,db , database.Workspace {
885
885
OrganizationID :user .OrganizationID ,
886
886
OwnerID :user .UserID ,
887
887
})
@@ -947,11 +947,11 @@ func TestWorkspaceAgent_Metadata(t *testing.T) {
947
947
client ,db := coderdtest .NewWithDatabase (t ,nil )
948
948
user := coderdtest .CreateFirstUser (t ,client )
949
949
authToken := uuid .NewString ()
950
- ws := dbfake .CreateWorkspace (t ,db , database.Workspace {
950
+ ws := dbfake .Workspace (t ,db , database.Workspace {
951
951
OrganizationID :user .OrganizationID ,
952
952
OwnerID :user .UserID ,
953
953
})
954
- dbfake .CreateWorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
954
+ dbfake .WorkspaceBuild (t ,db ,ws , database.WorkspaceBuild {},& proto.Resource {
955
955
Name :"example" ,
956
956
Type :"aws_instance" ,
957
957
Agents : []* proto.Agent {{
@@ -1111,7 +1111,7 @@ func TestWorkspaceAgent_Startup(t *testing.T) {
1111
1111
1112
1112
client ,db := coderdtest .NewWithDatabase (t ,nil )
1113
1113
user := coderdtest .CreateFirstUser (t ,client )
1114
- ws ,authToken := dbfake .CreateWorkspaceWithAgent (t ,db , database.Workspace {
1114
+ ws ,authToken := dbfake .WorkspaceWithAgent (t ,db , database.Workspace {
1115
1115
OrganizationID :user .OrganizationID ,
1116
1116
OwnerID :user .UserID ,
1117
1117
})
@@ -1156,7 +1156,7 @@ func TestWorkspaceAgent_Startup(t *testing.T) {
1156
1156
1157
1157
client ,db := coderdtest .NewWithDatabase (t ,nil )
1158
1158
user := coderdtest .CreateFirstUser (t ,client )
1159
- _ ,authToken := dbfake .CreateWorkspaceWithAgent (t ,db , database.Workspace {
1159
+ _ ,authToken := dbfake .WorkspaceWithAgent (t ,db , database.Workspace {
1160
1160
OrganizationID :user .OrganizationID ,
1161
1161
OwnerID :user .UserID ,
1162
1162
})
@@ -1204,7 +1204,7 @@ func TestWorkspaceAgent_UpdatedDERP(t *testing.T) {
1204
1204
api .DERPMapper .Store (& derpMapFn )
1205
1205
1206
1206
// Start workspace a workspace agent.
1207
- ws ,agentToken := dbfake .CreateWorkspaceWithAgent (t ,api .Database , database.Workspace {
1207
+ ws ,agentToken := dbfake .WorkspaceWithAgent (t ,api .Database , database.Workspace {
1208
1208
OrganizationID :user .OrganizationID ,
1209
1209
OwnerID :user .UserID ,
1210
1210
})