@@ -156,6 +156,19 @@ func TestGetManifest(t *testing.T) {
156156CollectedAt :someTime .Add (time .Hour ),
157157},
158158}
159+ devcontainers = []database.WorkspaceAgentDevcontainer {
160+ {
161+ ID :uuid .New (),
162+ WorkspaceAgentID :agent .ID ,
163+ WorkspaceFolder :"/cool/folder" ,
164+ },
165+ {
166+ ID :uuid .New (),
167+ WorkspaceAgentID :agent .ID ,
168+ WorkspaceFolder :"/another/cool/folder" ,
169+ ConfigPath :"/another/cool/folder/.devcontainer/devcontainer.json" ,
170+ },
171+ }
159172derpMapFn = func ()* tailcfg.DERPMap {
160173return & tailcfg.DERPMap {
161174Regions :map [int ]* tailcfg.DERPRegion {
@@ -267,6 +280,17 @@ func TestGetManifest(t *testing.T) {
267280Timeout :durationpb .New (time .Duration (metadata [1 ].Timeout )),
268281},
269282}
283+ protoDevcontainers = []* agentproto.WorkspaceAgentDevcontainer {
284+ {
285+ Id :devcontainers [0 ].ID [:],
286+ WorkspaceFolder :devcontainers [0 ].WorkspaceFolder ,
287+ },
288+ {
289+ Id :devcontainers [1 ].ID [:],
290+ WorkspaceFolder :devcontainers [1 ].WorkspaceFolder ,
291+ ConfigPath :devcontainers [1 ].ConfigPath ,
292+ },
293+ }
270294)
271295
272296t .Run ("OK" ,func (t * testing.T ) {
@@ -299,6 +323,7 @@ func TestGetManifest(t *testing.T) {
299323WorkspaceAgentID :agent .ID ,
300324Keys :nil ,// all
301325}).Return (metadata ,nil )
326+ mDB .EXPECT ().GetWorkspaceAgentDevcontainersByWorkspaceAgentID (gomock .Any (),agent .ID ).Return (devcontainers ,nil )
302327mDB .EXPECT ().GetWorkspaceByID (gomock .Any (),workspace .ID ).Return (workspace ,nil )
303328mDB .EXPECT ().GetUserByID (gomock .Any (),workspace .OwnerID ).Return (owner ,nil )
304329
@@ -321,10 +346,11 @@ func TestGetManifest(t *testing.T) {
321346// tailnet.DERPMapToProto() is extensively tested elsewhere, so it's
322347// not necessary to manually recreate a big DERP map here like we
323348// did for apps and metadata.
324- DerpMap :tailnet .DERPMapToProto (derpMapFn ()),
325- Scripts :protoScripts ,
326- Apps :protoApps ,
327- Metadata :protoMetadata ,
349+ DerpMap :tailnet .DERPMapToProto (derpMapFn ()),
350+ Scripts :protoScripts ,
351+ Apps :protoApps ,
352+ Metadata :protoMetadata ,
353+ Devcontainers :protoDevcontainers ,
328354}
329355
330356// Log got and expected with spew.
@@ -364,6 +390,7 @@ func TestGetManifest(t *testing.T) {
364390WorkspaceAgentID :agent .ID ,
365391Keys :nil ,// all
366392}).Return (metadata ,nil )
393+ mDB .EXPECT ().GetWorkspaceAgentDevcontainersByWorkspaceAgentID (gomock .Any (),agent .ID ).Return (devcontainers ,nil )
367394mDB .EXPECT ().GetWorkspaceByID (gomock .Any (),workspace .ID ).Return (workspace ,nil )
368395mDB .EXPECT ().GetUserByID (gomock .Any (),workspace .OwnerID ).Return (owner ,nil )
369396
@@ -386,10 +413,11 @@ func TestGetManifest(t *testing.T) {
386413// tailnet.DERPMapToProto() is extensively tested elsewhere, so it's
387414// not necessary to manually recreate a big DERP map here like we
388415// did for apps and metadata.
389- DerpMap :tailnet .DERPMapToProto (derpMapFn ()),
390- Scripts :protoScripts ,
391- Apps :protoApps ,
392- Metadata :protoMetadata ,
416+ DerpMap :tailnet .DERPMapToProto (derpMapFn ()),
417+ Scripts :protoScripts ,
418+ Apps :protoApps ,
419+ Metadata :protoMetadata ,
420+ Devcontainers :protoDevcontainers ,
393421}
394422
395423// Log got and expected with spew.