MCPcopy Create free account
hub / github.com/coder/coder / Test_Runner

Function Test_Runner

scaletest/workspacebuild/run_test.go:26–292  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24)
25
26func Test_Runner(t *testing.T) {
27 t.Parallel()
28 if testutil.RaceEnabled() {
29 t.Skip("Race detector enabled, skipping time-sensitive test.")
30 }
31
32 t.Run("OK", func(t *testing.T) {
33 t.Parallel()
34
35 ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
36 defer cancel()
37
38 client := coderdtest.New(t, &coderdtest.Options{
39 IncludeProvisionerDaemon: true,
40 })
41 user := coderdtest.CreateFirstUser(t, client)
42
43 authToken1 := uuid.NewString()
44 authToken2 := uuid.NewString()
45 authToken3 := uuid.NewString()
46 version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
47 Parse: echo.ParseComplete,
48 ProvisionPlan: echo.PlanComplete,
49 ProvisionApply: []*proto.Response{
50 {
51 Type: &proto.Response_Log{
52 Log: &proto.Log{
53 Level: proto.LogLevel_INFO,
54 Output: "hello from logs",
55 },
56 },
57 },
58 {
59 Type: &proto.Response_Apply{
60 Apply: &proto.ApplyComplete{},
61 },
62 },
63 },
64 ProvisionGraph: []*proto.Response{
65 {
66 Type: &proto.Response_Graph{
67 Graph: &proto.GraphComplete{
68 Resources: []*proto.Resource{
69 {
70 Name: "example1",
71 Type: "aws_instance",
72 Agents: []*proto.Agent{
73 {
74 Id: uuid.NewString(),
75 Name: "agent1",
76 Auth: &proto.Agent_Token{
77 Token: authToken1,
78 },
79 Apps: []*proto.App{},
80 },
81 {
82 Id: uuid.NewString(),
83 Name: "agent2",

Callers

nothing calls this directly

Calls 15

RunReturningWorkspaceMethod · 0.95
CleanupMethod · 0.95
RaceEnabledFunction · 0.92
NewFunction · 0.92
CreateFirstUserFunction · 0.92
CreateTemplateVersionFunction · 0.92
CreateTemplateFunction · 0.92
NewFunction · 0.92
WithFixedTokenFunction · 0.92
NewFunction · 0.92

Tested by

no test coverage detected