@@ -6,26 +6,46 @@ import (
6
6
)
7
7
8
8
const (
9
- testProject = "test-project"
10
- testService = "test-service"
11
- testVersion = "test-version"
9
+ testProject = "test-project"
10
+ testGAEService = "test-gae-service"
11
+ testGAEVersion = "test-gae-version"
12
+ testRUNService = "test-run-service"
13
+ testRUNRevision = "test-run-revision"
12
14
)
13
15
14
16
func init () {
15
17
os .Setenv (EnvKeyGoogleCloudProject , testProject )
16
- os .Setenv (EnvKeyServiceName , testService )
17
- os .Setenv (EnvKeyServiceVersion , testVersion )
18
+ os .Setenv (EnvKeyGAEServiceName , testGAEService )
19
+ os .Setenv (EnvKeyGAEServiceVersion , testGAEVersion )
20
+ os .Setenv (EnvKeyRUNServiceName , testRUNService )
21
+ os .Setenv (EnvKeyRUNServiceRevision , testRUNRevision )
18
22
}
19
23
20
24
func TestEnviron (t * testing.T ) {
21
25
Reload ()
22
26
if ProjectID != testProject {
23
27
t .Fatalf ("unexpected, expected: %s, actual: %#v" , testProject , ProjectID )
24
28
}
25
- if ServiceName != testService {
26
- t .Fatalf ("unexpected, expected: %s, actual: %#v" , testService , ServiceName )
29
+
30
+ // Deprecated
31
+ if ServiceName != testGAEService {
32
+ t .Fatalf ("unexpected, expected: %s, actual: %#v" , testGAEService , ServiceName )
33
+ }
34
+ // Deprecated
35
+ if ServiceVersion != testGAEVersion {
36
+ t .Fatalf ("unexpected, expected: %s, actual: %#v" , testGAEVersion , ServiceVersion )
37
+ }
38
+
39
+ if GAEServiceName != testGAEService {
40
+ t .Fatalf ("unexpected, expected: %s, actual: %#v" , testGAEService , GAEServiceName )
41
+ }
42
+ if GAEServiceVersion != testGAEVersion {
43
+ t .Fatalf ("unexpected, expected: %s, actual: %#v" , testGAEVersion , GAEServiceVersion )
44
+ }
45
+ if RUNServiceName != testRUNService {
46
+ t .Fatalf ("unexpected, expected: %s, actual: %#v" , testRUNService , RUNServiceName )
27
47
}
28
- if ServiceVersion != testVersion {
29
- t .Fatalf ("unexpected, expected: %s, actual: %#v" , testVersion , ServiceVersion )
48
+ if RUNServiceRevision != testRUNRevision {
49
+ t .Fatalf ("unexpected, expected: %s, actual: %#v" , testRUNRevision , RUNServiceRevision )
30
50
}
31
51
}
0 commit comments