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

Function TestTemplateInsights_Golden

coderd/insights_test.go:384–1327  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

382}
383
384func TestTemplateInsights_Golden(t *testing.T) {
385 t.Parallel()
386
387 // Prepare test data types.
388 type templateParameterOption struct {
389 name string
390 value string
391 }
392 type templateParameter struct {
393 name string
394 description string
395 options []templateParameterOption
396 }
397 type templateApp struct {
398 name string
399 icon string
400 }
401 type testTemplate struct {
402 name string
403 parameters []*templateParameter
404 apps []templateApp
405
406 // Filled later.
407 id uuid.UUID
408 }
409 type buildParameter struct {
410 templateParameter *templateParameter
411 value string
412 }
413 type workspaceApp templateApp
414 type testWorkspace struct {
415 name string
416 template *testTemplate
417 buildParameters []buildParameter
418
419 // Filled later.
420 id uuid.UUID
421 user any // *testUser, but it's not available yet, defined below.
422 agentID uuid.UUID
423 apps []*workspaceApp
424 agentClient *agentsdk.Client
425 }
426 type testUser struct {
427 name string
428 workspaces []*testWorkspace
429
430 client *codersdk.Client
431 sdk codersdk.User
432 }
433
434 // Represent agent stats, to be inserted via stats batcher.
435 type agentStat struct {
436 // Set a range via start/end, multiple stats will be generated
437 // within the range.
438 startedAt time.Time
439 endedAt time.Time
440
441 sessionCountVSCode int64

Callers

nothing calls this directly

Calls 15

AddMethod · 0.95
ReportAppStatsMethod · 0.95
LoggerFunction · 0.92
NewDBFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
WithIntervalFunction · 0.92
WithEventChannelFunction · 0.92
CreateFirstUserFunction · 0.92
NewFunction · 0.92
WithFixedTokenFunction · 0.92

Tested by

no test coverage detected