Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
Signed-off-by: Doug Davis <[email protected]>
  • Loading branch information
Doug Davis committed Aug 30, 2021
1 parent 7f55620 commit 3c181ff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 9 additions & 3 deletions helloworld/run
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ ibmcloud ce app create -n helloworld --image ${REGISTRY}/helloworld
URL=$(ibmcloud ce app get -n helloworld -o url)

# Now call it
curl -fs $URL | tee out
[[ "${PIPESTATUS[0]}" == "0" ]]
curl -w "\n%{http_code}\n" -fs $URL | tee out
if ! [[ "${PIPESTATUS[0]}" == "0" ]] ; then
echo "Expected zero return code"
cat out
exit 1
fi

if ! [[ "$(curl -fs ${URL} -d "Hi")" == "Hi" ]]; then
curl -w "\n%{http_code}\n" -fs $URL -d "Hi" -o out
if [[ $(cat out) != "Hi" ]]; then
echo "Unexpected output"
cat out
exit 1
fi

Expand Down
7 changes: 6 additions & 1 deletion job2app/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ func main() {
}

// Something went wrong, pause and try again
fmt.Fprintf(os.Stderr, "%d: %s\n%#v\n", i, err, res)
body := []byte{}
if res != nil {
body, _ = ioutil.ReadAll(res.Body)
}
fmt.Fprintf(os.Stderr, "%d: err: %s\nhttp res: %#v\nbody:%s",
i, err, res, string(body))
time.Sleep(time.Second)
}
}(i)
Expand Down

0 comments on commit 3c181ff

Please sign in to comment.