init can't find testr when run in venv without activating

Bug #1633182 reported by Brant Knudson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
Matthew Treinish

Bug Description

When I install tempest to a virtualenv and then run tempest init in the venv without activating it, the command fails because it can't find the testr executable.

Maybe this is `working as designed` but maybe then tempest should not work rather than failing with an obscure error.

Here's the traceback:

$ ./tempest2/bin/tempest --debug init ws1
...
2016-10-13 18:30:20.148 18443 ERROR tempest [-] [Errno 2] No such file or directory
2016-10-13 18:30:20.148 18443 ERROR tempest Traceback (most recent call last):
2016-10-13 18:30:20.148 18443 ERROR tempest File "/home/vagrant/tempest2/local/lib/python2.7/site-packages/cliff/app.py", line 387, in run_subcommand
2016-10-13 18:30:20.148 18443 ERROR tempest result = cmd.run(parsed_args)
2016-10-13 18:30:20.148 18443 ERROR tempest File "/home/vagrant/tempest2/local/lib/python2.7/site-packages/cliff/command.py", line 59, in run
2016-10-13 18:30:20.148 18443 ERROR tempest return self.take_action(parsed_args) or 0
2016-10-13 18:30:20.148 18443 ERROR tempest File "/home/vagrant/tempest/tempest/cmd/init.py", line 180, in take_action
2016-10-13 18:30:20.148 18443 ERROR tempest self.create_working_dir(parsed_args.dir, config_dir)
2016-10-13 18:30:20.148 18443 ERROR tempest File "/home/vagrant/tempest/tempest/cmd/init.py", line 170, in create_working_dir
2016-10-13 18:30:20.148 18443 ERROR tempest subprocess.call(['testr', 'init'], cwd=local_dir)
2016-10-13 18:30:20.148 18443 ERROR tempest File "/usr/lib/python2.7/subprocess.py", line 522, in call
2016-10-13 18:30:20.148 18443 ERROR tempest return Popen(*popenargs, **kwargs).wait()
2016-10-13 18:30:20.148 18443 ERROR tempest File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
2016-10-13 18:30:20.148 18443 ERROR tempest errread, errwrite)
2016-10-13 18:30:20.148 18443 ERROR tempest File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
2016-10-13 18:30:20.148 18443 ERROR tempest raise child_exception
2016-10-13 18:30:20.148 18443 ERROR tempest OSError: [Errno 2] No such file or directory

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/386195

Changed in tempest:
assignee: nobody → Matthew Treinish (treinish)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/386195
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=219796218a1bbf651328446f986a7c77bb2b5f3f
Submitter: Jenkins
Branch: master

commit 219796218a1bbf651328446f986a7c77bb2b5f3f
Author: Matthew Treinish <email address hidden>
Date: Thu Oct 13 15:46:33 2016 -0400

    Stop using subprocess for testr init in tempest init

    This commit switches the call to testr init from using subprocess to
    testr's python run_argv interface. (which is essentially just calling
    it via subprocess) The issue with using subprocess directly is that it
    assumes testr is in the PATH you're running from. But, in the case of
    using a venv this isn't always the case.

    Change-Id: I2bab70b0e9fb2ccdc340f48d95340ff7ccdc1364
    Closes-Bug: #1633182

Changed in tempest:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.