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

Function TestEnterpriseCreateWithPreset

enterprise/cli/create_test.go:258–597  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

256}
257
258func TestEnterpriseCreateWithPreset(t *testing.T) {
259 t.Parallel()
260
261 const (
262 firstParameterName = "first_parameter"
263 firstParameterDisplayName = "First Parameter"
264 firstParameterDescription = "This is the first parameter"
265 firstParameterValue = "1"
266
267 firstOptionalParameterName = "first_optional_parameter"
268 firstOptionParameterDescription = "This is the first optional parameter"
269 firstOptionalParameterValue = "1"
270 secondOptionalParameterName = "second_optional_parameter"
271 secondOptionalParameterDescription = "This is the second optional parameter"
272 secondOptionalParameterValue = "2"
273
274 thirdParameterName = "third_parameter"
275 thirdParameterDescription = "This is the third parameter"
276 thirdParameterValue = "3"
277 )
278
279 echoResponses := func(presets ...*proto.Preset) *echo.Responses {
280 return prepareEchoResponses([]*proto.RichParameter{
281 {
282 Name: firstParameterName,
283 DisplayName: firstParameterDisplayName,
284 Description: firstParameterDescription,
285 Mutable: true,
286 DefaultValue: firstParameterValue,
287 Options: []*proto.RichParameterOption{
288 {
289 Name: firstOptionalParameterName,
290 Description: firstOptionParameterDescription,
291 Value: firstOptionalParameterValue,
292 },
293 {
294 Name: secondOptionalParameterName,
295 Description: secondOptionalParameterDescription,
296 Value: secondOptionalParameterValue,
297 },
298 },
299 },
300 {
301 Name: thirdParameterName,
302 Description: thirdParameterDescription,
303 DefaultValue: thirdParameterValue,
304 Mutable: true,
305 },
306 }, presets...)
307 }
308
309 runReconciliationLoop := func(
310 t *testing.T,
311 ctx context.Context,
312 db database.Store,
313 reconciler *prebuilds.StoreReconciler,
314 presets []codersdk.Preset,
315 ) {

Callers

nothing calls this directly

Calls 15

SnapshotStateMethod · 0.95
CalculateActionsMethod · 0.95
ReconcilePresetMethod · 0.95
EventuallyFunction · 0.92
ContextFunction · 0.92
NewDBFunction · 0.92
WithDumpOnFailureFunction · 0.92
NewWithAPIFunction · 0.92
NewFunction · 0.92
NewStoreReconcilerFunction · 0.92
LoggerFunction · 0.92
NewNoopEnqueuerFunction · 0.92

Tested by

no test coverage detected