physical/s3: skip unit test if missing ENV vars

This commit is contained in:
Armon Dadgar 2015-05-20 17:42:41 -07:00
parent e2ff72795e
commit 1851434407
1 changed files with 4 additions and 1 deletions

View File

@ -12,11 +12,14 @@ import (
)
func TestS3Backend(t *testing.T) {
if os.Getenv("AWS_ACCESS_KEY_ID") == "" || os.Getenv("AWS_SECRET_ACCESS_KEY") == "" {
t.SkipNow()
}
credentialChain := aws.DefaultChainCredentials
creds, err := credentialChain.Get()
if err != nil {
t.SkipNow()
t.Fatalf("err: %v", err)
}
region := os.Getenv("AWS_DEFAULT_REGION")