Merge pull request #159 from hongchaodeng/master
customize test namespace and use build-id in it
This commit is contained in:
Коммит
777e7ee930
|
@ -28,6 +28,10 @@ glide install
|
|||
|
||||
GIT_VERSION=$(git rev-parse HEAD)
|
||||
export CONTROLLER_IMAGE="gcr.io/coreos-k8s-scale-testing/kube-etcd-controller:${GIT_VERSION}"
|
||||
export TEST_NAMESPACE="e2e-test-${BUILD_ID}"
|
||||
|
||||
echo "controller image: ${CONTROLLER_IMAGE}"
|
||||
echo "test namespace: ${TEST_NAMESPACE}"
|
||||
|
||||
if "hack/test"; then
|
||||
echo "Success! ==="
|
||||
|
|
|
@ -45,7 +45,7 @@ function build_pass {
|
|||
|
||||
function e2e_pass {
|
||||
TEST_PKGS=`go list ./test/... | grep -v framework`
|
||||
go test -v ${TEST_PKGS} --kubeconfig $KUBERNETES_KUBECONFIG_PATH --controller-image $CONTROLLER_IMAGE
|
||||
go test -v ${TEST_PKGS} --kubeconfig $KUBERNETES_KUBECONFIG_PATH --controller-image $CONTROLLER_IMAGE --namespace ${TEST_NAMESPACE}
|
||||
}
|
||||
|
||||
for p in $PASSES; do
|
||||
|
|
|
@ -26,6 +26,7 @@ type Framework struct {
|
|||
func Setup() error {
|
||||
kubeconfig := flag.String("kubeconfig", "", "kube config path, e.g. $HOME/.kube/config")
|
||||
ctrlImage := flag.String("controller-image", "", "controller image, e.g. gcr.io/coreos-k8s-scale-testing/kube-etcd-controller")
|
||||
ns := flag.String("namespace", "default", "e2e test namespace")
|
||||
flag.Parse()
|
||||
|
||||
config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig)
|
||||
|
@ -38,7 +39,7 @@ func Setup() error {
|
|||
}
|
||||
namespace, err := cli.Namespaces().Create(&api.Namespace{
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
GenerateName: fmt.Sprintf("e2e-test-"),
|
||||
Name: *ns,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -60,10 +61,12 @@ func Teardown() error {
|
|||
}
|
||||
fmt.Println("kube-etcd-controller logs ===")
|
||||
fmt.Println(buf.String())
|
||||
// TODO: delete TPR
|
||||
if err := Global.KubeClient.Namespaces().Delete(Global.Namespace.Name); err != nil {
|
||||
return err
|
||||
if Global.Namespace.Name != "default" {
|
||||
if err := Global.KubeClient.Namespaces().Delete(Global.Namespace.Name); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// TODO: delete TPR
|
||||
// TODO: check all deleted and wait
|
||||
Global = nil
|
||||
logrus.Info("e2e teardown successfully")
|
||||
|
|
Загрузка…
Ссылка в новой задаче