Fix bug that causes us to skip our new e2e tests (#285)

Various e2e test bugfixes. The test runner now compiles fission bundle and cli, installs helm, installs kubectl, and uses helm to install fission, run all scripts under test/tests/, and uninstalls fission.

The change also removes go tip tests -- I think we can get by without them, but we'll add them back if the next go version update brings some surprises.
This commit is contained in:
Soam Vasani
2017-08-15 17:00:27 -07:00
committed by GitHub
parent f79d44156b
commit 00a8430a24
4 changed files with 46 additions and 9 deletions
+2 -2
View File
@@ -4,18 +4,18 @@ language: go
go:
- 1.8
- tip
cache:
directories:
- $HOME/google-cloud-sdk/
- $HOME/k8scli
install:
- go get github.com/Masterminds/glide
- hack/travis-kube-setup.sh
env:
- KUBECONFIG=${HOME}/.kube/config
- KUBECONFIG=${HOME}/.kube/config PATH=$HOME/k8scli:${PATH}
script:
- cd ${TRAVIS_BUILD_DIR}
+22 -4
View File
@@ -7,16 +7,34 @@
set -e
# If we don't have gcloud credentials, bail out of these tests.
if [ -z ${FISSION_CI_SERVICE_ACCOUNT:+} ]
if [ -z "$FISSION_CI_SERVICE_ACCOUNT" ]
then
echo "Skipping tests, no cluster credentials"
exit 0
fi
K8SCLI_DIR=$HOME/k8scli
if [ ! -d $K8SCLI_DIR ]
then
mkdir -p $K8SCLI_DIR
fi
# Get kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
if [ ! -f $K8SCLI_DIR/kubectl ]
then
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
mv kubectl $K8SCLI_DIR/kubectl
fi
# Get helm
if [ ! -f $K8SCLI_DIR/helm ]
then
curl -LO https://storage.googleapis.com/kubernetes-helm/helm-v2.5.1-linux-amd64.tar.gz
tar xzvf helm-*.tar.gz
mv linux-amd64/helm $K8SCLI_DIR/helm
fi
mkdir ${HOME}/.kube
+21 -2
View File
@@ -10,12 +10,29 @@ set -euo pipefail
ROOT=$(dirname $0)/..
helm_setup() {
helm init
}
gcloud_login() {
KEY=${HOME}/gcloud-service-key.json
if [ ! -f $KEY ]
then
echo $FISSION_CI_SERVICE_ACCOUNT | base64 -d - > $KEY
fi
gcloud auth activate-service-account --key-file $KEY
}
build_and_push_fission_bundle() {
image_tag=$1
pushd $ROOT/fission-bundle
./build.sh
docker build -t $image_tag .
gcloud_login
gcloud docker -- push $image_tag
popd
}
@@ -27,7 +44,7 @@ build_fission_cli() {
}
generate_test_id() {
echo $(date|md5|cut -c1-6)
echo $(date|md5sum|cut -c1-6)
}
helm_install_fission() {
@@ -42,13 +59,15 @@ helm_install_fission() {
helmVars=image=$image,imageTag=$imageTag,functionNamespace=$fns,controllerPort=$controllerNodeport,routerPort=$routerNodeport,pullPolicy=alwaysPull
helm_setup
echo "Installing fission"
helm install \
--wait \
--name $id \
--set $helmVars \
--namespace $ns \
../charts/fission-all
$ROOT/charts/fission-all
}
wait_for_service() {
Regular → Executable
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -euo pipefail