test: Make test status more clear

This commit is contained in:
James Shubin
2017-02-21 18:38:03 -05:00
parent 02dddfc227
commit 74dfb9d88d
10 changed files with 19 additions and 8 deletions

View File

@@ -29,3 +29,4 @@ bad_files=$(
if [[ -n "${bad_files}" ]]; then
fail_test "The following bash files are not properly formatted: ${bad_files}"
fi
echo 'PASS'

View File

@@ -1,5 +1,7 @@
#!/bin/bash -e
echo running test-commit-message.sh
travis_regex='^\([a-z0-9]\(\(, \)\|[a-z0-9]\)\+[a-z0-9]: \)\+[A-Z0-9][^:]\+[^:.]$'
# Testing the regex itself.
@@ -45,7 +47,7 @@ travis_regex='^\([a-z0-9]\(\(, \)\|[a-z0-9]\)\+[a-z0-9]: \)\+[A-Z0-9][^:]\+[^:.]
[[ $(echo "nope a: bar, foo: barfoofoo: Nope" | grep -c "$travis_regex") -eq 0 ]]
test_commit_message() {
echo Testing commit message $1
echo "Testing commit message $1"
if ! git log --format=%s $1 | head -n 1 | grep -q "$travis_regex"
then
echo "FAIL: Commit message should match the following regex: '$travis_regex'"
@@ -67,3 +69,4 @@ then
test_commit_message $commit
done
fi
echo 'PASS'

View File

@@ -27,3 +27,4 @@ bad_files=$(find_files | xargs $GOFMT -l)
if [[ -n "${bad_files}" ]]; then
fail_test "The following golang files are not properly formatted: ${bad_files}"
fi
echo 'PASS'

View File

@@ -67,4 +67,4 @@ if [ "$DELTA" -gt "$THRESHOLD" ]; then
echo "Maximum threshold is: $THRESHOLD %"
fail_test "`golint` - FAILED"
fi
echo PASS
echo 'PASS'

View File

@@ -28,3 +28,4 @@ bad_files=$(
if [[ -n "${bad_files}" ]]; then
fail_test "The following file headers are not properly formatted: ${bad_files}"
fi
echo 'PASS'

View File

@@ -18,4 +18,8 @@ done
# return to original dir
cd "$CWD" >/dev/null
exit $RET
if [ ! $RET -eq 0 ]; then
echo 'FAIL'
exit $RET
fi
echo 'PASS'

View File

@@ -36,4 +36,4 @@ if [[ -n "${failures}" ]]; then
echo "${failures}"
exit 1
fi
echo PASS
echo 'PASS'

View File

@@ -78,4 +78,4 @@ if [[ -n "${failures}" ]]; then
echo "${failures}"
exit 1
fi
echo PASS
echo 'PASS'

View File

@@ -1,6 +1,8 @@
#!/bin/bash
# check for any yaml files that aren't properly formatted
exit 0 # i give up, we're skipping this entirely, help wanted to fix this
. test/util.sh
echo running test-yamlfmt.sh
@@ -8,8 +10,6 @@ set -o errexit
set -o nounset
set -o pipefail
exit 0 # i give up, we're skipping this entirely, help wanted to fix this
#if env | grep -q -e '^TRAVIS=true$' -e '^JENKINS_URL=' -e '^BUILD_TAG=jenkins'; then
# echo "Travis and Jenkins give wonky results here, skipping test!"
# exit 0
@@ -63,3 +63,4 @@ bad_files=$(
if [[ -n "${bad_files}" ]]; then
fail_test "The following yaml files are not properly formatted: ${bad_files}"
fi
echo 'PASS'