Skip to content

Commit

Permalink
travis: run tests pointing to rackspace and memset swift APIs
Browse files Browse the repository at this point in the history
Ensuring we run our tests against real servers should help improve their
reliability and also help finding errors that only happen in the real
world.

Tests are set as allowed failures for now to see how flaky they become.
More cloud providers might be added in the future.
  • Loading branch information
cezarsa committed Mar 5, 2017
1 parent 7f357ef commit 5850d90
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .travis.yml
Expand Up @@ -5,10 +5,26 @@ go:
- 1.1.2
- 1.2.2
- 1.3.3
- 1.4.2
- 1.5.1
- tip
- 1.4.3
- 1.5.4
- 1.6.4
- 1.7.5
- 1.8
- master

matrix:
include:
- go: 1.8
env: TEST_REAL_SERVER=rackspace
- go: 1.8
env: TEST_REAL_SERVER=memset
allow_failures:
- go: 1.8
env: TEST_REAL_SERVER=rackspace
- go: 1.8
env: TEST_REAL_SERVER=memset
install: go test -i ./...
script:
- test -z "$(go fmt ./...)"
- go test
- ./travis_realserver.sh
22 changes: 22 additions & 0 deletions travis_realserver.sh
@@ -0,0 +1,22 @@
#!/bin/bash
set -e

if [ ! "${TRAVIS_BRANCH}" = "master" ]; then
exit 0
fi

if [ "${TEST_REAL_SERVER}" = "rackspace" ] && [ ! -z "${RACKSPACE_APIKEY}" ]; then
echo "Running tests pointing to Rackspace"
export SWIFT_API_KEY=$RACKSPACE_APIKEY
export SWIFT_API_USER=$RACKSPACE_USER
export SWIFT_AUTH_URL=$RACKSPACE_AUTH
go test ./...
fi

if [ "${TEST_REAL_SERVER}" = "memset" ] && [ ! -z "${MEMSET_APIKEY}" ]; then
echo "Running tests pointing to Memset"
export SWIFT_API_KEY=$MEMSET_APIKEY
export SWIFT_API_USER=$MEMSET_USER
export SWIFT_AUTH_URL=$MEMSET_AUTH
go test
fi

0 comments on commit 5850d90

Please sign in to comment.