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

@@ -31,7 +31,7 @@ has_changes() {
local rev1=$1 local rev1=$1
local rev2=$2 local rev2=$2
local changes local changes
changes=$(git diff --oneline "$rev1..$rev2" -- "${INPUTFILES[@]}" | wc -l) changes=$(git diff --oneline "$rev1..$rev2" -- "${INPUTFILES[@]}" | wc -l)
[ "$changes" -gt 0 ] [ "$changes" -gt 0 ]
} }

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
} }

View File

@@ -14,7 +14,7 @@ PROXY_CONTAINER=$(ssh "$HOST" weave run -d weaveworks/socksproxy)
function finish { function finish {
echo "Removing proxy container.." echo "Removing proxy container.."
# shellcheck disable=SC2029 # shellcheck disable=SC2029
ssh "$HOST" docker rm -f "$PROXY_CONTAINER" ssh "$HOST" docker rm -f "$PROXY_CONTAINER"
} }
trap finish EXIT trap finish EXIT