@@ -10,6 +10,7 @@ import (
10
10
"github.com/coder/coder/loadtest/agentconn"
11
11
"github.com/coder/coder/loadtest/harness"
12
12
"github.com/coder/coder/loadtest/placebo"
13
+ "github.com/coder/coder/loadtest/reconnectingpty"
13
14
"github.com/coder/coder/loadtest/workspacebuild"
14
15
)
15
16
@@ -88,9 +89,10 @@ func (s LoadTestStrategy) ExecutionStrategy() harness.ExecutionStrategy {
88
89
type LoadTestType string
89
90
90
91
const (
91
- LoadTestTypeAgentConn LoadTestType = "agentconn"
92
- LoadTestTypePlacebo LoadTestType = "placebo"
93
- LoadTestTypeWorkspaceBuild LoadTestType = "workspacebuild"
92
+ LoadTestTypeAgentConn LoadTestType = "agentconn"
93
+ LoadTestTypePlacebo LoadTestType = "placebo"
94
+ LoadTestTypeReconnectingPTY LoadTestType = "reconnectingpty"
95
+ LoadTestTypeWorkspaceBuild LoadTestType = "workspacebuild"
94
96
)
95
97
96
98
type LoadTest struct {
@@ -104,6 +106,8 @@ type LoadTest struct {
104
106
AgentConn * agentconn.Config `json:"agentconn,omitempty"`
105
107
// Placebo must be set if type == "placebo".
106
108
Placebo * placebo.Config `json:"placebo,omitempty"`
109
+ // ReconnectingPTY must be set if type == "reconnectingpty".
110
+ ReconnectingPTY * reconnectingpty.Config `json:"reconnectingpty,omitempty"`
107
111
// WorkspaceBuild must be set if type == "workspacebuild".
108
112
WorkspaceBuild * workspacebuild.Config `json:"workspacebuild,omitempty"`
109
113
}
@@ -120,6 +124,11 @@ func (t LoadTest) NewRunner(client *codersdk.Client) (harness.Runnable, error) {
120
124
return nil , xerrors .New ("placebo config must be set" )
121
125
}
122
126
return placebo .NewRunner (* t .Placebo ), nil
127
+ case LoadTestTypeReconnectingPTY :
128
+ if t .ReconnectingPTY == nil {
129
+ return nil , xerrors .New ("reconnectingpty config must be set" )
130
+ }
131
+ return reconnectingpty .NewRunner (client , * t .ReconnectingPTY ), nil
123
132
case LoadTestTypeWorkspaceBuild :
124
133
if t .WorkspaceBuild == nil {
125
134
return nil , xerrors .Errorf ("workspacebuild config must be set" )
@@ -185,6 +194,15 @@ func (t *LoadTest) Validate() error {
185
194
if err != nil {
186
195
return xerrors .Errorf ("validate placebo: %w" , err )
187
196
}
197
+ case LoadTestTypeReconnectingPTY :
198
+ if t .ReconnectingPTY == nil {
199
+ return xerrors .Errorf ("reconnectingpty test type must specify reconnectingpty" )
200
+ }
201
+
202
+ err := t .ReconnectingPTY .Validate ()
203
+ if err != nil {
204
+ return xerrors .Errorf ("validate reconnectingpty: %w" , err )
205
+ }
188
206
case LoadTestTypeWorkspaceBuild :
189
207
if t .WorkspaceBuild == nil {
190
208
return xerrors .New ("workspacebuild test type must specify workspacebuild" )
0 commit comments