Create e2e test for Custom Metrics - Stackdriver Adapter

This commit is contained in:
Karol Wychowaniec
2017-08-31 17:35:17 +02:00
parent c746bd3c8a
commit 505ab0c79e
4 changed files with 314 additions and 0 deletions

View File

@@ -76,6 +76,20 @@ func testStackdriverMonitoring(f *framework.Framework, pods, allPodsCPU int, per
ctx := context.Background()
client, err := google.DefaultClient(ctx, gcm.CloudPlatformScope)
// Hack for running tests locally
// If this is your use case, create application default credentials:
// $ gcloud auth application-default login
// and uncomment following lines (comment out the two lines above): (DON'T set the env var below)
/*
ts, err := google.DefaultTokenSource(oauth2.NoContext)
framework.Logf("Couldn't get application default credentials, %v", err)
if err != nil {
framework.Failf("Error accessing application default credentials, %v", err)
}
client := oauth2.NewClient(oauth2.NoContext, ts)
*/
gcmService, err := gcm.New(client)
// set this env var if accessing Stackdriver test endpoint (default is prod):