Last active
November 26, 2022 20:20
-
-
Save apeckham/bc49e0516c0b9c50158f538d999ccb4d to your computer and use it in GitHub Desktop.
list files that tests don't require, one file at a time
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/env bash | |
set -uf -o pipefail | |
if [ -n "$(git status --porcelain)" ]; then | |
echo "git status is not clean" | |
exit 1 | |
fi | |
if [ $# -eq 0 ]; then | |
echo "usage: $0 command" | |
exit 1 | |
fi | |
echo "checking command ..." | |
if ! time eval "$*"; then | |
echo "command failed with no file changes" | |
exit 1 | |
fi | |
for file in $(git ls-files | shuf | grep -Ev '^test/|^\.git'); do | |
echo "$file ..." | |
rm "$file" | |
if eval "$*"; then | |
echo "*** $file wasn't necessary" | |
fi | |
git checkout "$file" --quiet | |
done |
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
../deadfiles.sh docker-compose exec -T app lein with-profile +app bat-test | tee ../dead.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment