Last active
July 25, 2017 20:39
-
-
Save Makman2/76eb543293d4571852ab to your computer and use it in GitHub Desktop.
Allows to invoke a test-step for each commit made.
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 | |
set -e | |
# The test invocation. | |
function test_step { | |
echo "Updating setup.cfg..." | |
sed -i -e "s/ --cov//g" setup.cfg | |
py.test -k core | |
git reset --hard | |
} | |
# ------------------------------------------------- | |
branch_name=$(git symbolic-ref -q HEAD) | |
branch_name=${branch_name##refs/heads/} | |
branch_name=${branch_name:-HEAD} | |
commits=$(git log --pretty=format:"%h" master..HEAD) | |
echo "Commits being tested:" | |
git log --oneline master..HEAD | |
echo "$commits" | while read -r commit | |
do | |
git checkout $commit | |
test_step | |
done | |
git checkout $branch_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment