MCPcopy Index your code
hub / github.com/coder/coder / TestShowDevcontainers_Golden

Function TestShowDevcontainers_Golden

cli/show_test.go:123–472  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

121}
122
123func TestShowDevcontainers_Golden(t *testing.T) {
124 t.Parallel()
125
126 mainAgentID := uuid.MustParse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")
127 agentID := mainAgentID
128
129 testCases := []struct {
130 name string
131 showDetails bool
132 devcontainers []codersdk.WorkspaceAgentDevcontainer
133 listeningPorts map[uuid.UUID]codersdk.WorkspaceAgentListeningPortsResponse
134 }{
135 {
136 name: "running_devcontainer_with_agent",
137 devcontainers: []codersdk.WorkspaceAgentDevcontainer{
138 {
139 ID: uuid.MustParse("11111111-1111-1111-1111-111111111111"),
140 Name: "web-dev",
141 WorkspaceFolder: "/workspaces/web-dev",
142 ConfigPath: "/workspaces/web-dev/.devcontainer/devcontainer.json",
143 Status: codersdk.WorkspaceAgentDevcontainerStatusRunning,
144 Dirty: false,
145 Container: &codersdk.WorkspaceAgentContainer{
146 ID: "container-web-dev",
147 FriendlyName: "quirky_lovelace",
148 Image: "mcr.microsoft.com/devcontainers/typescript-node:1.0.0",
149 Running: true,
150 Status: "running",
151 CreatedAt: time.Now().Add(-1 * time.Hour),
152 Labels: map[string]string{
153 agentcontainers.DevcontainerConfigFileLabel: "/workspaces/web-dev/.devcontainer/devcontainer.json",
154 agentcontainers.DevcontainerLocalFolderLabel: "/workspaces/web-dev",
155 },
156 },
157 Agent: &codersdk.WorkspaceAgentDevcontainerAgent{
158 ID: uuid.MustParse("22222222-2222-2222-2222-222222222222"),
159 Name: "web-dev",
160 Directory: "/workspaces/web-dev",
161 },
162 },
163 },
164 listeningPorts: map[uuid.UUID]codersdk.WorkspaceAgentListeningPortsResponse{
165 uuid.MustParse("22222222-2222-2222-2222-222222222222"): {
166 Ports: []codersdk.WorkspaceAgentListeningPort{
167 {
168 ProcessName: "node",
169 Network: "tcp",
170 Port: 3000,
171 },
172 {
173 ProcessName: "webpack-dev-server",
174 Network: "tcp",
175 Port: 8080,
176 },
177 },
178 },
179 },
180 },

Callers

nothing calls this directly

Calls 5

WorkspaceResourcesFunction · 0.92
TestGoldenFileFunction · 0.92
AddMethod · 0.65
RunMethod · 0.65
BytesMethod · 0.45

Tested by

no test coverage detected