Skip to content

Commit

Permalink
test(firestore): use firestore test project
Browse files Browse the repository at this point in the history
  • Loading branch information
crwilcox committed Oct 20, 2021
1 parent bc1490d commit 4d9e481
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions firestore/firestore_quickstart/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package main

import (
"os"
"strings"
"testing"
"time"
Expand All @@ -23,8 +24,11 @@ import (
)

func TestMain(t *testing.T) {
tc := testutil.SystemTest(t)
env := map[string]string{"GOOGLE_CLOUD_PROJECT": tc.ProjectID}
projectID := os.Getenv("GOLANG_SAMPLES_FIRESTORE_PROJECT")
if projectID == "" {
t.Skip("Skipping firestore test. Set GOLANG_SAMPLES_FIRESTORE_PROJECT.")
}
env := map[string]string{}

m := testutil.BuildMain(t)
defer m.Cleanup()
Expand All @@ -34,7 +38,7 @@ func TestMain(t *testing.T) {
}

testutil.Retry(t, 5, 5*time.Second, func(r *testutil.R) {
stdOut, stdErr, err := m.Run(env, 2*time.Minute, "-project", tc.ProjectID)
stdOut, stdErr, err := m.Run(env, 2*time.Minute, "-project", projectID)

if err != nil {
r.Errorf("execution failed: %v, stdOut:%s, stdErr:%s", err, stdOut, stdErr)
Expand Down

0 comments on commit 4d9e481

Please sign in to comment.