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

Function ProvisionGraphWithAgent

provisioner/echo/serve.go:49–72  ·  view source on GitHub ↗

ProvisionGraphWithAgent returns provision responses that will mock a fake "aws_instance" resource with an agent that has the given auth token.

(authToken string, muts ...func(g *proto.GraphComplete))

Source from the content-addressed store, hash-verified

47// ProvisionGraphWithAgent returns provision responses that will mock a fake
48// "aws_instance" resource with an agent that has the given auth token.
49func ProvisionGraphWithAgent(authToken string, muts ...func(g *proto.GraphComplete)) []*proto.Response {
50 gc := &proto.GraphComplete{
51 Resources: []*proto.Resource{{
52 Name: "example",
53 Type: "aws_instance",
54 Agents: []*proto.Agent{{
55 Id: uuid.NewString(),
56 Name: "example",
57 Auth: &proto.Agent_Token{
58 Token: authToken,
59 },
60 }},
61 }},
62 }
63 for _, mut := range muts {
64 mut(gc)
65 }
66
67 return []*proto.Response{{
68 Type: &proto.Response_Graph{
69 Graph: gc,
70 },
71 }}
72}
73
74var (
75 // ParseComplete is a helper to indicate an empty parse completion.

Callers 15

TestDeploymentInsightsFunction · 0.92
TestUserLatencyInsightsFunction · 0.92
TestExternalAuthCallbackFunction · 0.92
TestAgentGitSSHKeyFunction · 0.92
TestDERPForceWebSocketsFunction · 0.92
TestWorkspaceFunction · 0.92
TestTemplateMetricsFunction · 0.92
prepareWorkspaceAndAgentFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestDeploymentInsightsFunction · 0.74
TestUserLatencyInsightsFunction · 0.74
TestExternalAuthCallbackFunction · 0.74
TestAgentGitSSHKeyFunction · 0.74
TestDERPForceWebSocketsFunction · 0.74
TestWorkspaceFunction · 0.74
TestTemplateMetricsFunction · 0.74
prepareWorkspaceAndAgentFunction · 0.74