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

Function applyUpdate

agent/apphealth_test.go:273–288  ·  view source on GitHub ↗
(t *testing.T, apps []codersdk.WorkspaceApp, req *proto.BatchUpdateAppHealthRequest)

Source from the content-addressed store, hash-verified

271}
272
273func applyUpdate(t *testing.T, apps []codersdk.WorkspaceApp, req *proto.BatchUpdateAppHealthRequest) {
274 t.Helper()
275 for _, update := range req.Updates {
276 updateID, err := uuid.FromBytes(update.Id)
277 require.NoError(t, err)
278 updateHealth := codersdk.WorkspaceAppHealth(strings.ToLower(proto.AppHealth_name[int32(update.Health)]))
279
280 for i, app := range apps {
281 if app.ID != updateID {
282 continue
283 }
284 app.Health = updateHealth
285 apps[i] = app
286 }
287 }
288}

Callers 3

TestAppHealth_HealthyFunction · 0.85
TestAppHealth_500Function · 0.85
TestAppHealth_TimeoutFunction · 0.85

Calls 2

WorkspaceAppHealthTypeAlias · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected