@@ -86,16 +86,10 @@ func TestMemcached(t *testing.T) {
86
86
ctx .AddFinalizerFn (func () error { return os .RemoveAll (absProjectPath ) })
87
87
88
88
os .Chdir ("memcached-operator" )
89
- repo , ok := os .LookupEnv ("TRAVIS_PULL_REQUEST_SLUG" )
90
- if repo == "" {
91
- repo , ok = os .LookupEnv ("TRAVIS_REPO_SLUG" )
92
- }
93
- if ok && repo != "" {
94
- commitSha , ok := os .LookupEnv ("TRAVIS_PULL_REQUEST_SHA" )
95
- if commitSha == "" {
96
- commitSha , ok = os .LookupEnv ("TRAVIS_COMMIT" )
97
- }
98
- if ok && commitSha != "" {
89
+ prSlug , ok := os .LookupEnv ("TRAVIS_PULL_REQUEST_SLUG" )
90
+ if ok && prSlug != "" {
91
+ prSha , ok := os .LookupEnv ("TRAVIS_PULL_REQUEST_SHA" )
92
+ if ok && prSha != "" {
99
93
gopkg , err := ioutil .ReadFile ("Gopkg.toml" )
100
94
if err != nil {
101
95
t .Fatal (err )
@@ -108,7 +102,7 @@ func TestMemcached(t *testing.T) {
108
102
// correctly.
109
103
gopkgString := string (gopkg )
110
104
gopkgLoc := strings .LastIndex (gopkgString , "\n name = \" github.com/operator-framework/operator-sdk\" \n " )
111
- gopkgString = gopkgString [:gopkgLoc ] + "\n source = \" https://github.com/" + repo + "\" \n revision = \" " + commitSha + "\" \n " + gopkgString [gopkgLoc + 1 :]
105
+ gopkgString = gopkgString [:gopkgLoc ] + "\n source = \" https://github.com/" + prSlug + "\" \n revision = \" " + prSha + "\" \n " + gopkgString [gopkgLoc + 1 :]
112
106
err = ioutil .WriteFile ("Gopkg.toml" , []byte (gopkgString ), filemode )
113
107
if err != nil {
114
108
t .Fatalf ("failed to write updated Gopkg.toml: %v" , err )
@@ -121,7 +115,7 @@ func TestMemcached(t *testing.T) {
121
115
}
122
116
cmdOut , err = exec .Command ("dep" , "ensure" ).CombinedOutput ()
123
117
if err != nil {
124
- t .Fatalf ("error after modifying Gopkg.toml : %v\n Command Output: %s\n " , err , string (cmdOut ))
118
+ t .Fatalf ("error: %v\n Command Output: %s\n " , err , string (cmdOut ))
125
119
}
126
120
127
121
// Set replicas to 2 to test leader election. In production, this should
@@ -214,7 +208,7 @@ func TestMemcached(t *testing.T) {
214
208
t .Fatalf ("dep ensure failed: %v\n Command Output:\n %v" , err , string (cmdOut ))
215
209
}
216
210
// link local sdk to vendor if not in travis
217
- if repo == "" {
211
+ if prSlug == "" {
218
212
os .RemoveAll ("vendor/github.com/operator-framework/operator-sdk/pkg" )
219
213
os .Symlink (filepath .Join (gopath , "src/github.com/operator-framework/operator-sdk/pkg" ),
220
214
"vendor/github.com/operator-framework/operator-sdk/pkg" )
0 commit comments