Skip to content

Commit

Permalink
Increase CI verbosity
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 committed Oct 31, 2020
1 parent d019685 commit dd9c9d1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
10 changes: 10 additions & 0 deletions test/base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

export TERM=screen-256color

bold=$(tput bold)
normal=$(tput sgr0)

log() {
echo ${bold}$(date "+%d-%m-%YT%H:%M:%S") ${@}${normal}
}
17 changes: 11 additions & 6 deletions test/run.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
#!/bin/bash -e

source base.sh

set -e
rc=0
uuid=$(uuidgen)

check_ns() {
log "Checking the number of namespaces labeled with ${1} is ${2}"
if [[ $(kubectl get ns -l ${1} -o name | wc -l) != ${2} ]]; then
echo "Number of namespaces labeled with ${1} less than expected"
log "Number of namespaces labeled with ${1} less than expected"
rc=1
fi
}

check_destroyed_ns() {
log "Checking namespace ${1} has been destroyed"
if [[ $(kubectl get ns -l ${1} -o name | wc -l) != 0 ]]; then
echo "Namespaces labeled with ${1} not destroyed"
log "Namespaces labeled with ${1} not destroyed"
rc=1
fi
}
Expand All @@ -27,28 +31,29 @@ check_running_pods() {
running_pods=$((running_pods + pods))
done
if [[ ${running_pods} != ${2} ]]; then
echo "Running pods in namespaces labeled with ${1} different from expected"
log "Running pods in namespaces labeled with ${1} different from expected"
rc=1
fi
}

check_files () {
for f in collected-metrics/prometheusRSS.json collected-metrics/namespaced-podLatency.json collected-metrics/namespaced-podLatency-summary.json; do
log "Checking file ${f}"
if [[ ! -f $f ]]; then
echo "File ${f} not present"
log "File ${f} not present"
rc=1
fi
done
}

log "Running kube-burner init"
kube-burner init -c kube-burner.yml --uuid ${uuid} --log-level=debug -u http://localhost:9090 -m metrics-profile.yaml
check_files
check_ns kube-burner-job=not-namespaced,kube-burner-uuid=${uuid} 1
check_ns kube-burner-job=namespaced,kube-burner-uuid=${uuid} 5
check_running_pods kube-burner-job=namespaced,kube-burner-uuid=${uuid} 5
log "Running kube-burner destroy"
kube-burner destroy --uuid ${uuid}
check_destroyed_ns kube-burner-job=not-namespaced,kube-burner-uuid=${uuid}
check_destroyed_ns kube-burner-job=namespaced,kube-burner-uuid=${uuid}
exit ${rc}


0 comments on commit dd9c9d1

Please sign in to comment.