From 78132334379d3450e4870b01179265815e3413b5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 02 2017 20:10:32 +0000 Subject: [PATCH 1/3] Bring pagure's CI script into the sources This will make it easier to replicate what is running on jenkins locally --- diff --git a/run_ci_tests.sh b/run_ci_tests.sh new file mode 100644 index 0000000..8bdc45d --- /dev/null +++ b/run_ci_tests.sh @@ -0,0 +1,49 @@ +if [ -n "$REPO" -a -n "$BRANCH" ]; then +git remote rm proposed || true +git gc --auto +git remote add proposed "$REPO" +git fetch proposed +git checkout origin/master +git config --global user.email "you@example.com" +git config --global user.name "Your Name" +git merge --no-ff "proposed/$BRANCH" -m "Merge PR" +fi + + +DATE=`date +%Y%m%d` +HASH=`sha1sum requirements.txt | awk '{print $1}'` + +if [ ! -d pagureenv-$DATE-$HASH ]; +then + rm -rf pagureenv*; + virtualenv pagureenv-$DATE-$HASH --system-site-packages + source pagureenv-$DATE-$HASH/bin/activate + + pip install pip --upgrade + # Needed within the venv + pip install nose --upgrade + pip install --upgrade --force-reinstall python-fedora 'setuptools>=17.1' pygments + pip install -r tests_requirements.txt + sed -i -e 's|pygit2 >= 0.20.1||' requirements.txt + pip install -r requirements.txt + pip install psycopg2 + pip install python-openid python-openid-teams python-openid-cla + + pip uninstall cffi -y +else + source pagureenv-$DATE-$HASH/bin/activate +fi + + +# Reload where the nosetests app is (within the venv) +hash -r + +python setup.py build + +PYTHONPATH=pagure ./nosetests -v --with-xcoverage --cover-erase --cover-package=pagure + + +PYTHONPATH=pagure pylint -f parseable pagure | tee pylint.out +pep8 pagure/*.py pagure/*/*.py | tee pep8.out + +deactivate From e74c51deb65d42cd478abe93a33a7b865c268b04 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 02 2017 20:10:32 +0000 Subject: [PATCH 2/3] Update the .gitignore file to ignore files generated when ran on jenkins --- diff --git a/.gitignore b/.gitignore index 9c73ef3..4934a79 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,12 @@ build/ *.conf .coverage +# Ignore files generated by run_ci_tests +pep8.out +pylint.out +coverage.xml +pagureenv-* + _build/ # Just a local folder I use for testing From 40f67bc7c332eebfb9f4d40c48cbb3f0f9de7289 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 02 2017 20:10:32 +0000 Subject: [PATCH 3/3] Make the run_ci_tests.sh script executable --- diff --git a/run_ci_tests.sh b/run_ci_tests.sh old mode 100644 new mode 100755