Skip to content

Commit 29d63f7

Browse files
committed
Merge branch 'master' into merge-buildah
2 parents 7bb8848 + 120a723 commit 29d63f7

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
# Build and test go
6464
- <<: *test
6565
name: Go on OpenShift
66-
script: travis_wait 20 make test/ci-go
66+
script: travis_wait 20 make test/ci-go ARGS="-v"
6767

6868
# Build and test ansible
6969
- <<: *test

Diff for: test/e2e/memcached_test.go

+13-7
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,16 @@ func TestMemcached(t *testing.T) {
9393
ctx.AddCleanupFn(func() error { return os.RemoveAll(absProjectPath) })
9494

9595
os.Chdir("memcached-operator")
96-
prSlug, ok := os.LookupEnv("TRAVIS_PULL_REQUEST_SLUG")
97-
if ok && prSlug != "" {
98-
prSha, ok := os.LookupEnv("TRAVIS_PULL_REQUEST_SHA")
99-
if ok && prSha != "" {
96+
repo, ok := os.LookupEnv("TRAVIS_PULL_REQUEST_SLUG")
97+
if repo == "" {
98+
repo, ok = os.LookupEnv("TRAVIS_REPO_SLUG")
99+
}
100+
if ok && repo != "" && repo != "operator-framework/operator-sdk" {
101+
commitSha, ok := os.LookupEnv("TRAVIS_PULL_REQUEST_SHA")
102+
if commitSha == "" {
103+
commitSha, ok = os.LookupEnv("TRAVIS_COMMIT")
104+
}
105+
if ok && commitSha != "" {
100106
gopkg, err := ioutil.ReadFile("Gopkg.toml")
101107
if err != nil {
102108
t.Fatal(err)
@@ -111,7 +117,7 @@ func TestMemcached(t *testing.T) {
111117
// correctly.
112118
gopkgString := string(gopkg)
113119
gopkgLoc := strings.LastIndex(gopkgString, "\n name = \"github.com/operator-framework/operator-sdk\"\n")
114-
gopkgString = gopkgString[:gopkgLoc] + "\n source = \"https://github.com/" + prSlug + "\"\n revision = \"" + prSha + "\"\n" + gopkgString[gopkgLoc+1:]
120+
gopkgString = gopkgString[:gopkgLoc] + "\n source = \"https://github.com/" + repo + "\"\n revision = \"" + commitSha + "\"\n" + gopkgString[gopkgLoc+1:]
115121
err = ioutil.WriteFile("Gopkg.toml", []byte(gopkgString), fileutil.DefaultFileMode)
116122
if err != nil {
117123
t.Fatalf("failed to write updated Gopkg.toml: %v", err)
@@ -124,7 +130,7 @@ func TestMemcached(t *testing.T) {
124130
}
125131
cmdOut, err = exec.Command("dep", "ensure").CombinedOutput()
126132
if err != nil {
127-
t.Fatalf("error: %v\nCommand Output: %s\n", err, string(cmdOut))
133+
t.Fatalf("error after modifying Gopkg.toml: %v\nCommand Output: %s\n", err, string(cmdOut))
128134
}
129135

130136
// Set replicas to 2 to test leader election. In production, this should
@@ -217,7 +223,7 @@ func TestMemcached(t *testing.T) {
217223
t.Fatalf("dep ensure failed: %v\nCommand Output:\n%v", err, string(cmdOut))
218224
}
219225
// link local sdk to vendor if not in travis
220-
if prSlug == "" {
226+
if repo == "" {
221227
os.RemoveAll("vendor/github.com/operator-framework/operator-sdk/pkg")
222228
cmdOut, err = exec.Command("cp", "-a",
223229
filepath.Join(gopath, "src/github.com/operator-framework/operator-sdk/pkg"),

0 commit comments

Comments
 (0)