Skip to content

Commit

Permalink
travis: ignore decryption errors for KOPIA_GCS_CREDENTIALS_FILE and s…
Browse files Browse the repository at this point in the history
…kip tests, decryption does not work for pull requests
  • Loading branch information
jkowalski committed May 11, 2019
1 parent beede7c commit e2554df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -5,7 +5,7 @@ os:
- linux
before_install:
- openssl aes-256-cbc -K $encrypted_0098ef8519ef_key -iv $encrypted_0098ef8519ef_iv
-in test_service_account.json.enc -out storage/gcs/test_service_account.json -d
-in test_service_account.json.enc -out storage/gcs/test_service_account.json -d || echo OK
install: make travis-setup
script: make travis
env:
Expand Down
7 changes: 6 additions & 1 deletion storage/gcs/gcs_storage_test.go
Expand Up @@ -17,10 +17,15 @@ func TestGCSStorage(t *testing.T) {
t.Skip("KOPIA_GCS_TEST_BUCKET not provided")
}

credsFile := os.Getenv("KOPIA_GCS_CREDENTIALS_FILE")
if _, err := os.Stat(credsFile); err != nil {
t.Skip("skipping test because GCS credentials file can't be opened")
}

ctx := context.Background()
st, err := gcs.New(ctx, &gcs.Options{
BucketName: bucket,
ServiceAccountCredentials: os.Getenv("KOPIA_GCS_CREDENTIALS_FILE"),
ServiceAccountCredentials: credsFile,
})

if err != nil {
Expand Down

0 comments on commit e2554df

Please sign in to comment.