Last active
July 27, 2018 13:48
-
-
Save Jamim/be3a54eec4d2e9603598b968e603a339 to your computer and use it in GitHub Desktop.
detect-pipenv-lock-bug.sh
This file contains hidden or 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 | |
ATTEMPTS=20 | |
step () { | |
tput setaf 5; tput bold | |
echo | |
echo "$@" | |
tput sgr 0 | |
} | |
step "Creating a test directory" | |
mkdir pipenv-test || exit 1 | |
cd pipenv-test | |
step "Installing requirements" | |
pipenv --two install pytest-cov pytest-vcr | |
step "Locking dependencies" | |
pipenv lock --verbose | |
step "Adding result files to a git repository" | |
git init | |
git add Pipfile Pipfile.lock | |
git commit -m 'Initial commit' | |
step "Trying to bring out the issue" | |
attempt=0 | |
while [ $attempt -lt ${ATTEMPTS} ] | |
do | |
attempt=$[$attempt + 1] | |
sleep 2 | |
tput setaf 3; tput bold | |
echo "Attempt ${attempt}" | |
tput sgr 0 | |
pipenv lock --verbose | |
echo | |
if [ -n "$(git diff)" ] | |
then | |
git --no-pager diff | |
echo | |
tput setaf 1; tput bold | |
echo "Something was changed on attempt ${attempt}" | |
tput sgr 0 | |
exit 1 | |
fi | |
done | |
step "No issues were found after ${ATTEMPTS} attempts" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment