File tree 2 files changed +13
-3
lines changed
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -26,4 +26,10 @@ See [Google Spanner Documentation](https://cloud.google.com/spanner/docs) for de
26
26
> 1481574547/u create_users_table (21.354507597s)
27
27
> 1496539702/u add_city_to_users (41.647359754s)
28
28
> 1496601752/u add_index_on_user_emails (2m12.155787369s)
29
- > 1496602638/u create_books_table (2m30.77299181s)
29
+ > 1496602638/u create_books_table (2m30.77299181s)
30
+
31
+ ## Testing
32
+
33
+ To unit test the `spanner` driver, `SPANNER_DATABASE` needs to be set. You'll
34
+ need to sign-up to Google Cloud Platform (GCP) and have a running Spanner
35
+ instance since it is not possible to run Google Spanner outside GCP.
Original file line number Diff line number Diff line change @@ -10,10 +10,14 @@ import (
10
10
11
11
func Test (t * testing.T ) {
12
12
if testing .Short () {
13
- t .Skip ("skipping testing Google Spanner during short testing" )
13
+ t .Skip ("skipping test in short mode." )
14
+ }
15
+
16
+ db , ok := os .LookupEnv ("SPANNER_DATABASE" )
17
+ if ! ok {
18
+ t .Skip ("SPANNER_DATABASE not set, skipping test." )
14
19
}
15
20
16
- db := os .Getenv ("SPANNER_DATABASE" )
17
21
s := & Spanner {}
18
22
addr := fmt .Sprintf ("spanner://%v" , db )
19
23
d , err := s .Open (addr )
You can’t perform that action at this time.
0 commit comments