diff --git a/.travis.yml b/.travis.yml index 8180cc78d..58d095fe4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,14 +24,6 @@ jobs: - stage: unit name: Unit tests - env: - - HELM_VERSION=v2.12.0 - - DEP_VERSION=v0.5.0 - install: - - curl -Lo dep https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 && chmod +x dep && sudo mv dep /usr/local/bin/ - - curl -Lo helm.tar.gz https://storage.googleapis.com/kubernetes-helm/helm-$HELM_VERSION-linux-amd64.tar.gz && tar xfz helm.tar.gz && sudo mv linux-amd64/{helm,tiller} /usr/local/bin/ - before_script: - - helm init --client-only script: - make test-unit after_success: @@ -45,69 +37,70 @@ jobs: env: - KUBECTL_VERSION=v1.15.0 - OPERATOR_SDK_VERSION=v0.17.0 - - HELM_VERSION=v2.12.0 - - DEP_VERSION=v0.5.0 - CLUSTER_NAME="pravega-operator-travis-$(date +'%Y%m%d%H%M%S')" - - CLUSTER_ZONE=us-west-2 - - CLUSTER_SIZE=3 - - CLUSTER_NODE_TYPE=m5.xlarge - - CLUSTER_NODE_GROUP=standard-workers - install: - - pip install --upgrade --user awscli - - curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ - - curl -Lo dep https://github.com/golang/dep/releases/download/$DEP_VERSION/dep-linux-amd64 && chmod +x dep && sudo mv dep /usr/local/bin/ - - curl -Lo operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/$OPERATOR_SDK_VERSION/operator-sdk-$OPERATOR_SDK_VERSION-x86_64-linux-gnu && chmod +x operator-sdk && sudo mv operator-sdk /usr/local/bin/ - - curl -Lo helm.tar.gz https://storage.googleapis.com/kubernetes-helm/helm-$HELM_VERSION-linux-amd64.tar.gz && tar xfz helm.tar.gz && sudo mv linux-amd64/{helm,tiller} /usr/local/bin/ - before_script: - - curl --silent --location "https://github.com/weaveworks/eksctl/releases/download/latest_release/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp - - sudo mv /tmp/eksctl /usr/local/bin - - eksctl version - - aws configure set default.region $CLUSTER_ZONE - - aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID - - aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY - - travis_wait 20 eksctl create cluster --name $CLUSTER_NAME --version 1.15 --nodegroup-name $CLUSTER_NODE_GROUP --node-type $CLUSTER_NODE_TYPE --nodes $CLUSTER_SIZE - - kubectl config view - - kubectl config current-context - - kubectl get nodes -o wide - - kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$GOOGLE_SERVICE_ACCOUNT - # Install Helm Tiller - - kubectl create serviceaccount --namespace kube-system tiller - - kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller - - helm init --service-account tiller --wait - # Install NFS provisioner - - helm install stable/nfs-server-provisioner - - kubectl -n default create -f test/e2e/resources/tier2.yaml - - JSONPATH='{.status.phase}'; until kubectl get pvc pravega-tier2 -o jsonpath="$JSONPATH" 2>&1 | grep -q "Bound"; do sleep 1; done - # Install ZooKeeper - - kubectl -n default create -f test/e2e/resources/zookeeper.yaml - - JSONPATH1='{.spec.replicas}'; JSONPATH2='{.status.readyReplicas}'; replicas=$(kubectl get zookeepercluster zk -o jsonpath=$JSONPATH1);ready=$(kubectl get zookeepercluster zk -o jsonpath=$JSONPATH2); echo "REPLICAS=$replicas, READY=$ready"; while [ "$replicas" != "$ready" ]; do sleep 5s; replicas=$(kubectl get zookeepercluster zk -o jsonpath=$JSONPATH1);ready=$(kubectl get zookeepercluster zk -o jsonpath=$JSONPATH2); echo "REPLICAS=$replicas, READY=$ready"; done - # Install Bookkeeper - - kubectl -n default create -f test/e2e/resources/bookkeeper.yaml + script: + - curl -Lo packet-cli https://github.com/packethost/packet-cli/releases/download/0.0.7/packet-linux-amd64 && chmod +x packet-cli && sudo mv packet-cli /usr/local/bin/ + - ssh-keygen -f ~/.ssh/id_rsa -P "" + - pub_key=`cat ~/.ssh/id_rsa.pub` + - echo " publc key is $pub_key" + - echo "packet-cli ssh-key create --key \"$(cat ~/.ssh/id_rsa.pub)\" --label \"pravega\"" + - packet-cli ssh-key create --key "$(cat ~/.ssh/id_rsa.pub)" --label "pravega-travis" + - packet-cli device create -H $CLUSTER_NAME -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f nrt1 + - packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME | awk '{print $2}' + - CLUSTER_ID=`packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME | awk '{print $2}' | tr -d ' '` + - echo "cluster id is $CLUSTER_ID" + - packet-cli device create -H $CLUSTER_NAME"-worker1" -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f nrt1 + - packet-cli device create -H $CLUSTER_NAME"-worker2" -o "ubuntu_20_04" -P c1.small.x86 -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 -f nrt1 + - sleep 300 + - CLUSTER_IP=`packet-cli device get -i $CLUSTER_ID -y | grep "\- address:" | head -1 |awk '{print $3}' | tr -d ' '` + - echo "Cluster IP is $CLUSTER_IP" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "sudo apt-get update;sudo apt-get install git -y;git clone https://github.com/pravega/pravega-operator.git; cd pravega-operator;git checkout issue-cncf-cluster" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP /root/pravega-operator/test/e2e/resources/kubernetes_master_install.sh + - CLUSTER_ID1=`packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME"-worker1" | awk '{print $2}' | tr -d ' '` + - CLUSTER_IP1=`packet-cli device get -i $CLUSTER_ID1 -y | grep "\- address:" | head -1 |awk '{print $3}' | tr -d ' '` + - CLUSTER_ID2=`packet-cli device get -p 454b8b42-33d3-4e7e-8acf-1d1a5fec7e85 | grep $CLUSTER_NAME"-worker2" | awk '{print $2}' | tr -d ' '` + - CLUSTER_IP2=`packet-cli device get -i $CLUSTER_ID2 -y | grep "\- address:" | head -1 |awk '{print $3}' | tr -d ' '` + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP1 "sudo apt-get update;sudo apt-get install git -y;git clone https://github.com/pravega/pravega-operator.git; cd pravega-operator;git checkout issue-cncf-cluster" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP2 "sudo apt-get update;sudo apt-get install git -y;git clone https://github.com/pravega/pravega-operator.git; cd pravega-operator;git checkout issue-cncf-cluster" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP1 /root/pravega-operator/test/e2e/resources/kubernetes_slave_install.sh + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP2 /root/pravega-operator/test/e2e/resources/kubernetes_slave_install.sh + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP 'kubeadm token create --print-join-command | head -2' >JOIN + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP1 $(cat JOIN) + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP2 $(cat JOIN) + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl get nodes" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "mkdir /data;kubectl create -f /root/pravega-operator/test/e2e/resources/local-storage.yaml" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "curl -L https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "helm repo add stable https://kubernetes-charts.storage.googleapis.com;helm install stable/nfs-server-provisioner --generate-name;kubectl -n default create -f /root/pravega-operator/test/e2e/resources/tier2.yaml" + + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl create -f /root/pravega-operator/test/e2e/resources/zookeeper.yaml" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl -n default create -f /root/pravega-operator/test/e2e/resources/bookkeeper.yaml" - sleep 30s - - kubectl -n default create -f test/e2e/resources/bk-version-map.yaml - - kubectl -n default create -f test/e2e/resources/bk-config-map.yaml - - kubectl -n default create -f test/e2e/resources/bk-cluster.yaml - - JPATH1='{.spec.replicas}'; JPATH2='{.status.readyReplicas}'; bk_replicas=$(kubectl get bookkeepercluster pravega -o jsonpath=$JPATH1);bk_ready=$(kubectl get bookkeepercluster pravega -o jsonpath=$JPATH2); echo "REPLICAS=$bk_replicas, READY=$bk_ready"; while [ "$bk_replicas" != "$bk_ready" ]; do sleep 1; bk_replicas=$(kubectl get bookkeepercluster pravega -o jsonpath=$JPATH1); bk_ready=$(kubectl get bookkeepercluster pravega -o jsonpath=$JPATH2); echo "REPLICAS=$bk_replicas, READY=$bk_ready"; done - # Install the ConfigMap for version dependency - - kubectl -n default create -f deploy/version_map.yaml - - kubectl apply -f "https://github.com/jetstack/cert-manager/releases/download/v0.14.1/cert-manager.crds.yaml" - - helm repo add jetstack https://charts.jetstack.io - - helm repo update - - helm install --name cert-manager --namespace cert-manager --version v0.14.1 jetstack/cert-manager --wait - - kubectl create -f deploy/certificate.yaml - - kubectl create -f deploy/webhook.yaml - - kubectl create -f test/e2e/resources/crd.yaml + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl -n default create -f /root/pravega-operator/test/e2e/resources/bk-version-map.yaml" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl -n default create -f /root/pravega-operator/test/e2e/resources/bk-config-map.yaml" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl -n default create -f /root/pravega-operator/test/e2e/resources/bk-cluster.yaml" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl -n default create -f /root/pravega-operator/deploy/version_map.yaml" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl apply -f \"https://github.com/jetstack/cert-manager/releases/download/v0.14.1/cert-manager.crds.yaml\"" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "helm repo add jetstack https://charts.jetstack.io" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "helm repo update" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl create namespace cert-manager;helm install cert-manager jetstack/cert-manager --namespace cert-manager --version v0.14.1 --wait" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl create -f /root/pravega-operator/deploy/certificate.yaml" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl create -f /root/pravega-operator/deploy/webhook.yaml" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "kubectl create -f /root/pravega-operator/test/e2e/resources/crd.yaml" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "curl -Lo operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/$OPERATOR_SDK_VERSION/operator-sdk-$OPERATOR_SDK_VERSION-x86_64-linux-gnu && chmod +x operator-sdk && sudo mv operator-sdk /usr/local/bin/" # Show Pravega dependencies - - kubectl -n default get pod,pvc,svc -o wide - script: # ping stdout every 5 minutes or Travis kills build # ref: https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received - - while sleep 5m; do kubectl get pods; done & - - make test-e2e + - while sleep 5m; do echo hello; done & + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer);source /root/.gvm/scripts/gvm;gvm install go1.13.8 --binary;gvm use go1.13.8 --default" + - ssh -o StrictHostKeyChecking=no root@$CLUSTER_IP "cd /root/pravega-operator;source /root/.gvm/scripts/gvm;make test-e2e" # kill background echo loop - echo "killing while sleep loop" && kill %1 after_script: - - eksctl delete cluster --name $CLUSTER_NAME + - SSHKEY=`packet-cli ssh-key get | grep "pravega-travis" | awk '{print $2}' | tr -d ' '` + - echo y | packet-cli ssh-key delete -i $SSHKEY + - echo y | packet-cli device delete -i $CLUSTER_ID + - echo y | packet-cli device delete -i $CLUSTER_ID1 + - echo y | packet-cli device delete -i $CLUSTER_ID2 - stage: deploy name: Push Docker image diff --git a/Makefile b/Makefile index b89629b16..bc9fbbcf3 100644 --- a/Makefile +++ b/Makefile @@ -9,12 +9,14 @@ SHELL=/bin/bash -o pipefail PROJECT_NAME=pravega-operator -REPO=tristan1900/$(PROJECT_NAME) +REPO=testpravegaop/$(PROJECT_NAME) VERSION=$(shell git describe --always --tags --dirty | sed "s/\(.*\)-g`git rev-parse --short HEAD`/\1/") GIT_SHA=$(shell git rev-parse --short HEAD) TEST_IMAGE=$(REPO)-testimages:$(VERSION) GOOS=linux GOARCH=amd64 +DOCKER_TEST_PASS=testpravegaop +DOCKER_TEST_USER=testpravegaop .PHONY: all build check clean test diff --git a/test/e2e/basic_test.go b/test/e2e/basic_test.go index 118a7f27b..f641656c3 100644 --- a/test/e2e/basic_test.go +++ b/test/e2e/basic_test.go @@ -34,6 +34,10 @@ func testCreateRecreateCluster(t *testing.T) { g.Expect(err).NotTo(HaveOccurred()) f := framework.Global + // A workaround for issue 93 + err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace) + g.Expect(err).NotTo(HaveOccurred()) + defaultCluster := pravega_e2eutil.NewDefaultCluster(namespace) defaultCluster.WithDefaults() @@ -51,6 +55,10 @@ func testCreateRecreateCluster(t *testing.T) { err = pravega_e2eutil.WaitForClusterToTerminate(t, f, ctx, pravega) g.Expect(err).NotTo(HaveOccurred()) + // A workaround for issue 93 + err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace) + g.Expect(err).NotTo(HaveOccurred()) + defaultCluster = pravega_e2eutil.NewDefaultCluster(namespace) defaultCluster.WithDefaults() @@ -72,6 +80,4 @@ func testCreateRecreateCluster(t *testing.T) { err = pravega_e2eutil.WaitForClusterToTerminate(t, f, ctx, pravega) g.Expect(err).NotTo(HaveOccurred()) - err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace) - g.Expect(err).NotTo(HaveOccurred()) } diff --git a/test/e2e/resources/kubernetes_master_install.sh b/test/e2e/resources/kubernetes_master_install.sh new file mode 100755 index 000000000..c4618a01a --- /dev/null +++ b/test/e2e/resources/kubernetes_master_install.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +sudo apt-get update +echo "update done" +sudo apt install docker.io -y +echo "docker install" +sudo systemctl enable --now docker +sudo apt-get install nfs-common -y +sudo rm /lib/systemd/system/nfs-common.service +sudo systemctl daemon-reload +sudo systemctl start nfs-common +sudo systemctl status nfs-common +apt-get update && apt-get install -y \ + apt-transport-https ca-certificates curl software-properties-common gnupg2 +echo "installed certs" +sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - +echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" \ + | sudo tee -a /etc/apt/sources.list.d/kubernetes.list \ + && sudo apt-get update +sudo apt-get update \ + && sudo apt-get install -yq \ + kubelet \ + kubeadm \ + kubernetes-cni +sudo apt-mark hold kubelet kubeadm kubectl +UUID=`cat /etc/fstab | grep swap | awk '{print $1}' | tr -d "#UUID="` +sed -i '2 s/^/#/' /etc/fstab +echo "swapoff UUID=$UUID" +swapoff UUID=$UUID +IP=`ifconfig bond0:0 | grep "inet" | awk '{print $2}'` +sudo kubeadm init --apiserver-advertise-address=$IP +mkdir -p $HOME/.kube +sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config +sudo chown $(id -u):$(id -g) $HOME/.kube/config +kubectl get nodes +kubectl apply -f https://docs.projectcalico.org/v3.14/manifests/calico.yaml +kubectl get nodes +sudo apt-get install binutils bison gcc -y +mkdir /export diff --git a/test/e2e/resources/kubernetes_slave_install.sh b/test/e2e/resources/kubernetes_slave_install.sh new file mode 100755 index 000000000..ef89a65df --- /dev/null +++ b/test/e2e/resources/kubernetes_slave_install.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +sudo apt-get update +echo "update done" +sudo apt-get install nfs-common -y +sudo rm /lib/systemd/system/nfs-common.service +sudo systemctl daemon-reload +sudo systemctl start nfs-common +sudo systemctl status nfs-common +sudo apt install docker.io -y +echo "docker install" +sudo systemctl enable --now docker +apt-get update && apt-get install -y \ + apt-transport-https ca-certificates curl software-properties-common gnupg2 +echo "installed certs" +sudo curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - +echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" \ + | sudo tee -a /etc/apt/sources.list.d/kubernetes.list \ + && sudo apt-get update +sudo apt-get update \ + && sudo apt-get install -yq \ + kubelet \ + kubeadm \ + kubernetes-cni +sudo apt-mark hold kubelet kubeadm kubectl +UUID=`cat /etc/fstab | grep swap | awk '{print $1}' | tr -d "#UUID="` +sed -i '2 s/^/#/' /etc/fstab +echo "swapoff UUID=$UUID" +swapoff UUID=$UUID diff --git a/test/e2e/resources/local-storage.yaml b/test/e2e/resources/local-storage.yaml new file mode 100644 index 000000000..2002d4b9a --- /dev/null +++ b/test/e2e/resources/local-storage.yaml @@ -0,0 +1,114 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: local-path-storage +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: local-path-provisioner-service-account + namespace: local-path-storage +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: local-path-provisioner-role +rules: +- apiGroups: [""] + resources: ["nodes", "persistentvolumeclaims"] + verbs: ["get", "list", "watch"] +- apiGroups: [""] + resources: ["endpoints", "persistentvolumes", "pods"] + verbs: ["*"] +- apiGroups: [""] + resources: ["events"] + verbs: ["create", "patch"] +- apiGroups: ["storage.k8s.io"] + resources: ["storageclasses"] + verbs: ["get", "list", "watch"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: local-path-provisioner-bind +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: local-path-provisioner-role +subjects: +- kind: ServiceAccount + name: local-path-provisioner-service-account + namespace: local-path-storage +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: local-path-provisioner + namespace: local-path-storage +spec: + replicas: 1 + selector: + matchLabels: + app: local-path-provisioner + template: + metadata: + labels: + app: local-path-provisioner + spec: + serviceAccountName: local-path-provisioner-service-account + containers: + - name: local-path-provisioner + image: rancher/local-path-provisioner:v0.0.14 + imagePullPolicy: IfNotPresent + command: + - local-path-provisioner + - --debug + - start + - --config + - /etc/config/config.json + volumeMounts: + - name: config-volume + mountPath: /etc/config/ + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + volumes: + - name: config-volume + configMap: + name: local-path-config +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: standard + annotations: + storageclass.kubernetes.io/is-default-class: "true" +provisioner: rancher.io/local-path +volumeBindingMode: WaitForFirstConsumer +reclaimPolicy: Delete +--- +kind: ConfigMap +apiVersion: v1 +metadata: + name: local-path-config + namespace: local-path-storage +data: + config.json: |- + { + "nodePathMap":[ + { + "node":"DEFAULT_PATH_FOR_NON_LISTED_NODES", + "paths":["/data"] + } + ] + } + setup: |- + #!/bin/sh + path=$1 + mkdir -m 0777 -p ${path} + teardown: |- + #!/bin/sh + path=$1 + rm -rf ${path} \ No newline at end of file diff --git a/test/e2e/scale_test.go b/test/e2e/scale_test.go index 939a4449c..fd64cdd8b 100644 --- a/test/e2e/scale_test.go +++ b/test/e2e/scale_test.go @@ -33,6 +33,10 @@ func testScaleCluster(t *testing.T) { g.Expect(err).NotTo(HaveOccurred()) f := framework.Global + // A workaround for issue 93 + err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace) + g.Expect(err).NotTo(HaveOccurred()) + defaultCluster := pravega_e2eutil.NewDefaultCluster(namespace) defaultCluster.WithDefaults() pravega, err := pravega_e2eutil.CreateCluster(t, f, ctx, defaultCluster) @@ -81,7 +85,4 @@ func testScaleCluster(t *testing.T) { err = pravega_e2eutil.WaitForClusterToTerminate(t, f, ctx, pravega) g.Expect(err).NotTo(HaveOccurred()) - // A workaround for issue 93 - err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace) - g.Expect(err).NotTo(HaveOccurred()) } diff --git a/test/e2e/upgrade_test.go b/test/e2e/upgrade_test.go index b570fb3d8..558307b3c 100644 --- a/test/e2e/upgrade_test.go +++ b/test/e2e/upgrade_test.go @@ -33,12 +33,15 @@ func testUpgradeCluster(t *testing.T) { namespace, err := ctx.GetNamespace() g.Expect(err).NotTo(HaveOccurred()) f := framework.Global + // A workaround for issue 93 + err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace) + g.Expect(err).NotTo(HaveOccurred()) cluster := pravega_e2eutil.NewDefaultCluster(namespace) cluster.WithDefaults() - initialVersion := "0.6.1" - upgradeVersion := "0.7.0" + initialVersion := "0.7.0" + upgradeVersion := "0.7.1" cluster.Spec.Version = initialVersion cluster.Spec.Pravega.Image = &api.ImageSpec{ Repository: "pravega/pravega", @@ -84,7 +87,4 @@ func testUpgradeCluster(t *testing.T) { err = pravega_e2eutil.WaitForClusterToTerminate(t, f, ctx, pravega) g.Expect(err).NotTo(HaveOccurred()) - // A workaround for issue 93 - err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace) - g.Expect(err).NotTo(HaveOccurred()) } diff --git a/test/e2e/webhook_test.go b/test/e2e/webhook_test.go index a73405b47..fbe9fa113 100644 --- a/test/e2e/webhook_test.go +++ b/test/e2e/webhook_test.go @@ -32,6 +32,10 @@ func testWebhook(t *testing.T) { g.Expect(err).NotTo(HaveOccurred()) f := framework.Global + // A workaround for issue 93 + err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace) + g.Expect(err).NotTo(HaveOccurred()) + //Test webhook with an unsupported Pravega cluster version invalidVersion := pravega_e2eutil.NewClusterWithVersion(namespace, "99.0.0") invalidVersion.WithDefaults() @@ -68,7 +72,4 @@ func testWebhook(t *testing.T) { err = pravega_e2eutil.WaitForClusterToTerminate(t, f, ctx, pravega) g.Expect(err).NotTo(HaveOccurred()) - // A workaround for issue 93 - err = pravega_e2eutil.RestartTier2(t, f, ctx, namespace) - g.Expect(err).NotTo(HaveOccurred()) }