-
Notifications
You must be signed in to change notification settings - Fork 105
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
Distribute tests #669
Distribute tests #669
Conversation
Perhaps it's not too bad that Travis CI was down due to connection problems at GitHub (hard to say whose fault), so the new installation doc is not yet deployed. |
See Travis CI status |
Another remark: Sudden pytest warnings are not my fault: |
We need to look into how numby solves this, in the end this really is something we need. |
Above comment was me thinking this was a issue ^^. Anyway nice pull, but does removing |
package_dir={'odl': 'odl'}, | ||
package_data={'odl': find_tests()}, | ||
include_package_data=True, | ||
entry_points={'pytest11': ['odl_plugins = odl.util.pytest_plugins']}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this make pytest find it? What does 11 mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is one of the 4 or 5 ways to extend pytest by custom "plugins". The mechanism I used is described here. The name "pytest11" is fixed and magic :-)
How about the pytest.ini file? |
@@ -467,5 +467,5 @@ If that does not help, `make an issue on GitHub <https://github.com/odlgroup/odl | |||
.. _CVXPY: http://www.cvxpy.org/en/latest/ | |||
.. _odlcuda: https://github.com/odlgroup/odlcuda | |||
.. _CUDA toolkit: https://developer.nvidia.com/cuda-toolkit | |||
.. _ASTRA tomography toolbox: https://github.com/astra-toolbox/astra-toolbox | |||
.. _ASTRA: https://github.com/astra-toolbox/astra-toolbox |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link has to be wrong now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the other one is inline now, I don't see a point in 3 different targets linking to the same page.
for filename in filenames: | ||
basename, suffix = os.path.splitext(filename) | ||
if (suffix == '.py' and | ||
(basename.startswith('test') or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is actually supposed to be _test
and test_
See:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I had that first, it was correct. Dunno why I changed it.
@@ -61,6 +56,23 @@ def run_tests(self): | |||
errno = pytest.main(self.pytest_args) | |||
sys.exit(errno) | |||
|
|||
|
|||
test_path = os.path.join(root_path, 'odl/test') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os.path.join(root_path, 'odl', test')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, of course.
Looks good except for the minor comments. Are we sure this works? If we we need to make a 5.1 release, perhaps you can look into pypi test (https://wiki.python.org/moin/TestPyPI) before the actual release. |
It can be included as extra package file, however only under |
Everything is fixed, and I tested all combinations of Python 2/3 and source/wheel/conda packages. Works smoothly.
Good suggestion with the test server. |
Bumpety |
Fine by me! |
5.1 release comming? |
Done! |
Trying install in a VM |
Worked perfectly from |
Phew! :-) |
Unfortunately I realized too late that the tests are not included, neither in the
pip
nor theconda
packages. The problem is basically thatodl/test
is not a package and thus not included. We actually explicitly excluded anything containing "test" insetup.py
, ahem.Anyway, it turns out that the
python setup.py sdist
andbdist_wheel
commands can rather easily be convinced to include extra stuff using thepackage_data
parameter AND recursively addingodl/test
inMANIFEST.in
. However, forpython setup.py install
, you also have to give theinclude_package_data=True
option (of course, why would I want to install with data when I explicitly givepackage_data
???).Next issue:
conftest.py
is not installed, and without it, the extra plugins (--largescale
and such) don't work. No test runs since the options in the corresponding files are not recognized. Puttingconftest.py
one level below didn't work either for a reason I don't remember. Here the solution was to go for the second item here and follow the instructions here to make an entry point forpytest
-- which now resides inodl.util.pytest_plugins.py
. Here the description was actually very good, and the approach worked immediately.So now that this is done, I think we need a new release 0.5.1 (sorry about that). I'll put the correct tag into
conda/meta.yaml
and merge when we agree on the changes.