Counts the number of helm tests in subfolders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Iterates all subdirectors of the current path. | |
for d in */ ; do | |
# Count instances of test annotations in folder. | |
COUNT=`egrep -r "test-success|test-failure" "$d" | wc -l` | |
# Colors! | |
COUNT_COLOR=$([ $COUNT -gt 0 ] && echo "$(tput setaf 2)" || echo "$(tput setaf 1)") | |
BLACK=$(tput setaf 0) | |
# Strip slash from directory name | |
CHART=`echo "$d" | sed -E "s/(.*)\//\1/"` | |
# Output | |
printf "%-30s %s%s test(s)%s\n" $CHART $COUNT_COLOR $COUNT $BLACK | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment