Created
October 11, 2018 08:32
-
-
Save dawidnawrot/6fe27c7279ed4f0438230e0c8d8e1add to your computer and use it in GitHub Desktop.
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
# test name: "User gets auto generated id | Tags: (tag-sol3-000;tag-user)" | |
# branch name: "sol3-000-branch-description(tag-sol3-000;tag-user)" | |
# Get branch name. | |
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
# Extract tags. | |
tags=$(echo "$branch" | sed -e "s/[^(]*//" | sed -e "s/[)(]//g") | |
# If no tags attached then exit. | |
if [ ${#tags} -eq 0 ]; then | |
echo "No testing tags attached to branch name." | |
exit 2 | |
fi | |
# Tags array to pass to ava. | |
tags_array="$(echo "${tags}" | tr ';' "\n")" | |
while read -r line; do | |
match=$match"--match ""*$line*"" " | |
done <<< "$tags_array" | |
# Exec tagged tests. | |
exec < /dev/tty | |
if ! lando yarn ava $match --verbose ; then | |
echo "Commit not added" | |
exit 2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think it would be better in the pre-push, commit is not mean't to be the final version of what you push and some tests won't pass it.