Skip to content

Commit 123e075

Browse files
authored
Merge pull request #206 from Liujingfang1/master
Enable test for existing projects in travis
2 parents f1bc52d + 957ca06 commit 123e075

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ install:
2222
-
2323

2424
script:
25-
TRACE=1 ./test.sh
25+
- TRACE=1 ./test.sh
26+
- ./test_existing_projects.sh
2627

2728
# TBD. Suppressing for now.
2829
notifications:

samples/internal/test/e2e/kubebuildertest.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ func NewKubebuilderTest(dir, binDir string) *KubebuilderTest {
1919
os.Setenv("TEST_ASSET_KUBECTL", strings.Join([]string{binDir, "kubectl"}, "/"))
2020
os.Setenv("TEST_ASSET_KUBE_APISERVER", strings.Join([]string{binDir, "kube-apiserver"}, "/"))
2121
os.Setenv("TEST_ASSET_ETCD", strings.Join([]string{binDir, "etcd"}, "/"))
22+
cmd := exec.Command("command", "-v", "kubebuilder")
23+
if err := kt.runCommand(cmd); err != nil {
24+
os.Setenv("PATH",strings.Join([]string{binDir, os.Getenv("PATH")}, ":"))
25+
}
2226
return &kt
2327
}
2428

samples/memcached-api-server/test/hack/install.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
creationTimestamp: null
55
labels:
66
api: ""
7-
kubebuilder.k8s.io: master
7+
kubebuilder.k8s.io: unknown
88
name: memcacheds.myapps.memcached.example.com
99
spec:
1010
group: myapps.memcached.example.com

test_existing_projects.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2018 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
go test -v ./samples/memcached-api-server

0 commit comments

Comments
 (0)