Skip to content

Commit

Permalink
Modify CircleCI config to fix the tests (#82)
Browse files Browse the repository at this point in the history
* bump versions to attempt fix

* enable security context

* revert values, bump minikube, add debugging

* increase circle timeout to prevent pre-emptive killing

* bump timeout again

* bump smoke test timeout

* decrease timeout, add addtional logging

* add get jobs, revert timeouts

* add --debug flag and helm -ls when helm fails

* fix command typos

* add namespace and downgrade k8s

* bump k8s to 1.21

* fix kubectl link

* change to NodePort

* comment out extra commands for testing

* try localhost as IP

* print tunnel logs

* revert change to finding IP address

* add -E flag to sudo minikube tunnel

* switch back to LoadBalancer

* remove redundant LoadBalancer from minikube.yaml
  • Loading branch information
ctffarley authored Aug 18, 2022
1 parent 4017033 commit 7c4431a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ version: 2
jobs:
build:
machine:
image: ubuntu-1604:202004-01
image: ubuntu-2004:202201-02

environment:
K8S_VERSION: v1.18.2
K8S_VERSION: 1.21.14
KUBECONFIG: /home/circleci/.kube/config
MINIKUBE_VERSION: v1.9.2
MINIKUBE_VERSION: v1.26.1
MINIKUBE_WANTUPDATENOTIFICATION: false
MINIKUBE_WANTREPORTERRORPROMPT: false
MINIKUBE_HOME: /home/circleci
Expand All @@ -18,7 +18,7 @@ jobs:
- run:
name: Setup Helm
command: |
curl -Lo helm.tar.gz https://get.helm.sh/helm-v3.0.0-linux-amd64.tar.gz
curl -Lo helm.tar.gz https://get.helm.sh/helm-v3.8.2-linux-amd64.tar.gz
tar zxf helm.tar.gz
chmod +x linux-amd64/helm
sudo mv linux-amd64/helm /usr/local/bin/
Expand All @@ -34,7 +34,7 @@ jobs:
- run:
name: Setup kubectl
command: |
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl
curl -Lo kubectl https://dl.k8s.io/v${K8S_VERSION}/bin/linux/amd64/kubectl
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
mkdir -p ${HOME}/.kube
Expand All @@ -55,6 +55,6 @@ jobs:
echo ${STARDOG_LICENSE} | base64 --decode > ${HOME}/stardog-license-key.bin
- run:
name: Helm smoke tests
no_output_timeout: 15m
no_output_timeout: 16m
command: |
./tests/smoke.sh
19 changes: 17 additions & 2 deletions tests/smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function dependency_checks() {
function minikube_start_tunnel() {
pushd ~
echo "Starting minikube tunnel"
echo "sudo minikube tunnel" > ~/start-minikube-tunnel.sh
echo "sudo -E minikube tunnel" > ~/start-minikube-tunnel.sh
chmod u+x ~/start-minikube-tunnel.sh
nohup ~/start-minikube-tunnel.sh > ~/minikube_tunnel.log 2> ~/minikube_tunnel.err < /dev/null &
echo "Minikube tunnel started in the background"
Expand Down Expand Up @@ -60,7 +60,8 @@ function helm_install_stardog_cluster_with_zookeeper() {
--timeout 15m0s \
-f ./tests/minikube.yaml \
--set "replicaCount=${NUM_STARDOGS}" \
--set "zookeeper.replicaCount=${NUM_ZKS}"
--set "zookeeper.replicaCount=${NUM_ZKS}" \
--debug
rc=$?

if [ ${rc} -ne 0 ]; then
Expand All @@ -69,6 +70,16 @@ function helm_install_stardog_cluster_with_zookeeper() {
kubectl -n ${NAMESPACE} get pods
echo "Listing services"
kubectl -n ${NAMESPACE} get svc
echo "Logs:"
kubectl logs -n ${NAMESPACE} stardog-helm-tests-stardog-0
echo "Previous logs:"
kubectl logs -n ${NAMESPACE} stardog-helm-tests-stardog-0 --previous
echo "Describe pod:"
kubectl describe pod stardog-helm-tests-stardog-0 -n ${NAMESPACE}
echo "Get jobs:"
kubectl get jobs -n ${NAMESPACE}
echo "helm list --all:"
helm list --all -n ${NAMESPACE}
exit ${rc}
fi

Expand Down Expand Up @@ -166,6 +177,10 @@ function create_and_drop_db() {
rc=$?
if [ ${rc} -ne 0 ]; then
echo "Failed to create Stardog db on ${STARDOG_IP}, exiting"
echo "Tunnel logs:"
cat ~/minikube_tunnel.log
echo "Tunnel error logs:"
cat ~/minikube_tunnel.err
exit ${rc}
fi
echo "Successfully created database."
Expand Down

0 comments on commit 7c4431a

Please sign in to comment.