# HG changeset patch # User timeless # Date 1462942167 0 # Node ID 3c9066ed557c25021ec15d70e976351a9c98dfbb # Parent fd288d118074ea8d7b4ddec10da6e75a71ba3312 tests: silence test-repo obsolete warning refactoring test-check-commit.t HGRCPATH bits as helpers-testrepo.sh diff -r fd288d118074 -r 3c9066ed557c tests/helpers-testrepo.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/helpers-testrepo.sh Wed May 11 04:49:27 2016 +0000 @@ -0,0 +1,19 @@ +# The test-repo is a live hg repository which may have evolution +# markers created, e.g. when a ~/.hgrc enabled evolution. +# +# Tests are run using a custom HGRCPATH, which do not +# enable evolution markers by default. +# +# If test-repo includes evolution markers, and we do not +# enable evolution markers, hg will occasionally complain +# when it notices them, which disrupts tests resulting in +# sporadic failures. +# +# Since we aren't performing any write operations on the +# test-repo, there's no harm in telling hg that we support +# evolution markers, which is what the following lines +# for the hgrc file do: +cat >> $HGRCPATH << EOF +[experimental] +evolution=createmarkers +EOF diff -r fd288d118074 -r 3c9066ed557c tests/test-check-code.t --- a/tests/test-check-code.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-check-code.t Wed May 11 04:49:27 2016 +0000 @@ -1,5 +1,6 @@ #require test-repo + $ . "$TESTDIR/helpers-testrepo.sh" $ check_code="$TESTDIR"/../contrib/check-code.py $ cd "$TESTDIR"/.. diff -r fd288d118074 -r 3c9066ed557c tests/test-check-commit.t --- a/tests/test-check-commit.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-check-commit.t Wed May 11 04:49:27 2016 +0000 @@ -2,10 +2,7 @@ Enable obsolescence to avoid the warning issue when obsmarker are found - $ cat >> $HGRCPATH << EOF - > [experimental] - > evolution=createmarkers - > EOF + $ . "$TESTDIR/helpers-testrepo.sh" Go back in the hg repo diff -r fd288d118074 -r 3c9066ed557c tests/test-check-config.t --- a/tests/test-check-config.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-check-config.t Wed May 11 04:49:27 2016 +0000 @@ -1,5 +1,6 @@ #require test-repo + $ . "$TESTDIR/helpers-testrepo.sh" $ cd "$TESTDIR"/.. New errors are not allowed. Warnings are strongly discouraged. diff -r fd288d118074 -r 3c9066ed557c tests/test-check-execute.t --- a/tests/test-check-execute.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-check-execute.t Wed May 11 04:49:27 2016 +0000 @@ -1,5 +1,6 @@ #require test-repo execbit + $ . "$TESTDIR/helpers-testrepo.sh" $ cd "`dirname "$TESTDIR"`" look for python scripts without the execute bit diff -r fd288d118074 -r 3c9066ed557c tests/test-check-module-imports.t --- a/tests/test-check-module-imports.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-check-module-imports.t Wed May 11 04:49:27 2016 +0000 @@ -1,5 +1,6 @@ #require test-repo + $ . "$TESTDIR/helpers-testrepo.sh" $ import_checker="$TESTDIR"/../contrib/import-checker.py Run the doctests from the import checker, and make sure diff -r fd288d118074 -r 3c9066ed557c tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-check-py3-compat.t Wed May 11 04:49:27 2016 +0000 @@ -1,5 +1,6 @@ #require test-repo + $ . "$TESTDIR/helpers-testrepo.sh" $ cd "$TESTDIR"/.. $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py diff -r fd288d118074 -r 3c9066ed557c tests/test-check-pyflakes.t --- a/tests/test-check-pyflakes.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-check-pyflakes.t Wed May 11 04:49:27 2016 +0000 @@ -1,5 +1,6 @@ #require test-repo pyflakes hg10 + $ . "$TESTDIR/helpers-testrepo.sh" $ cd "`dirname "$TESTDIR"`" run pyflakes on all tracked files ending in .py or without a file ending diff -r fd288d118074 -r 3c9066ed557c tests/test-check-shbang.t --- a/tests/test-check-shbang.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-check-shbang.t Wed May 11 04:49:27 2016 +0000 @@ -1,5 +1,6 @@ #require test-repo + $ . "$TESTDIR/helpers-testrepo.sh" $ cd "`dirname "$TESTDIR"`" look for python scripts that do not use /usr/bin/env diff -r fd288d118074 -r 3c9066ed557c tests/test-contrib-perf.t --- a/tests/test-contrib-perf.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-contrib-perf.t Wed May 11 04:49:27 2016 +0000 @@ -2,6 +2,7 @@ Set vars: + $ . "$TESTDIR/helpers-testrepo.sh" $ CONTRIBDIR="$TESTDIR/../contrib" Prepare repo: diff -r fd288d118074 -r 3c9066ed557c tests/test-debian-packages.t --- a/tests/test-debian-packages.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-debian-packages.t Wed May 11 04:49:27 2016 +0000 @@ -1,5 +1,7 @@ #require test-repo slow debhelper + $ . "$TESTDIR/helpers-testrepo.sh" + Ensure debuild doesn't run the testsuite, as that could get silly. $ DEB_BUILD_OPTIONS=nocheck $ export DEB_BUILD_OPTIONS diff -r fd288d118074 -r 3c9066ed557c tests/test-docker-packaging.t --- a/tests/test-docker-packaging.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-docker-packaging.t Wed May 11 04:49:27 2016 +0000 @@ -1,5 +1,7 @@ #require test-repo slow docker + $ . "$TESTDIR/helpers-testrepo.sh" + Ensure debuild doesn't run the testsuite, as that could get silly. $ DEB_BUILD_OPTIONS=nocheck $ export DEB_BUILD_OPTIONS diff -r fd288d118074 -r 3c9066ed557c tests/test-install.t --- a/tests/test-install.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-install.t Wed May 11 04:49:27 2016 +0000 @@ -78,6 +78,8 @@ no problems detected #if test-repo + $ . "$TESTDIR/helpers-testrepo.sh" + $ cat >> wixxml.py << EOF > import os, subprocess, sys > import xml.etree.ElementTree as ET diff -r fd288d118074 -r 3c9066ed557c tests/test-mac-packages.t --- a/tests/test-mac-packages.t Mon May 09 10:05:32 2016 +0200 +++ b/tests/test-mac-packages.t Wed May 11 04:49:27 2016 +0000 @@ -1,4 +1,7 @@ #require test-repo slow osx osxpackaging + + $ . "$TESTDIR/helpers-testrepo.sh" + $ OUTPUTDIR=`pwd` $ export OUTPUTDIR $ KEEPMPKG=yes