Skip to content

Commit febbaab

Browse files
authored
Revert "Adds travis support for push builds" (#793)
1 parent 81a2ebf commit febbaab

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ go:
77

88
before_install:
99
- |
10-
if [ "$TRAVIS_COMMIT_RANGE" != "" ] && ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md)|(\.MD)|(\.png)|(\.pdf)|^(doc/)|^(MAINTAINERS)|^(LICENSE)'; then
10+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md)|(\.MD)|(\.png)|(\.pdf)|^(doc/)|^(MAINTAINERS)|^(LICENSE)'; then
1111
echo "Only doc files were updated, not running the CI."
1212
exit
1313
fi

test/e2e/memcached_test.go

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,10 @@ func TestMemcached(t *testing.T) {
8686
ctx.AddFinalizerFn(func() error { return os.RemoveAll(absProjectPath) })
8787

8888
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 != "" {
9993
gopkg, err := ioutil.ReadFile("Gopkg.toml")
10094
if err != nil {
10195
t.Fatal(err)
@@ -108,7 +102,7 @@ func TestMemcached(t *testing.T) {
108102
// correctly.
109103
gopkgString := string(gopkg)
110104
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:]
112106
err = ioutil.WriteFile("Gopkg.toml", []byte(gopkgString), filemode)
113107
if err != nil {
114108
t.Fatalf("failed to write updated Gopkg.toml: %v", err)
@@ -121,7 +115,7 @@ func TestMemcached(t *testing.T) {
121115
}
122116
cmdOut, err = exec.Command("dep", "ensure").CombinedOutput()
123117
if err != nil {
124-
t.Fatalf("error after modifying Gopkg.toml: %v\nCommand Output: %s\n", err, string(cmdOut))
118+
t.Fatalf("error: %v\nCommand Output: %s\n", err, string(cmdOut))
125119
}
126120

127121
// Set replicas to 2 to test leader election. In production, this should
@@ -214,7 +208,7 @@ func TestMemcached(t *testing.T) {
214208
t.Fatalf("dep ensure failed: %v\nCommand Output:\n%v", err, string(cmdOut))
215209
}
216210
// link local sdk to vendor if not in travis
217-
if repo == "" {
211+
if prSlug == "" {
218212
os.RemoveAll("vendor/github.com/operator-framework/operator-sdk/pkg")
219213
os.Symlink(filepath.Join(gopath, "src/github.com/operator-framework/operator-sdk/pkg"),
220214
"vendor/github.com/operator-framework/operator-sdk/pkg")

0 commit comments

Comments
 (0)