Skip to content

Commit

Permalink
update travis configs
Browse files Browse the repository at this point in the history
- add go v1.10
- add OSX
- fix goreleaser
  • Loading branch information
issmirnov committed Jun 16, 2018
1 parent 06e40fb commit e8b4f7b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ go:
- 1.7
- 1.8
- 1.9
- 1.10
- tip

os:
- linux
- osx

install:
- go get -t ./...

Expand All @@ -15,6 +20,7 @@ script:
- go build -v ./...
- ./e2e.sh

# getting errors on https://github.com/goreleaser/goreleaser/blob/master/pipeline/release/release.go#L55
#after_success:
# test -n "$TRAVIS_TAG" && go get github.com/goreleaser/goreleaser && goreleaser
after_success: |
test "$TRAVIS_OS_NAME" = "linux" -a -n "$TRAVIS_TAG" \
&& go get github.com/goreleaser/goreleaser \
&& goreleaser
19 changes: 7 additions & 12 deletions e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,18 @@ fi
ZAP_PID=$!

# pull results.
RESP="$(curl -I -L -H 'Host: g' localhost:16000/z 2>/dev/null | head -n 2)"
RESP="$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' -H 'Host: g' localhost:16000/z)"

# Check header
if [[ $RESP != *"HTTP/1.1 302 Found"* ]]; then
echo "302 status not found"
# Check response
expected="302 https://github.com/issmirnov/zap"
if [[ $RESP != $expected ]];then
echo "Status code or location don't match expectations"
echo "expected: $expected"
echo "got: $RESP"
kill -9 $ZAP_PID
exit 2
fi

# check location
if [[ $RESP != *"Location: https://github.com/issmirnov/zap"* ]]; then
echo "Location is wrong"
echo "Got: $RESP"
kill -9 $ZAP_PID
exit 3
fi

# cleanup
kill -9 $ZAP_PID
echo "End to end test passed."

0 comments on commit e8b4f7b

Please sign in to comment.