nolint:revive // yes, this is a control flag, and that is OK in a unit test.
(name string, healthy bool, mutators ...func(*codersdk.WorkspaceProxy))
| 245 | |
| 246 | //nolint:revive // yes, this is a control flag, and that is OK in a unit test. |
| 247 | func fakeWorkspaceProxy(name string, healthy bool, mutators ...func(*codersdk.WorkspaceProxy)) codersdk.WorkspaceProxy { |
| 248 | var status codersdk.WorkspaceProxyStatus |
| 249 | if !healthy { |
| 250 | status = codersdk.WorkspaceProxyStatus{ |
| 251 | Status: codersdk.ProxyUnreachable, |
| 252 | Report: codersdk.ProxyHealthReport{ |
| 253 | Errors: []string{assert.AnError.Error()}, |
| 254 | }, |
| 255 | } |
| 256 | } |
| 257 | wsp := codersdk.WorkspaceProxy{ |
| 258 | Region: codersdk.Region{ |
| 259 | Name: name, |
| 260 | Healthy: healthy, |
| 261 | }, |
| 262 | Status: status, |
| 263 | } |
| 264 | for _, f := range mutators { |
| 265 | f(&wsp) |
| 266 | } |
| 267 | return wsp |
| 268 | } |
| 269 | |
| 270 | func fakeFetchWorkspaceProxies(ps ...codersdk.WorkspaceProxy) func(context.Context) (codersdk.RegionsResponse[codersdk.WorkspaceProxy], error) { |
| 271 | return func(context.Context) (codersdk.RegionsResponse[codersdk.WorkspaceProxy], error) { |
no test coverage detected