Skip to content

Commit

Permalink
Merge pull request #429 from erikwilson/e2e-testing-fix
Browse files Browse the repository at this point in the history
Fix e2e testing on publish
  • Loading branch information
ibuildthecloud authored May 2, 2019
2 parents 4ec051d + 3f84978 commit 21a9dbe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ steps:
- name: sonobuoy-e2e-tests
image: rancher/dapper:v0.4.1
commands:
- dapper -f Dockerfile.sonobuoy.dapper sonobuoy-e2e-tests
- dapper -f Dockerfile.sonobuoy.dapper
volumes:
- name: docker
path: /var/run/docker.sock
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.sonobuoy.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ RUN curl -sL https://storage.googleapis.com/kubernetes-release/release/$( \
chmod a+x /usr/local/bin/kubectl

ENV DAPPER_RUN_ARGS --privileged --network host
ENV DAPPER_ENV REPO TAG DRONE_TAG IMAGE_NAME
ENV DAPPER_SOURCE /go/src/github.com/rancher/k3s/
ENV DAPPER_OUTPUT ./dist
ENV DAPPER_DOCKER_SOCKET true
ENV HOME ${DAPPER_SOURCE}
WORKDIR ${DAPPER_SOURCE}

ENTRYPOINT ["./scripts/entry.sh"]
CMD ["ci"]
CMD ["sonobuoy-e2e-tests"]
10 changes: 5 additions & 5 deletions scripts/sonobuoy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ get-port() {
}
export -f get-port

K3S_PORT=$(timeout 5s bash -c get-port)
K3S_PORT=$(timeout --foreground 5s bash -c get-port)
OUTPUT=$(pwd)/sonobuoy-output/${K3S_PORT}
mkdir -p ${OUTPUT}

Expand Down Expand Up @@ -84,7 +84,7 @@ wait-for-kubeconfig() {
}
export -f wait-for-kubeconfig

timeout 1m bash -c wait-for-kubeconfig
timeout --foreground 1m bash -c wait-for-kubeconfig

# ---

Expand All @@ -104,7 +104,7 @@ wait-for-nodes() {
}
export -f wait-for-nodes

timeout 1m bash -c wait-for-nodes
timeout --foreground 1m bash -c wait-for-nodes

# ---

Expand All @@ -125,13 +125,13 @@ wait-for-services() {
}
export -f wait-for-services

timeout 1m bash -c wait-for-services
timeout --foreground 1m bash -c wait-for-services

# ---

echo "Starting sonobuoy tests"

timeout 30m sonobuoy run \
timeout --foreground 30m sonobuoy run \
--config scripts/sonobuoy-config.json \
--wait \
${@}
Expand Down
13 changes: 7 additions & 6 deletions scripts/sonobuoy-e2e-tests
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash
set -e -x

source $(dirname $0)/version.sh

cd $(dirname $0)/..

TAG=${TAG:-${VERSION}${SUFFIX}}
REPO=${REPO:-rancher}
IMAGE_NAME=${IMAGE_NAME:-k3s}
export K3S_IMAGE=${REPO}/${IMAGE_NAME}:${TAG}
if [ -z "$K3S_IMAGE" ]; then
source $(dirname $0)/version.sh
TAG=${TAG:-${VERSION}${SUFFIX}}
REPO=${REPO:-rancher}
IMAGE_NAME=${IMAGE_NAME:-k3s}
export K3S_IMAGE=${REPO}/${IMAGE_NAME}:${TAG}
fi

OUTPUT=$(pwd)/dist/artifacts
mkdir -p ${OUTPUT}
Expand Down

0 comments on commit 21a9dbe

Please sign in to comment.