(t *testing.T)
| 66 | } |
| 67 | |
| 68 | func TestProcessLogs(t *testing.T) { |
| 69 | testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) { |
| 70 | opts := structs.LogsOptions{ |
| 71 | Filter: options.String("test"), |
| 72 | Follow: options.Bool(false), |
| 73 | Prefix: options.Bool(false), |
| 74 | Since: options.Duration(2 * time.Minute), |
| 75 | } |
| 76 | ro := stdsdk.RequestOptions{ |
| 77 | Headers: stdsdk.Headers{ |
| 78 | "Filter": "test", |
| 79 | "Follow": "false", |
| 80 | "Prefix": "false", |
| 81 | "Since": "2m", |
| 82 | }, |
| 83 | } |
| 84 | p.On("ProcessLogs", "app1", "pid1", opts).Return(io.NopCloser(bytes.NewBuffer([]byte{})), nil) |
| 85 | r, err := c.Websocket("/apps/app1/processes/pid1/logs", ro) |
| 86 | require.NoError(t, err) |
| 87 | data, err := io.ReadAll(r) |
| 88 | require.NoError(t, err) |
| 89 | require.Equal(t, "", string(data)) |
| 90 | }) |
| 91 | } |
| 92 | |
| 93 | func TestProcessExecError(t *testing.T) { |
| 94 | testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) { |
nothing calls this directly
no test coverage detected