Skip to content

Commit

Permalink
make e2e tests work with forks and get kind from releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Suderman committed May 1, 2019
1 parent cb0b4fa commit 19d734c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
25 changes: 5 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,6 @@ references:
apk --update add bash jq
jobs:
# Because kind doesn't publish a proper binary, and we
# can't really install golang in alpine without pain,
# we build the kind binary from source and cache it.
build-kind:
docker:
- image: golang:1.12-stretch
steps:
- run:
name: Get and Build Kind
command: |
mkdir /binaries
go get sigs.k8s.io/kind
cp /go/bin/kind /binaries/kind
- save_cache:
key: v3-binaries
paths:
- /binaries
lint-scripts:
docker:
- image: koalaman/shellcheck-alpine:v0.6.0
Expand Down Expand Up @@ -69,10 +52,14 @@ jobs:
name: Setup e2e Environment
command: |
cp /binaries/kind /usr/local/bin/kind
curl -LO https://github.com/kubernetes-sigs/kind/releases/download/0.2.1/kind-darwin-amd64
chmod +x kind-darwin-amd64
mv kind-darwin-amd64 /usr/local/bin
scripts/e2e-test.sh setup
- run:
name: Run e2e tests
command: scripts/e2e-test.sh test "$CIRCLE_BRANCH"
command: |
scripts/e2e-test.sh test "$CIRCLE_BRANCH"
- run:
name: Teardown e2e Environment
command: scripts/e2e-test.sh teardown
Expand All @@ -91,14 +78,12 @@ workflows:
jobs:
- lint-scripts
- lint-charts
- build-kind
- e2e-tests:
filters:
branches:
ignore:
- master
requires:
- build-kind
- lint-scripts
- lint-charts
- sync:
Expand Down
2 changes: 1 addition & 1 deletion incubator/capsize/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: v1
appVersion: "1.0"
description: A Helm chart to restart deployments at an interval
name: capsize
version: 0.1.0
version: 0.1.1
maintainers:
- name: sudermanjr
9 changes: 7 additions & 2 deletions scripts/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CI_REF="${2:-master}"
TEST_CLUSTER_NAME="${3:-helm-e2e}"
TILLER_NAMESPACE="${TILLER_NAMESPACE:-helm-system}"
EXEC_CONTAINER_NAME="${4:-executor}"
CHART_TEST_VERSION="v3.2.0"
CHART_TEST_VERSION="v3.3.2"

setup_cluster () {
printf "Creating cluster %s. This could take a minute...\n" "$TEST_CLUSTER_NAME"
Expand Down Expand Up @@ -88,9 +88,14 @@ prep_tests () {
fi

docker exec "$EXEC_CONTAINER_NAME" sh -c 'helm version'

docker exec "$EXEC_CONTAINER_NAME" sh -c 'git clone https://github.com/reactiveops/charts && cd charts && git remote add ro https://github.com/reactiveops/charts &> /dev/null || true'
docker exec "$EXEC_CONTAINER_NAME" sh -c 'cd charts && git fetch ro master'
docker exec "$EXEC_CONTAINER_NAME" sh -c "cd charts && git checkout $CI_REF"
if [ -z "${CIRCLE_PR_NUMBER:-}" ]; then
docker exec "$EXEC_CONTAINER_NAME" sh -c "cd charts && git checkout $CI_REF"
else
docker exec "$EXEC_CONTAINER_NAME" sh -c "cd charts && git fetch origin pull/$CIRCLE_PR_NUMBER/head:pr/$CIRCLE_PR_NUMBER && git checkout pr/$CIRCLE_PR_NUMBER"
fi
}

prep_tests_local () {
Expand Down

0 comments on commit 19d734c

Please sign in to comment.