test: return all tests
This commit is contained in:
parent
59f4043fc5
commit
4efaa656f9
|
|
@ -69,68 +69,68 @@ trap "{ $kubectl delete namespace ${test_ns}; }" EXIT # remove namespace wheneve
|
||||||
|
|
||||||
# TEST CASES----------------------------------------------------------------------------------------------------------
|
# TEST CASES----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
# test_start "happypath - simple rollout of httpbin chart"
|
test_start "happypath - simple rollout of httpbin chart"
|
||||||
|
|
||||||
# info "Diffing ${dir}/happypath.yaml"
|
info "Diffing ${dir}/happypath.yaml"
|
||||||
# bash -c "${helmfile} -f ${dir}/happypath.yaml diff --detailed-exitcode; code="'$?'"; [ "'${code}'" -eq 2 ]" || fail "unexpected exit code returned by helmfile diff"
|
bash -c "${helmfile} -f ${dir}/happypath.yaml diff --detailed-exitcode; code="'$?'"; [ "'${code}'" -eq 2 ]" || fail "unexpected exit code returned by helmfile diff"
|
||||||
|
|
||||||
# info "Diffing ${dir}/happypath.yaml without color"
|
info "Diffing ${dir}/happypath.yaml without color"
|
||||||
# bash -c "${helmfile} -f ${dir}/happypath.yaml --no-color diff --detailed-exitcode; code="'$?'"; [ "'${code}'" -eq 2 ]" || fail "unexpected exit code returned by helmfile diff"
|
bash -c "${helmfile} -f ${dir}/happypath.yaml --no-color diff --detailed-exitcode; code="'$?'"; [ "'${code}'" -eq 2 ]" || fail "unexpected exit code returned by helmfile diff"
|
||||||
|
|
||||||
# info "Diffing ${dir}/happypath.yaml with limited context"
|
info "Diffing ${dir}/happypath.yaml with limited context"
|
||||||
# bash -c "${helmfile} -f ${dir}/happypath.yaml diff --context 3 --detailed-exitcode; code="'$?'"; [ "'${code}'" -eq 2 ]" || fail "unexpected exit code returned by helmfile diff"
|
bash -c "${helmfile} -f ${dir}/happypath.yaml diff --context 3 --detailed-exitcode; code="'$?'"; [ "'${code}'" -eq 2 ]" || fail "unexpected exit code returned by helmfile diff"
|
||||||
|
|
||||||
# info "Templating ${dir}/happypath.yaml"
|
info "Templating ${dir}/happypath.yaml"
|
||||||
# rm -rf ${dir}/tmp
|
rm -rf ${dir}/tmp
|
||||||
# ${helmfile} -f ${dir}/happypath.yaml --debug template --output-dir tmp
|
${helmfile} -f ${dir}/happypath.yaml --debug template --output-dir tmp
|
||||||
# code=$?
|
code=$?
|
||||||
# [ ${code} -eq 0 ] || fail "unexpected exit code returned by helmfile template: ${code}"
|
[ ${code} -eq 0 ] || fail "unexpected exit code returned by helmfile template: ${code}"
|
||||||
# for output in $(ls -d ${dir}/tmp/*); do
|
for output in $(ls -d ${dir}/tmp/*); do
|
||||||
# # e.g. test/integration/tmp/happypath-877c0dd4-helmx/helmx
|
# e.g. test/integration/tmp/happypath-877c0dd4-helmx/helmx
|
||||||
# for release_dir in $(ls -d ${output}/*); do
|
for release_dir in $(ls -d ${output}/*); do
|
||||||
# release_name=$(basename ${release_dir})
|
release_name=$(basename ${release_dir})
|
||||||
# golden_dir=${dir}/templates-golden/v${helm_major_version}/${release_name}
|
golden_dir=${dir}/templates-golden/v${helm_major_version}/${release_name}
|
||||||
# info "Comparing template output ${release_dir}/templates with ${golden_dir}"
|
info "Comparing template output ${release_dir}/templates with ${golden_dir}"
|
||||||
# ./diff-yamls ${golden_dir} ${release_dir}/templates || fail "unexpected diff in template result for ${release_name}"
|
./diff-yamls ${golden_dir} ${release_dir}/templates || fail "unexpected diff in template result for ${release_name}"
|
||||||
# done
|
done
|
||||||
# done
|
done
|
||||||
|
|
||||||
# info "Applying ${dir}/happypath.yaml"
|
info "Applying ${dir}/happypath.yaml"
|
||||||
# bash -c "${helmfile} -f ${dir}/happypath.yaml apply --detailed-exitcode; code="'$?'"; echo Code: "'$code'"; [ "'${code}'" -eq 2 ]" || fail "unexpected exit code returned by helmfile apply"
|
bash -c "${helmfile} -f ${dir}/happypath.yaml apply --detailed-exitcode; code="'$?'"; echo Code: "'$code'"; [ "'${code}'" -eq 2 ]" || fail "unexpected exit code returned by helmfile apply"
|
||||||
|
|
||||||
# info "Syncing ${dir}/happypath.yaml"
|
info "Syncing ${dir}/happypath.yaml"
|
||||||
# ${helmfile} -f ${dir}/happypath.yaml sync
|
${helmfile} -f ${dir}/happypath.yaml sync
|
||||||
# wait_deploy_ready httpbin-httpbin
|
wait_deploy_ready httpbin-httpbin
|
||||||
# retry 5 "curl --fail $(minikube service --url --namespace=${test_ns} httpbin-httpbin)/status/200"
|
retry 5 "curl --fail $(minikube service --url --namespace=${test_ns} httpbin-httpbin)/status/200"
|
||||||
# [ ${retry_result} -eq 0 ] || fail "httpbin failed to return 200 OK"
|
[ ${retry_result} -eq 0 ] || fail "httpbin failed to return 200 OK"
|
||||||
|
|
||||||
# info "Applying ${dir}/happypath.yaml"
|
info "Applying ${dir}/happypath.yaml"
|
||||||
# ${helmfile} -f ${dir}/happypath.yaml apply --detailed-exitcode
|
${helmfile} -f ${dir}/happypath.yaml apply --detailed-exitcode
|
||||||
# code=$?
|
code=$?
|
||||||
# [ ${code} -eq 0 ] || fail "unexpected exit code returned by helmfile apply: want 0, got ${code}"
|
[ ${code} -eq 0 ] || fail "unexpected exit code returned by helmfile apply: want 0, got ${code}"
|
||||||
|
|
||||||
# info "Locking dependencies"
|
info "Locking dependencies"
|
||||||
# ${helmfile} -f ${dir}/happypath.yaml deps
|
${helmfile} -f ${dir}/happypath.yaml deps
|
||||||
# code=$?
|
code=$?
|
||||||
# [ ${code} -eq 0 ] || fail "unexpected exit code returned by helmfile deps: ${code}"
|
[ ${code} -eq 0 ] || fail "unexpected exit code returned by helmfile deps: ${code}"
|
||||||
|
|
||||||
# info "Applying ${dir}/happypath.yaml with locked dependencies"
|
info "Applying ${dir}/happypath.yaml with locked dependencies"
|
||||||
# ${helmfile} -f ${dir}/happypath.yaml apply
|
${helmfile} -f ${dir}/happypath.yaml apply
|
||||||
# code=$?
|
code=$?
|
||||||
# [ ${code} -eq 0 ] || fail "unexpected exit code returned by helmfile apply: ${code}"
|
[ ${code} -eq 0 ] || fail "unexpected exit code returned by helmfile apply: ${code}"
|
||||||
# ${helm} list --namespace=${test_ns} || fail "unable to list releases"
|
${helm} list --namespace=${test_ns} || fail "unable to list releases"
|
||||||
|
|
||||||
# info "Deleting release"
|
info "Deleting release"
|
||||||
# ${helmfile} -f ${dir}/happypath.yaml delete
|
${helmfile} -f ${dir}/happypath.yaml delete
|
||||||
# ${helm} status --namespace=${test_ns} httpbin &> /dev/null && fail "release should not exist anymore after a delete"
|
${helm} status --namespace=${test_ns} httpbin &> /dev/null && fail "release should not exist anymore after a delete"
|
||||||
|
|
||||||
# info "Ensuring \"helmfile delete\" doesn't fail when no releases installed"
|
info "Ensuring \"helmfile delete\" doesn't fail when no releases installed"
|
||||||
# ${helmfile} -f ${dir}/happypath.yaml delete || fail "\"helmfile delete\" shouldn't fail when there are no installed releases"
|
${helmfile} -f ${dir}/happypath.yaml delete || fail "\"helmfile delete\" shouldn't fail when there are no installed releases"
|
||||||
|
|
||||||
# info "Ensuring \"helmfile template\" output does contain only YAML docs"
|
info "Ensuring \"helmfile template\" output does contain only YAML docs"
|
||||||
# (${helmfile} -f ${dir}/happypath.yaml template | kubectl apply -f -) || fail "\"helmfile template | kubectl apply -f -\" shouldn't fail"
|
(${helmfile} -f ${dir}/happypath.yaml template | kubectl apply -f -) || fail "\"helmfile template | kubectl apply -f -\" shouldn't fail"
|
||||||
|
|
||||||
# test_pass "happypath"
|
test_pass "happypath"
|
||||||
|
|
||||||
if [[ helm_major_version -eq 3 ]]; then
|
if [[ helm_major_version -eq 3 ]]; then
|
||||||
export VAULT_ADDR=http://127.0.0.1:8200
|
export VAULT_ADDR=http://127.0.0.1:8200
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue