Skip to content

Commit

Permalink
fix(e2e): make e2e-local-docker work again
Browse files Browse the repository at this point in the history
  • Loading branch information
ecordell committed Jan 18, 2019
1 parent e8f5b41 commit a6eafeb
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -78,7 +78,7 @@ setup-bare: clean e2e.namespace
. ./scripts/install_bare.sh $(shell cat ./e2e.namespace) test/e2e/resources

e2e:
go test -v -timeout 50m ./test/e2e/... -namespace=openshift-operators -kubeconfig=${KUBECONFIG} -olmNamespace=openshift-operator-lifecycle-manager
go test -v -failfast -timeout 50m ./test/e2e/... -namespace=openshift-operators -kubeconfig=${KUBECONFIG} -olmNamespace=openshift-operator-lifecycle-manager

e2e-local:
. ./scripts/build_local.sh
Expand Down
11 changes: 0 additions & 11 deletions e2e.Dockerfile
Expand Up @@ -14,7 +14,6 @@ COPY vendor vendor
COPY cmd cmd
COPY test test
RUN make build-coverage
RUN go test -c -o /bin/e2e ./test/e2e/...

FROM alpine:latest as olm
LABEL stage=olm
Expand All @@ -25,13 +24,3 @@ COPY --from=builder /go/src/github.com/operator-framework/operator-lifecycle-man
EXPOSE 8080
EXPOSE 5443
CMD ["/bin/olm"]

FROM alpine:latest
LABEL stage=e2e
RUN mkdir -p /var/e2e
WORKDIR /var/e2e
COPY --from=builder /bin/e2e /bin/e2e
COPY --from=builder /bin/jq /bin/jq
COPY ./test/e2e/e2e.sh /var/e2e/e2e.sh
COPY ./test/e2e/tap.jq /var/e2e/tap.jq
CMD ["/bin/e2e"]
2 changes: 1 addition & 1 deletion scripts/build_local.sh
Expand Up @@ -12,4 +12,4 @@ if [ -z "$NO_MINIKUBE" ]; then
fi
docker build -f e2e.Dockerfile .
docker tag $(docker images --filter 'label=stage=olm' --format '{{.CreatedAt}}\t{{.ID}}' | sort -nr | head -n 1 | cut -f2) quay.io/coreos/olm:local
docker tag $(docker images --filter 'label=stage=e2e' --format '{{.CreatedAt}}\t{{.ID}}' | sort -nr | head -n 1 | cut -f2) quay.io/coreos/olm-e2e:local
docker tag $(docker images --filter 'label=stage=builder' --format '{{.CreatedAt}}\t{{.ID}}' | sort -nr | head -n 1 | cut -f2) quay.io/coreos/olm-e2e:local
2 changes: 1 addition & 1 deletion scripts/run_e2e_docker.sh
Expand Up @@ -49,7 +49,7 @@ mkdir -p test/e2e/test-resources
helm template --set namespace="${namespace}" -f test/e2e/e2e-values.yaml test/e2e/chart --output-dir test/e2e/test-resources

eval "$(minikube docker-env)" || { echo 'Cannot switch to minikube docker'; exit 1; }
kubectl apply -f test/e2e/test-resources/alm-e2e/templates
kubectl apply -f test/e2e/test-resources/olm-e2e/templates
until kubectl -n "${namespace}" logs job/e2e | grep -v "ContainerCreating"; do echo "waiting for job to run" && sleep 1; done
kubectl -n "${namespace}" logs job/e2e -f

Expand Down
2 changes: 1 addition & 1 deletion scripts/run_e2e_local.sh
Expand Up @@ -55,4 +55,4 @@ else
fi

echo "${test_flags}"
go test -mod=vendor -tags=local -covermode=count -coverpkg ./pkg/controller/... -test.v -test.timeout 20m ${test_flags} ./test/e2e/... -kubeconfig=${KUBECONFIG:-~/.kube/config} -namespace=${namespace}-operator -olmNamespace=${namespace}
go test -mod=vendor -failfast -tags=local -covermode=count -coverpkg ./pkg/controller/... -test.v -test.timeout 20m ${test_flags} ./test/e2e/... -kubeconfig=${KUBECONFIG:-~/.kube/config} -namespace=${namespace}-operator -olmNamespace=${namespace}
2 changes: 1 addition & 1 deletion test/e2e/chart/templates/job.yaml
Expand Up @@ -9,7 +9,7 @@ spec:
containers:
- name: e2e
image: {{ .Values.e2e.image.ref }}
command: ["/var/e2e/e2e.sh"]
command: ["go", "test", "-v", "-failfast", "-timeout", "50m", "./test/e2e/...", "-namespace=$(NAMESPACE)-operator", "-olmNamespace=$(NAMESPACE)"]
env:
- name: NAMESPACE
valueFrom:
Expand Down
35 changes: 0 additions & 35 deletions test/e2e/e2e-values-shift.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions test/e2e/e2e-values.yaml
@@ -1,5 +1,3 @@
rbacApiVersion: rbac.authorization.k8s.io

olm:
replicaCount: 1
image:
Expand Down

0 comments on commit a6eafeb

Please sign in to comment.