diff --git a/.zuul.yaml b/.zuul.yaml index 884d2b80..59bf82be 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -14,8 +14,7 @@ voting: false - sahara-tests-scenario - sahara-tests-scenario-v2 - - sahara-tests-scenario-py3: - voting: false + - sahara-tests-scenario-py3 - sahara-tests-tempest - sahara-tests-tempest-v2 - sahara-tests-scenario-rocky @@ -26,6 +25,7 @@ jobs: - sahara-tests-scenario - sahara-tests-scenario-v2 + - sahara-tests-scenario-py3 - sahara-tests-tempest - sahara-tests-tempest-v2 experimental: diff --git a/releasenotes/notes/sahara-scenario-fix-runner-59350d608d19caf9.yaml b/releasenotes/notes/sahara-scenario-fix-runner-59350d608d19caf9.yaml new file mode 100644 index 00000000..c75cc34f --- /dev/null +++ b/releasenotes/notes/sahara-scenario-fix-runner-59350d608d19caf9.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix a strange error where the internally generated test does not start + because sahara_tests.scenario is not found when running inside a virtualenv. diff --git a/sahara_tests/scenario/utils.py b/sahara_tests/scenario/utils.py index bf0185eb..474a27a5 100644 --- a/sahara_tests/scenario/utils.py +++ b/sahara_tests/scenario/utils.py @@ -60,6 +60,12 @@ def run_tests(concurrency, test_dir_path): if concurrency: command.extend(['--concurrency=%d' % concurrency]) new_env = os.environ.copy() + # Use the same python executable which has started sahara-scenario, + # if the PYTHON value has not been set explicitly. + # This is important whenever sahara-scenario is executed in a virtualenv + # or there are multiple Python versions around. + if not new_env.get('PYTHON', ''): + new_env['PYTHON'] = sys.executable tester_runner = subprocess.Popen(command, env=new_env, cwd=test_dir_path) tester_runner.communicate() return tester_runner.returncode