(s *DispatchServerV2, runtimeID string, commitID string, requestID string)
| 153 | } |
| 154 | |
| 155 | func initRuntime(s *DispatchServerV2, runtimeID string, commitID string, requestID string) { |
| 156 | body := `{"key1":1,"key2":2}` |
| 157 | req := httptest.NewRequest("POST", "/status", strings.NewReader(body)) |
| 158 | req.Header.Set("x-cfc-runtimeid", runtimeID) |
| 159 | req.Header.Set("x-cfc-commitid", commitID) |
| 160 | req.Header.Set("x-cfc-hostip", "127.0.0.1") |
| 161 | q := req.URL.Query() |
| 162 | q.Add("initstart", "10") |
| 163 | q.Add("initdone", "20") |
| 164 | q.Add("concurrentmode", "false") |
| 165 | req.URL.RawQuery = q.Encode() |
| 166 | bodyString := fmt.Sprintf("{\"requestid\":\"%s\", \"success\": \"true\"}\n", requestID) |
| 167 | bodyBytes := []byte(bodyString) |
| 168 | resp := kunhttptest.NewResponseHijacker(bodyBytes) |
| 169 | |
| 170 | s.invokeHandler(resp, req) |
| 171 | } |
no test coverage detected