(t *testing.T)
| 27 | ) |
| 28 | |
| 29 | func TestGetManifest(t *testing.T) { |
| 30 | t.Parallel() |
| 31 | |
| 32 | someTime, err := time.Parse(time.RFC3339, "2023-01-01T00:00:00Z") |
| 33 | require.NoError(t, err) |
| 34 | someTime = dbtime.Time(someTime) |
| 35 | |
| 36 | expectedEnvVars := map[string]string{ |
| 37 | "FOO": "bar", |
| 38 | "COOL_ENV": "dean was here", |
| 39 | } |
| 40 | expectedEnvVarsJSON, err := json.Marshal(expectedEnvVars) |
| 41 | require.NoError(t, err) |
| 42 | |
| 43 | var ( |
| 44 | owner = database.User{ |
| 45 | ID: uuid.New(), |
| 46 | Username: "cool-user", |
| 47 | } |
| 48 | workspace = database.Workspace{ |
| 49 | ID: uuid.New(), |
| 50 | OwnerID: owner.ID, |
| 51 | OwnerUsername: owner.Username, |
| 52 | Name: "cool-workspace", |
| 53 | } |
| 54 | agent = database.WorkspaceAgent{ |
| 55 | ID: uuid.New(), |
| 56 | Name: "cool-agent", |
| 57 | EnvironmentVariables: pqtype.NullRawMessage{ |
| 58 | RawMessage: expectedEnvVarsJSON, |
| 59 | Valid: true, |
| 60 | }, |
| 61 | Directory: "/cool/dir", |
| 62 | MOTDFile: "/cool/motd", |
| 63 | } |
| 64 | childAgent = database.WorkspaceAgent{ |
| 65 | ID: uuid.New(), |
| 66 | Name: "cool-child-agent", |
| 67 | ParentID: uuid.NullUUID{Valid: true, UUID: agent.ID}, |
| 68 | Directory: "/workspace/dir", |
| 69 | MOTDFile: "/workspace/motd", |
| 70 | } |
| 71 | apps = []database.WorkspaceApp{ |
| 72 | { |
| 73 | ID: uuid.New(), |
| 74 | Url: sql.NullString{String: "http://localhost:1234", Valid: true}, |
| 75 | External: false, |
| 76 | Slug: "cool-app-1", |
| 77 | DisplayName: "app 1", |
| 78 | Command: sql.NullString{String: "cool command", Valid: true}, |
| 79 | Icon: "/icon.png", |
| 80 | Subdomain: true, |
| 81 | SharingLevel: database.AppSharingLevelAuthenticated, |
| 82 | Health: database.WorkspaceAppHealthHealthy, |
| 83 | HealthcheckUrl: "http://localhost:1234/health", |
| 84 | HealthcheckInterval: 10, |
| 85 | HealthcheckThreshold: 3, |
| 86 | }, |
nothing calls this directly
no test coverage detected