Last active
May 31, 2016 21:37
-
-
Save lencioni/15268e67a4b9a08f6cb1921f1169e06e to your computer and use it in GitHub Desktop.
Count the number of JavaScript tests in a git repo every day
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 | |
echo '"days ago","tests"' > testCounts.csv | |
for i in $(seq 1 365); | |
do | |
git checkout "$(git rev-list -n 1 --before="$i days ago" origin/master)" | |
matches=$(\ | |
find spec/javascripts -name "*.js" -o -name "*.jsx" | \ | |
xargs ag --stats "it\(" | \ | |
ag "^\d+\ matches" | \ | |
cut -d " " -f1 \ | |
) | |
echo "$i,$matches" >> testCounts.csv | |
done | |
git checkout master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment