MCPcopy Create free account
hub / github.com/convox/rack / TestProcessLogs

Function TestProcessLogs

pkg/api/process_test.go:68–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func 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
93func TestProcessExecError(t *testing.T) {
94 testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) {

Callers

nothing calls this directly

Calls 5

StringFunction · 0.92
BoolFunction · 0.92
DurationFunction · 0.92
WebsocketMethod · 0.80
testServerFunction · 0.70

Tested by

no test coverage detected