-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for setting discovery arguments via python module paths #164
Comments
So while I agree this feature request would be nice to have I do really wonder how much use it would really have. It seems like a pretty uncommon use case to want to run tests on a package that's already been installed outside of where that code lives. It also depends on tests being packaged in the sdist, which isn't a guaranteed pattern. But, either way it likely won't harm anything and shouldn't be hard to implement, I think it's a good low hanging fruit for a new contributor. As an aside the use case you're describing here is actually something that tempest supports natively already. This is part of the concept of tempest workspaces (see step 3 in: https://docs.openstack.org/tempest/latest/overview.html#quickstart ) That will create a self contained environment for running tempest from an installed tempest package. While the guide there recommends using tempest run after workspace creation, you can use stestr directly. (since tempest run is just calling it internally) |
I just updated the title to be a bit more reflective of what the feature request is. |
Thanks @mtreinish To explain what we did is exactly as you mention in https://docs.openstack.org/tempest/latest/overview.html#quickstart :
And then for each platform we followed https://docs.openstack.org/tempest/latest/configuration.html#tempest-configuration Now the issue with this is that Once stestr accepts python module paths, what I'll do afterwards is raise a launchpad ticket on tempest (and os-testr) so that Thanks a lot. |
Issue description
This is more a feature wish than a bug:
Someone might need stestr to run tests from a pip installed package.
However, these pip installed packages can be in /usr/local/lib/pythonX.X/dist-packages/ or in a virtual environment.
And in a virtual environment, the directory in which are the tests can also have been installed by
pip install -e somepackage/
when "somepackage" is a git repo.Therefore, making a stestr.conf file which will work on unique platforms is currently impossible. when the tests scripts are in another module/repo than the repo you work on.
I.E.: I work on a repo of my openstack platform deplyment, and need to run tempest tests which are in a python module (tempest is a set of tests which run on a deployed openstack environment. I did not write these tests. tempest tests are there to check your openstack platform works properly).
Currently, I need to do this kind of stuff to make stestr platform agnostic so that anyone can launch our openstack tempest tests:
We have a CI, so I can hard code the conf for our CI, but if one wants to launch a new set of tests (new tempest version) to check these tests work on the platform before pushing them to the CI, the
.stestr.conf
for the CI will not work.It would be a very nice feature to be able to configure a "python module import path" instead of a directory.
Expected behavior and actual behavior
Curently we need this kind of configuration where
someuser
can be anyone:A very nice feature would be to be able to provide such configurations:
Of course, it would work only if
my_package.test_discover
is in the python path. See in my example above how I find the real path from the python module. Python is totally capable of doing so (since I find the path with python commands). So having stestr supporting this would be more than great.Steps to reproduce the problem
Create a
.stesr.conf
in your openstack platform deployment repo which works for you and allows you to launch tempest on the installed platform (tempest being a python module).Let someone clone your repo
If this someone's $HOME path is not the exact same (and it's generally the case), stestr will fail unless this user recreates a
.stestr.conf
file.Specifications like the version of the project, operating system, or hardware
Runing openstack tempest tests on openstack platforms.
System information
**stestr version (
stestr --version
): stestr 2.0.0**Python release (
python --version
): Python 2.7.6 and Python 3.4.3Of course I'm totally aware it's not a bug, but since python can very easily find a path from an importable python module, being able to configure a pyhton module for testing would be a very very nice feature.
Let me know if anything was unclear.
Regards.
The text was updated successfully, but these errors were encountered: