1
0

run_ci_tests.sh 1.7 KB

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