Repository: aurora Updated Branches: refs/heads/master 50f47ccc9 -> 2988a7e01
Unset PYTHONPATH before calling pants Our tests are started via `./pants test.pytest` and are then calling `./pants binary` within some test setup routines. Looks like that the `PYTHONPATH` can be tainted for the second run. Unsetting it seems to prevent test failures of the kind: ``` Traceback (most recent call last): File "/home/jenkins/.cache/pants/setup/bootstrap-Linux-x86_64/0.0.80/bin/pants", line 7, in <module> from pants.bin.pants_exe import main ImportError: No module named pants.bin.pants_exe ``` Bugs closed: AURORA-1717 Reviewed at https://reviews.apache.org/r/51366/ Project: http://git-wip-us.apache.org/repos/asf/aurora/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/2988a7e0 Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/2988a7e0 Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/2988a7e0 Branch: refs/heads/master Commit: 2988a7e015f8960e9a8e6db20669cc8f0e12da08 Parents: 50f47cc Author: Stephan Erb <[email protected]> Authored: Fri Aug 26 08:30:45 2016 +0200 Committer: Stephan Erb <[email protected]> Committed: Fri Aug 26 08:30:45 2016 +0200 ---------------------------------------------------------------------- pants | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora/blob/2988a7e0/pants ---------------------------------------------------------------------- diff --git a/pants b/pants index b1ca382..312dd20 100755 --- a/pants +++ b/pants @@ -23,6 +23,10 @@ # ==================================================================== set -e +# AURORA-1717: If the PYTHONPATH is tainted, calling `./pants` may fail +# with `ImportError: No module named pants.bin.pants_exe` +unset PYTHONPATH + PYTHON=${PYTHON:-$(which python2.7)} PANTS_HOME="${PANTS_HOME:-${HOME}/.cache/pants/setup}"
