Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

[WIP] Metrics E2E work in PROW #344

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/e2e-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ function pubsub_setup() {
local service_account_key="${GOOGLE_APPLICATION_CREDENTIALS}"
# Enable monitoring
gcloud services enable monitoring
gcloud projects add-iam-policy-binding ${E2E_PROJECT_ID} \
--member=serviceAccount:${PUBSUB_SERVICE_ACCOUNT}@${E2E_PROJECT_ID}.iam.gserviceaccount.com \
--role roles/monitoring.editor
# When not running on Prow we need to set up a service account for PubSub
if (( ! IS_PROW )); then
echo "Set up ServiceAccount for Pub/Sub Admin"
Expand All @@ -82,9 +85,6 @@ function pubsub_setup() {
gcloud projects add-iam-policy-binding ${E2E_PROJECT_ID} \
--member=serviceAccount:${PUBSUB_SERVICE_ACCOUNT}@${E2E_PROJECT_ID}.iam.gserviceaccount.com \
--role roles/pubsub.editor
gcloud projects add-iam-policy-binding ${E2E_PROJECT_ID} \
--member=serviceAccount:${PUBSUB_SERVICE_ACCOUNT}@${E2E_PROJECT_ID}.iam.gserviceaccount.com \
--role roles/monitoring.editor
gcloud iam service-accounts keys create ${PUBSUB_SERVICE_ACCOUNT_KEY} \
--iam-account=${PUBSUB_SERVICE_ACCOUNT}@${E2E_PROJECT_ID}.iam.gserviceaccount.com
service_account_key="${PUBSUB_SERVICE_ACCOUNT_KEY}"
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ source $(dirname $0)/e2e-common.sh

initialize $@

go_test_e2e ./test/e2e || fail_test
go_test_e2e -timeout=30m ./test/e2e || fail_test

success
3 changes: 1 addition & 2 deletions test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func TestPubSubWithTarget(t *testing.T) {

// TestPubSubStackDriverMetrics tests we can knock down a target from a PubSub and that we send metrics to StackDriver.
func TestPubSubStackDriverMetrics(t *testing.T) {
t.Skip("See issues https://github.com/google/knative-gcp/issues/317 and https://github.com/cloudevents/sdk-go/pull/234")
t.Skip("See issues https://github.com/google/knative-gcp/issues/317")
cancel := logstream.Start(t)
defer cancel()
PubSubWithTargetTestImpl(t, packageToImageConfig, true /*assertMetrics */)
Expand All @@ -111,7 +111,6 @@ func TestStorage(t *testing.T) {

// TestStorageStackDriverMetrics tests we can knock down a target from a Storage and that we send metrics to StackDriver.
func TestStorageStackDriverMetrics(t *testing.T) {
t.Skip("See issue https://github.com/google/knative-gcp/issues/317")
cancel := logstream.Start(t)
defer cancel()
StorageWithTestImpl(t, packageToImageConfig, true /*assertMetrics */)
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/test_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ func StorageWithTestImpl(t *testing.T, packages map[string]string, assertMetrics
}
}

t.Logf("Sleeping for 10 minutes")
time.Sleep(time.Minute * 10)

if assertMetrics {
sleepTime := 1 * time.Minute
t.Logf("Sleeping %s to make sure metrics were pushed to stackdriver", sleepTime.String())
Expand Down