Skip to content

Commit

Permalink
Merge pull request #206 from Liujingfang1/master
Browse files Browse the repository at this point in the history
Enable test for existing projects in travis
  • Loading branch information
droot committed May 23, 2018
2 parents f1bc52d + 957ca06 commit 123e075
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ install:
-

script:
TRACE=1 ./test.sh
- TRACE=1 ./test.sh
- ./test_existing_projects.sh

# TBD. Suppressing for now.
notifications:
Expand Down
4 changes: 4 additions & 0 deletions samples/internal/test/e2e/kubebuildertest.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ func NewKubebuilderTest(dir, binDir string) *KubebuilderTest {
os.Setenv("TEST_ASSET_KUBECTL", strings.Join([]string{binDir, "kubectl"}, "/"))
os.Setenv("TEST_ASSET_KUBE_APISERVER", strings.Join([]string{binDir, "kube-apiserver"}, "/"))
os.Setenv("TEST_ASSET_ETCD", strings.Join([]string{binDir, "etcd"}, "/"))
cmd := exec.Command("command", "-v", "kubebuilder")
if err := kt.runCommand(cmd); err != nil {
os.Setenv("PATH",strings.Join([]string{binDir, os.Getenv("PATH")}, ":"))
}
return &kt
}

Expand Down
2 changes: 1 addition & 1 deletion samples/memcached-api-server/test/hack/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
creationTimestamp: null
labels:
api: ""
kubebuilder.k8s.io: master
kubebuilder.k8s.io: unknown
name: memcacheds.myapps.memcached.example.com
spec:
group: myapps.memcached.example.com
Expand Down
17 changes: 17 additions & 0 deletions test_existing_projects.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

go test -v ./samples/memcached-api-server

0 comments on commit 123e075

Please sign in to comment.