-
Notifications
You must be signed in to change notification settings - Fork 220
Revamp the integration tests #51
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| REPO="${REPO:-}" | ||
| MANIFESTS="${MANIFESTS:-}" | ||
|
|
||
| if [ -z "$REPO" ]; then echo "REPO is required"; exit 1; fi | ||
| if [ -z "$MANIFESTS" ]; then echo "MANIFESTS is required"; exit 1; fi | ||
|
|
||
| TEMP_COMMIT="false" | ||
| test -z "$(git status --porcelain)" || TEMP_COMMIT="true" | ||
|
|
||
| if [[ "${TEMP_COMMIT}" == "true" ]]; then | ||
| git add . | ||
| git commit -m "Temporary" || true | ||
| fi | ||
|
|
||
| REV=$(git rev-parse --short HEAD) | ||
| docker build -t $REPO:$REV -f images/cluster-ingress-operator/Dockerfile . | ||
| docker push $REPO:$REV | ||
|
|
||
| if [[ "${TEMP_COMMIT}" == "true" ]]; then | ||
| git reset --soft HEAD~1 | ||
| fi | ||
|
|
||
| cp -R manifests/ $MANIFESTS | ||
| cat manifests/02-deployment.yaml | sed "s~openshift/origin-cluster-ingress-operator:latest~$REPO:$REV~" > "$MANIFESTS/02-deployment.yaml" | ||
|
|
||
| echo "Pushed $REPO:$REV" | ||
| echo "Install manifests using:" | ||
| echo "" | ||
| echo "oc apply -f $MANIFESTS" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| CLUSTER_NAME="${CLUSTER_NAME:-}" | ||
|
|
||
| if [ -z "${CLUSTER_NAME}" ]; then echo "CLUSTER_NAME is required"; exit 1; fi | ||
| if [ -z "${KUBECONFIG:-}" ]; then echo "KUBECONFIG is required"; exit 1; fi | ||
|
|
||
| # Required for the operator-sdk. | ||
| export KUBERNETES_CONFIG="${KUBECONFIG}" | ||
|
|
||
| go test -v -tags integration ./test/integration --cluster-name "${CLUSTER_NAME}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/bin/bash | ||
| set -uo pipefail | ||
|
|
||
| # Disable the CVO | ||
| oc patch -n openshift-cluster-version daemonsets/cluster-version-operator --patch '{"spec": {"template": {"spec": {"nodeSelector": {"node-role.kubernetes.io/fake": ""}}}}}' | ||
|
|
||
| # Uninstall tectonic ingress | ||
| oc delete namespaces/openshift-ingress | ||
|
|
||
| # Uninstall the cluster-ingress-operator | ||
| oc delete --force --grace-period 0 -n openshift-cluster-ingress-operator clusteringresses/default | ||
| oc delete namespaces/openshift-cluster-ingress-operator | ||
| oc delete namespaces/openshift-cluster-ingress-router | ||
| oc delete clusterroles/cluster-ingress-operator:operator | ||
| oc delete clusterroles/cluster-ingress:router | ||
| oc delete clusterrolebindings/cluster-ingress-operator:operator | ||
| oc delete clusterrolebindings/cluster-ingress:router | ||
| oc delete customresourcedefinition.apiextensions.k8s.io/clusteringresses.ingress.openshift.io |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,5 @@ kind: Namespace | |
| apiVersion: v1 | ||
| metadata: | ||
| name: cluster-ingress-test | ||
| labels: | ||
| openshift.io/cluster-ingress-operator-test: "" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reserved for future use: should make it easier to identify test namespaces for cleanup. |
||
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing
-Rfor recursion.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think -f does the recursion.