Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable test for existing projects in travis #206

Merged
merged 1 commit into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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