Merge remote-tracking branch 'master' into feature/envvars
This commit is contained in:
commit
8a4e8392fb
4 changed files with 17 additions and 6 deletions
|
@ -10,5 +10,8 @@ trim_trailing_whitespace = true
|
||||||
[*.py]
|
[*.py]
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.bash]
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
5
test/.editorconfig
Normal file
5
test/.editorconfig
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[Vagrantfile]
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[test]
|
||||||
|
indent_size = 4
|
|
@ -40,7 +40,6 @@ check_prereqs() {
|
||||||
until_success() {
|
until_success() {
|
||||||
local timeout=${TIMEOUT}
|
local timeout=${TIMEOUT}
|
||||||
local attempt=0
|
local attempt=0
|
||||||
local success=0
|
|
||||||
while [ $attempt -lt $MAXRETRY ]; do
|
while [ $attempt -lt $MAXRETRY ]; do
|
||||||
if ($@) >/dev/null 2>&1; then
|
if ($@) >/dev/null 2>&1; then
|
||||||
return 0
|
return 0
|
||||||
|
@ -70,8 +69,8 @@ initialize() {
|
||||||
tests_passed=0
|
tests_passed=0
|
||||||
tests_failed=0
|
tests_failed=0
|
||||||
tests_total="${1}"
|
tests_total="${1}"
|
||||||
local plural="" && [ ${tests_total} -gt 1 ] && plural="s"
|
local plural="" && [ "${tests_total}" -gt 1 ] && plural="s"
|
||||||
printf -- "running %d test%s...\n\n" ${tests_total} $plural
|
printf -- "running %d test%s...\n\n" "${tests_total}" "${plural}"
|
||||||
}
|
}
|
||||||
|
|
||||||
pass() {
|
pass() {
|
||||||
|
@ -88,9 +87,13 @@ fail() {
|
||||||
|
|
||||||
run_test() {
|
run_test() {
|
||||||
tests_run=$((tests_run + 1))
|
tests_run=$((tests_run + 1))
|
||||||
printf '[%d/%d]\n' ${tests_run} ${tests_total}
|
printf '[%d/%d] (%s)\n' "${tests_run}" "${tests_total}" "${1}"
|
||||||
rollback || die "unable to rollback vm." # start with a clean slate
|
rollback || die "unable to rollback vm." # start with a clean slate
|
||||||
vagrant ssh -c "cd /dotbot/test/tests && bash ${1}" 2>/dev/null && pass || fail
|
if vagrant ssh -c "cd /dotbot/test/tests && bash ${1}" 2>/dev/null; then
|
||||||
|
pass
|
||||||
|
else
|
||||||
|
fail
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
report() {
|
report() {
|
||||||
|
|
|
@ -22,7 +22,7 @@ fi
|
||||||
initialize "${#tests[@]}"
|
initialize "${#tests[@]}"
|
||||||
|
|
||||||
for file in "${tests[@]}"; do
|
for file in "${tests[@]}"; do
|
||||||
run_test "$(basename ${file})"
|
run_test "$(basename "${file}")"
|
||||||
done
|
done
|
||||||
|
|
||||||
if report; then
|
if report; then
|
||||||
|
|
Loading…
Reference in a new issue