Review tweaks

This commit is contained in:
Jonathan Lange
2016-07-12 15:51:42 +01:00
parent 8c6170d292
commit 0620e589fa
3 changed files with 2 additions and 5 deletions

View File

@@ -155,18 +155,15 @@ func getSchedule(tests []string) ([]string, error) {
shardID = os.Getenv("CIRCLE_NODE_INDEX") shardID = os.Getenv("CIRCLE_NODE_INDEX")
requestBody = &bytes.Buffer{} requestBody = &bytes.Buffer{}
) )
fmt.Printf("getSchedule: %v", tests)
if err := json.NewEncoder(requestBody).Encode(schedule{tests}); err != nil { if err := json.NewEncoder(requestBody).Encode(schedule{tests}); err != nil {
return []string{}, err return []string{}, err
} }
url := fmt.Sprintf("http://%s/schedule/%s/%s/%s", schedulerHost, testRun, shardCount, shardID) url := fmt.Sprintf("http://%s/schedule/%s/%s/%s", schedulerHost, testRun, shardCount, shardID)
fmt.Printf("POSTing to %v: %v", url, requestBody)
resp, err := http.Post(url, jsonContentType, requestBody) resp, err := http.Post(url, jsonContentType, requestBody)
if err != nil { if err != nil {
return []string{}, err return []string{}, err
} }
var sched schedule var sched schedule
fmt.Printf("Got response: %v", resp.Body)
if err := json.NewDecoder(resp.Body).Decode(&sched); err != nil { if err := json.NewDecoder(resp.Body).Decode(&sched); err != nil {
return []string{}, err return []string{}, err
} }