From 322a74c13c10b03155701162c277fa74e2db6a7b Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Tue, 26 May 2015 12:16:22 -0700 Subject: [PATCH] Inherit environment variables for tests that use nodeenv Tox 2.0 stopped automatically passing environment variables into the virtual environment which potentially breaks test jobs which use nodeenv because of the nature of running nodeenv within a virtual environment. The nodeenv documentation (https://pypi.python.org/pypi/nodeenv) even says: " If you already have the python virtualenv tool, and want to use nodeenv and virtualenv in conjunction, then you should create (or activate) the python virtual environment: $ mkvirtualenv my_env $ . my_env/bin/activate and add a node virtual environment to this existing new_venv: $ nodeenv -p " Since we can't source {envdir}/bin/activate from within the tox.ini, we just pass the environment variables into the virtual environment using passenv = *. An alternative may be to change run_test.sh to run tests which use nodeenv within a venv by sourcing $VIRTUAL_ENV/bin/activate from within run_test.sh. Conflicts: tox.ini NOTE(mriedem): The conflict is on the jscs job which was not in kilo. Closes-Bug: #1458928 Change-Id: Icb91cdc0d4610407c4eeeda82f194c7016e3b540 (cherry picked from commit 22c485b179681aa3fdcf3dc1207bbd0d2588acb9) --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index ff7a88dbab..34b14b40ab 100644 --- a/tox.ini +++ b/tox.ini @@ -45,6 +45,7 @@ basepython = python2.7 commands = /bin/bash run_tests.sh -N --integration --selenium-headless {posargs} [testenv:jshint] +passenv = * commands = nodeenv -p npm install jshint -g /bin/bash run_tests.sh -N --jshint