-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor e2e tests to use the service ClusterIP
- Loading branch information
Showing
80 changed files
with
777 additions
and
706 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2019 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. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
ginkgo build ./test/e2e |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
e2e.test | ||
ginkgo | ||
kubectl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM quay.io/kubernetes-ingress-controller/debian-base-amd64:0.1 | ||
|
||
RUN clean-install \ | ||
ca-certificates \ | ||
bash \ | ||
tzdata | ||
|
||
COPY ginkgo /usr/local/bin/ | ||
COPY kubectl /usr/local/bin/ | ||
COPY e2e.sh /e2e.sh | ||
|
||
COPY manifests /manifests | ||
|
||
COPY wait-for-nginx.sh / | ||
COPY e2e.test / | ||
|
||
CMD [ "/e2e.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
IMAGE=nginx-ingress-controller:e2e | ||
KUBE_VERSION ?= 1.13.3 | ||
|
||
.PHONY: all container getbins clean | ||
|
||
all: container | ||
|
||
container: | ||
./kubectl > /dev/null 2>&1 || curl -Lo ./kubectl \ | ||
https://storage.googleapis.com/kubernetes-release/release/v$(KUBE_VERSION)/bin/linux/amd64/kubectl \ | ||
&& chmod +x ./kubectl | ||
|
||
$(GOPATH)/bin/ginkgo > /dev/null 2>&1 || go get github.com/onsi/ginkgo/ginkgo | ||
cp $(GOPATH)/bin/ginkgo . | ||
|
||
cp ../e2e/e2e.test . | ||
cp ../e2e/wait-for-nginx.sh . | ||
|
||
docker build -t $(IMAGE) . | ||
|
||
clean: | ||
rm -rf _cache e2e.test kubectl cluster ginkgo | ||
docker rmi -f $(IMAGE) || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2019 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. | ||
|
||
set -e | ||
|
||
SLOW_E2E_THRESHOLD=${SLOW_E2E_THRESHOLD:-50} | ||
FOCUS=${FOCUS:-.*} | ||
E2E_NODES=${E2E_NODES:-5} | ||
|
||
if [ ! -f ${HOME}/.kube/config ]; then | ||
kubectl config set-cluster dev --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt --embed-certs=true --server="https://kubernetes.default/" | ||
kubectl config set-credentials user --token="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" | ||
kubectl config set-context default --cluster=dev --user=user | ||
kubectl config use-context default | ||
fi | ||
|
||
echo "Granting permissions to ingress-nginx e2e service account..." | ||
kubectl create serviceaccount ingress-nginx-e2e || true | ||
kubectl create clusterrolebinding permissive-binding \ | ||
--clusterrole=cluster-admin \ | ||
--user=admin \ | ||
--user=kubelet \ | ||
--serviceaccount=default:ingress-nginx-e2e || true | ||
|
||
kubectl apply -f manifests/rbac.yaml | ||
|
||
ginkgo_args=( | ||
"-randomizeSuites" | ||
"-randomizeAllSpecs" | ||
"-flakeAttempts=2" | ||
"-p" | ||
"-trace" | ||
"--noColor=true" | ||
"-slowSpecThreshold=${SLOW_E2E_THRESHOLD}" | ||
) | ||
|
||
echo "Running e2e test suite..." | ||
ginkgo "${ginkgo_args[@]}" \ | ||
-focus=${FOCUS} \ | ||
-skip="\[Serial\]" \ | ||
-nodes=${E2E_NODES} \ | ||
/e2e.test | ||
|
||
echo "Running e2e test suite with tests that require serial execution..." | ||
ginkgo "${ginkgo_args[@]}" \ | ||
-focus="\[Serial\]" \ | ||
-nodes=1 \ | ||
/e2e.test |
Oops, something went wrong.