run_ci_tests.sh 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. set -e
  2. if [ -n "$REPO" -a -n "$BRANCH" ]; then
  3. git remote rm proposed || true
  4. git gc --auto
  5. git remote add proposed "$REPO"
  6. git fetch proposed
  7. git checkout origin/master
  8. git config --global user.email "you@example.com"
  9. git config --global user.name "Your Name"
  10. git merge --no-ff "proposed/$BRANCH" -m "Merge PR"
  11. echo "Running tests for branch $BRANCH of repo $REPO"
  12. echo "Last commits:"
  13. git log -2
  14. fi
  15. DATE=`date +%Y%m%d`
  16. HASH=`sha1sum requirements.txt | awk '{print $1}'`
  17. if [ ! -d pagureenv-$DATE-$HASH ];
  18. then
  19. rm -rf pagureenv*;
  20. virtualenv pagureenv-$DATE-$HASH --system-site-packages
  21. source pagureenv-$DATE-$HASH/bin/activate
  22. pip install pip --upgrade
  23. # Needed within the venv
  24. pip install nose --upgrade
  25. pip install --upgrade --force-reinstall python-fedora 'setuptools>=17.1' pygments
  26. pip install -r tests_requirements.txt
  27. pip install -r requirements-ev.txt # We have one test on the SSE server
  28. sed -i -e 's|pygit2 >= 0.20.1||' requirements.txt
  29. pip install -r requirements.txt
  30. pip install psycopg2
  31. pip install python-openid python-openid-teams python-openid-cla
  32. pip uninstall cffi -y
  33. else
  34. source pagureenv-$DATE-$HASH/bin/activate
  35. fi
  36. trap deactivate SIGINT SIGTERM EXIT
  37. # Reload where the nosetests app is (within the venv)
  38. hash -r
  39. python setup.py build
  40. PAGURE_CONFIG=`pwd`/tests/test_config \
  41. PYTHONPATH=pagure \
  42. ./nosetests -v --with-xcoverage --cover-erase --cover-package=pagure
  43. set +e
  44. PYTHONPATH=pagure pylint -f parseable pagure | tee pylint.out
  45. pep8 pagure/*.py pagure/*/*.py | tee pep8.out