From 9f983bfb01863aba0faeed136971c296e283844c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 21 2017 10:13:02 +0000 Subject: [PATCH 1/6] Fix running the unit-tests --- diff --git a/tests/test_pagure_flask_ui_issues.py b/tests/test_pagure_flask_ui_issues.py index 01694e6..14b1d66 100644 --- a/tests/test_pagure_flask_ui_issues.py +++ b/tests/test_pagure_flask_ui_issues.py @@ -441,7 +441,7 @@ class PagureFlaskIssuestests(tests.Modeltests): '/test/issues?milestone=none') self.assertEqual(output.status_code, 200) self.assertIn('Issues - test - Pagure', output.data) - self.assertIn('1 Open Issues (of 2)', output.data) + self.assertIn('1 Open Issues (of 1)', output.data) # Search for issues with no milestone and milestone 1.1 output = self.app.get( diff --git a/tests/test_pagure_flask_ui_old_commit.py b/tests/test_pagure_flask_ui_old_commit.py index c2a00db..4dc6d07 100644 --- a/tests/test_pagure_flask_ui_old_commit.py +++ b/tests/test_pagure_flask_ui_old_commit.py @@ -62,6 +62,7 @@ class PagureFlaskRepoOldUrltests(tests.Modeltests): super(PagureFlaskRepoOldUrltests, self).tearDown() pagure.APP.config['EMAIL_SEND'] = False + pagure.APP.config['OLD_VIEW_COMMIT_ENABLED'] = False pagure.LOG.handlers = [] def test_view_commit_old(self): From 8091225418496114b1216e4e595259d0d8cb7e1a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 21 2017 10:13:16 +0000 Subject: [PATCH 2/6] Bring back `set -e` in run_ci_tests As otherwise the tests are always passing on jenkins :( --- diff --git a/run_ci_tests.sh b/run_ci_tests.sh index b8c68b0..cb327c1 100755 --- a/run_ci_tests.sh +++ b/run_ci_tests.sh @@ -44,6 +44,7 @@ trap deactivate SIGINT SIGTERM EXIT # Reload where the nosetests app is (within the venv) hash -r +set -e python setup.py build From b833739c5ee3024e244af08ee87153d2533b4d58 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 21 2017 10:23:22 +0000 Subject: [PATCH 3/6] Print out the last two commits --- diff --git a/run_ci_tests.sh b/run_ci_tests.sh index cb327c1..e4e0f8c 100755 --- a/run_ci_tests.sh +++ b/run_ci_tests.sh @@ -9,8 +9,8 @@ git config --global user.name "Your Name" git merge --no-ff "proposed/$BRANCH" -m "Merge PR" echo "Running tests for branch $BRANCH of repo $REPO" -echo "Last commit:" -git log -1 +echo "Last commits:" +git log -2 fi From 95d33a035c1ca2c6f68783e5fc830dac253b5bf1 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 21 2017 10:31:24 +0000 Subject: [PATCH 4/6] Set +e after running the tests This in order to avoid failing the tests if pylint or pep8 failed --- diff --git a/run_ci_tests.sh b/run_ci_tests.sh index e4e0f8c..8579c76 100755 --- a/run_ci_tests.sh +++ b/run_ci_tests.sh @@ -53,6 +53,7 @@ PYTHONPATH=pagure \ ./nosetests -v --with-xcoverage --cover-erase --cover-package=pagure if [ "$?" = "0" ]; then + set +e PYTHONPATH=pagure pylint -f parseable pagure | tee pylint.out pep8 pagure/*.py pagure/*/*.py | tee pep8.out From a403cf21601ae18f7dc6499dafcbb5bf517fb175 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 21 2017 10:56:07 +0000 Subject: [PATCH 5/6] Fail early if the setup fails --- diff --git a/run_ci_tests.sh b/run_ci_tests.sh index 8579c76..f59df15 100755 --- a/run_ci_tests.sh +++ b/run_ci_tests.sh @@ -1,3 +1,5 @@ +set -e + if [ -n "$REPO" -a -n "$BRANCH" ]; then git remote rm proposed || true git gc --auto @@ -44,7 +46,6 @@ trap deactivate SIGINT SIGTERM EXIT # Reload where the nosetests app is (within the venv) hash -r -set -e python setup.py build From 4f6f98bfc1ca24e9adb4e3ac5d2b9a6287f39d73 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 21 2017 10:59:22 +0000 Subject: [PATCH 6/6] No longer check the return code, set -e takes care of it --- diff --git a/run_ci_tests.sh b/run_ci_tests.sh index f59df15..c2ff8d6 100755 --- a/run_ci_tests.sh +++ b/run_ci_tests.sh @@ -53,10 +53,8 @@ PAGURE_CONFIG=`pwd`/tests/test_config \ PYTHONPATH=pagure \ ./nosetests -v --with-xcoverage --cover-erase --cover-package=pagure -if [ "$?" = "0" ]; then - set +e +set +e - PYTHONPATH=pagure pylint -f parseable pagure | tee pylint.out - pep8 pagure/*.py pagure/*/*.py | tee pep8.out +PYTHONPATH=pagure pylint -f parseable pagure | tee pylint.out +pep8 pagure/*.py pagure/*/*.py | tee pep8.out -fi