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

Function Test_Config

scaletest/createworkspaces/config_test.go:87–197  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func Test_Config(t *testing.T) {
88 t.Parallel()
89
90 id := uuid.New()
91
92 userConfig := createworkspaces.UserConfig{
93 OrganizationID: id,
94 Username: id.String(),
95 Email: id.String() + "@example.com",
96 }
97
98 workspaceConfig := workspacebuild.Config{
99 OrganizationID: id,
100 UserID: id.String(),
101 Request: codersdk.CreateWorkspaceRequest{
102 TemplateID: id,
103 },
104 }
105
106 reconnectingPTYConfig := reconnectingpty.Config{
107 AgentID: id,
108 }
109
110 agentConnConfig := agentconn.Config{
111 AgentID: id,
112 ConnectionMode: agentconn.ConnectionModeDirect,
113 HoldDuration: httpapi.Duration(time.Minute),
114 }
115
116 cases := []struct {
117 name string
118 config createworkspaces.Config
119 errContains string
120 }{
121 {
122 name: "OK",
123 config: createworkspaces.Config{
124 User: userConfig,
125 Workspace: workspaceConfig,
126 ReconnectingPTY: &reconnectingPTYConfig,
127 AgentConn: &agentConnConfig,
128 },
129 },
130 {
131 name: "OKOptional",
132 config: createworkspaces.Config{
133 User: userConfig,
134 Workspace: workspaceConfig,
135 ReconnectingPTY: nil,
136 AgentConn: nil,
137 },
138 },
139 {
140 name: "BadUserConfig",
141 config: createworkspaces.Config{
142 User: createworkspaces.UserConfig{
143 OrganizationID: uuid.Nil,
144 },

Callers

nothing calls this directly

Calls 7

DurationTypeAlias · 0.92
NewMethod · 0.65
RunMethod · 0.65
ValidateMethod · 0.65
StringMethod · 0.45
ErrorMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected