ros / rosdistro

This repo maintains a lists of repositories for each ROS distribution
Other
914 stars 2.54k forks source link

Contributing guideline - tests and their dependencies. #16336

Closed peci1 closed 5 years ago

peci1 commented 6 years ago

CONTRIBUTING.md says:

To run the tests run nosetests in the root of the repository. They require the rosdistro library, available on Ubuntu with the ROS repositories as python-rosdistro or via pip as rosdistro.

  1. The tests actually need more dependencies than rosdistro. That should be somehow reflected in this text excerpt. Probably linking to .travis.yml for an idea about what to install?
  2. When (after installing dependencies) I run nosetests in the root of repo, nothing happens, no tests are executed (well, noestests tell me 1 test ran, but the runtime is ~0 sec).
mikaelarguedas commented 6 years ago

Thanks @peci1 for the report. Indeed it looks like we added several tests that require specific modules without adding them to the CONTRIBUTING.mg... Linking to the travis file is a good idea indeed this way we're sure the instructions stay up to date :+1: .

When (after installing dependencies) I run nosetests in the root of repo, nothing happens, no tests are executed (well, noestests tell me 1 test ran, but the runtime is ~0 sec).

Hmm that's surprising, I just tried this in a fresh container and got the full suite of tests running:

# apt upgrade && apt install git dirmngr lsb-release
# sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
# apt update && apt install python-pip
# pip install PyYAML argparse catkin_pkg ros_buildfarm rosdistro nose coverage yamllint unidiff rosdep PyGithub
# git clone https://github.com/ros/rosdistro
# cd rosdistro/
# nosetests -s
[...] # plenty of console output
Ran 6 tests in 107.476s

OK

Do you see any difference with what you tried on your side ?

peci1 commented 6 years ago
# cd rosdistro/
# ls
CONTRIBUTING.md  groovy  index.yaml  jade     lunar      releases  ros.key  test
doc              hydro   indigo      kinetic  README.md  rosdep    scripts
# nosetests -s
.
----------------------------------------------------------------------
Ran 1 test in 0.067s

OK
peci1 commented 6 years ago

nosetests run in Python 2.7

peci1 commented 6 years ago

nosetests version 1.3.7

mikaelarguedas commented 6 years ago

Unfortunately that is not enough information to help us figure out what your system setup is, can you provide the OS you are running, a pip freeze output as well as the history of commands you run before trying to run the test?

peci1 commented 6 years ago

Ubuntu 14.04.5 LTS 64bit, Python 2.7.6. Runs on Intel i7 Haswell, Dell Latitude E6450.

The steps are the same as you did, just I didn't start with a fresh container, but my development machine.

actionlib==1.11.9 adium-theme-ubuntu==0.3.4 angles==1.9.11 apipkg==1.4 appdirs==1.4.3 apsw==3.8.2.post1 apt-xapian-index==0.45 autokey==0.90.4 autopep8==1.2.4 backports-abc==0.4 backports.shutil-get-terminal-size==1.0.0 backports.ssl-match-hostname==3.5.0.1 backports.weakref==1.0.post1 base-local-planner==1.12.13 baxter-interface==1.2.0 BeautifulSoup==3.2.1 bleach==1.5.0 bondpy==1.7.19 boto==2.43.0 Box2D==2.3.2 bzr==2.7.0 bzr-builddeb==2.8.6 BzrTools==2.6.0 camera-calibration==1.12.20 camera-calibration-parsers==1.11.12 camera-info-manager-py==0.2.3 catkin==0.6.19 catkin-lint==1.4.10 catkin-pkg==0.3.9 catkin-pkg-modules==0.3.9 catkin-tools==0.4.4 ccsm==0.9.11.3 certifi==2016.9.26 cffi==1.8.3 Chameleon==2.25 chardet==2.3.0 CherryPy==3.2.2 click==6.7 colorama==0.3.7 command-not-found==0.3 compizconfig-python==0.9.11.3 configglue==1.1.3.post0 configobj==5.0.6 configparser==3.5.0 controller-manager==0.9.4 controller-manager-msgs==0.9.4 CouchDB==0.8 coverage==4.4.2 cryptography==1.5.3 cssselect==0.9.1 cssutils==0.9.10 cv-bridge==1.11.15 cycler==0.10.0 Cython==0.25.1 debtagshw==0.1 decorator==4.0.10 defer==1.0.6 defusedxml==0.4.1 diagnostic-analysis==1.9.2 diagnostic-common-diagnostics==1.9.2 diagnostic-updater==1.9.2 dirspec==13.10 distro-info==0.12 dnspython==1.15.0 docutils==0.14 dulwich==0.15.0 duplicity==0.6.23 dynamic-reconfigure==1.5.48 ecdsa==0.13 empy==3.3.2 entrypoints==0.2.2 enum34==1.1.6 epub==0.5.2 euca2ools==3.0.1 execnet==1.4.1 fastimport==0.9.6 fcl==0.1 feedparser==5.1.3 fpconst==0.7.2 funcsigs==1.0.2 functools32==3.2.3.post2 fuse-python==0.2.1 futures==3.0.5 gazebo-plugins==2.4.11 gazebo-ros==2.4.11 gcovr==3.3 GDAL==1.10.1 gencpp==0.5.5 genlisp==0.4.15 genmsg==0.5.8 genpy==0.5.10 globs==0.2 GPy==1.5.6 gym==0.8.1 h5py==2.7.0 html5lib==0.9999999 httplib2==0.9.2 idna==2.1 image-geometry==1.11.15 imageio==2.1.2 interactive-markers==1.11.3 iotop==0.6 ipaddress==1.0.17 ipykernel==4.5.0 ipython==5.1.0 ipython-genutils==0.1.0 ipywidgets==5.2.2 Jinja2==2.8 joblib==0.10.3 jsk-topic-tools==2.2.5 jsonschema==2.5.1 jupyter-client==4.4.0 jupyter-core==4.2.0 kdl-parser-py==1.11.14 kdtree==0.15 keyring==10.0.2 lama-interfaces==0.1.3 laser-geometry==1.6.4 launchpadlib==1.10.4 lazr.restfulclient==0.13.3 lazr.uri==1.0.3 livereload==2.5.1 lockfile==0.12.2 lptools==0.2.0 lunch==0.4.0 lxml==3.6.4 Mako==1.0.5 Markdown==2.6.9 MarkupSafe==0.23 matplotlib==1.5.3 mechanize==0.2.5 mercurial==2.8.2 message-filters==1.11.21 mistune==0.7.3 mkdocs==0.16.0 mkdocs-bootswatch==0.4.0 mock==2.0.0 moviepy==0.2.3.1 msgpack-numpy==0.3.9 msgpack-python==0.4.8 nbconvert==4.2.0 nbformat==4.1.0 netifaces==0.10.5 networkx==1.11 nose==1.3.7 nose-unittest==0.1.1 notebook==4.2.3 numpy==1.13.3 oauth==1.0.1 oauthlib==2.0.0 olefile==0.44 oneconf==0.3.7.14.4.1 osrf-pycommon==0.1.3 packaging==16.8 PAM==0.4.2 paramiko==2.0.2 paramz==0.7.0 path.py==8.2.1 pathlib==1.0.1 pathlib2==2.1.0 pathspec==0.5.5 pbr==3.1.1 pdfshuffler==0.6.0 pep8==1.7.0 pexpect==4.2.1 phablet-tools==0.1 pickleshare==0.7.4 Pillow==4.3.0 piston-mini-client==0.7.5 Pivy==0.5.0 pluginlib==1.10.5 ply==3.9 pomegranate==0.6.1 prompt-toolkit==1.0.9 protobuf==3.4.0 psutil==5.0.0 ptyprocess==0.5.1 py==1.4.31 pyasn1==0.1.9 PyAssimp==3.0.1264 PyBluez==0.22 pycollada==0.4.1 pycparser==2.17 pycrypto==2.6.1 pycups==1.9.73 pycurl==7.43.0 pydns==2.3.6 pydot==1.2.3 PyGithub==1.35 pyglet==1.2.4 Pygments==2.1.3 pygobject==3.12.0 pygpgme==0.3 pygraphviz==1.3.1 pyinotify==0.9.6 PyJWT==1.5.3 pyliblzma==0.5.3 pylzma==0.4.8 pymongo==3.3.1 PyOpenGL==3.1.0 pyOpenSSL==16.2.0 pyparsing==2.2.0 pyPdf==1.13 pyqtgraph==0.10.0 pyserial==3.2.1 pysmbc==1.0.14.1 pysnmp==4.2.5 pytest==3.0.3 pytest-cache==1.0 pytest-cov==2.4.0 pytest-pep8==1.0.6 pytest-timeout==1.0.0 python-apt===0.9.3.5ubuntu2 python-dateutil==2.6.1 python-debian==0.1.28 python-debianbts==1.11 python-qt-binding==0.2.19 python-xlib==0.17 pytools==2016.2.4 pytz==2016.7 pyxdg==0.25 PyYAML==3.12 pyzmq==16.0.2 qt-dotgraph==0.2.32 qt-gui==0.2.32 qt-gui-cpp==0.2.32 qt-gui-py-common==0.2.32 rabbitvcs==0.16.0 rarfile==2.8 Recoll==1.0 reportbug==6.5.0 reportlab==3.3.0 repoze.lru==0.6 requestbuilder==0.5.2 requests==2.11.1 resource-retriever==1.11.8 rocon-console==0.1.23 rocon-gateway==0.7.10 rocon-gateway-utils==0.7.10 rocon-hub-client==0.7.10 rocon-python-comms==0.1.23 rocon-python-redis==0.1.23 rocon-python-utils==0.1.23 rocon-python-wifi==0.1.23 roman==2.0.0 ros-buildfarm==1.4.1 ros-buildfarm-modules==1.4.1 rosapi==0.7.16 rosbag==1.11.21 rosboost-cfg==1.11.14 rosbridge-library==0.7.16 rosbridge-server==0.7.16 rosclean==1.11.14 roscreate==1.11.14 rosdep==0.11.8 rosdistro==0.6.2 rosdistro-modules==0.6.2 rosgraph==1.11.21 rosinstall-generator==0.1.12 roslaunch==1.11.21 roslib==1.11.14 roslint==0.10.0 roslz4==1.11.21 rosmake==1.11.14 rosmaster==1.11.21 rosmsg==1.11.21 rosnode==1.11.21 rosparam==1.11.21 rospkg==1.1.4 rospkg-modules==1.1.4 rospy==1.11.21 rosservice==1.11.21 rostest==1.11.21 rostopic==1.11.21 rosunit==1.11.14 roswtf==1.11.21 Routes==2.0 rqt-action==0.4.9 rqt-bag==0.4.8 rqt-bag-plugins==0.4.8 rqt-console==0.4.8 rqt-dep==0.4.8 rqt-graph==0.4.8 rqt-gui==0.4.8 rqt-gui-py==0.4.8 rqt-image-view==0.4.9 rqt-joint-trajectory-controller==0.9.4 rqt-launch==0.4.8 rqt-logger-level==0.4.8 rqt-moveit==0.5.7 rqt-msg==0.4.8 rqt-nav-view==0.5.7 rqt-paramedit==1.0.0 rqt-plot==0.4.8 rqt-pose-view==0.5.8 rqt-publisher==0.4.8 rqt-py-common==0.4.8 rqt-py-console==0.4.8 rqt-reconfigure==0.4.8 rqt-robot-dashboard==0.5.7 rqt-robot-monitor==0.5.7 rqt-robot-steering==0.5.7 rqt-runtime-monitor==0.5.7 rqt-rviz==0.5.7 rqt-service-caller==0.4.8 rqt-shell==0.4.9 rqt-srv==0.4.8 rqt-tf-tree==0.5.8 rqt-top==0.4.8 rqt-topic==0.4.8 rqt-web==0.4.8 rviz==1.11.18 safemdp==1.0 scikit-learn==0.18.1 scipy==0.18.1 SecretStorage==2.3.1 sensor-msgs==1.11.9 sessioninstaller==0.0.0 simplegeneric==0.8.1 simplejson==3.10.0 singledispatch==3.4.0.3 six==1.11.0 smach==2.0.1 smach-ros==2.0.1 smclib==1.7.19 SOAPpy==0.12.22 software-center-aptd-plugins==0.0.0 sound-play==0.2.12 SQLAlchemy==1.1.3 srdfdom==0.3.5 ssh-import-id==5.6 subprocess32==3.2.7 system-service==0.1.6 tabulate==0.7.7 tensorboard==1.0.0a7 tensorflow==1.3.0 tensorflow-tensorboard==0.1.8 tensorpack==0.1.7 termcolor==1.1.0 terminado==0.6 testresources==2.0.1 tf==1.11.9 tf-conversions==1.11.9 tf2-geometry-msgs==0.5.16 tf2-kdl==0.5.16 tf2-py==0.5.16 tf2-ros==0.5.16 tf2-sensor-msgs==0.5.16 tflearn==0.3.2 thefuck==3.11 tornado==4.4.2 tqdm==4.11.2 traitlets==4.3.1 trollius==2.1 Twisted-Core==13.2.0 Twisted-Names==13.2.0 Twisted-Web==13.2.0 ubuntu-dev-tools===0.153ubuntu1 ubuntu-tweak==0.8.8 UniConvertor==1.1.4 unidiff==0.5.4 unique-id==1.0.5 unity-lens-photos==1.0 urdfdom-py==0.3.3 urlgrabber==3.9.1 urllib3==1.19 uTidylib==0.2 vboxapi==1.0 vcstools==0.1.39 vizdoom==1.1.1 VTK==5.8.0 wadllib==1.3.2 wcwidth==0.1.7 webencodings==0.5 WebOb==1.3.1 Werkzeug==0.12.2 widgetsnbextension==1.2.6 wstool==0.1.13 wstools==0.4.4 wxPython==2.8.12.1 wxPython-common==2.8.12.1 xacro==1.9.5 xdiagnose===3.6.3build2 yamllint==1.10.0 zc.buildout==2.5.3 zenmap==6.40 zope.interface==4.3.2

mikaelarguedas commented 6 years ago

Ok that's surprising. I tried in trusty and without anything installed it runs fine. Installing a few of the ros packages you have on your system (python-catkin-pkg and python-ros-buildfarm for example) I got nose to fail (not being found). Removing them from pip, installing it from apt and running nose from /usr/bin/nose worked.

Didnt get to the point where it runs but doesnt find any test yet though.

There is definitely something fishy when you have the same python packages installed from apt and from pip. I don't have much more time to look into it right now so I'd advise you to run it in a container for now or to try installing and run the python3 version of these packages to be sure to avoid weird mix-n-match of packages.

Please keep us updated if you find out where the problem comes from

peci1 commented 6 years ago

debug_nose.txt

A log from running nosetests in the rosdistro dir.

This was achived by the following .noserc:

[nosetests]
verbosity=5
with-doctest=1

It seems only the test_url_validity test is picked up.

peci1 commented 6 years ago

Found the culprit!

It was the pip package nose-unittest, which installs a plugin that switches the testing to unittest mode. What's weird, according to the documentation I understood that should only happen when you pass "--with-unittest", which I don't do.

I also don't know how did the nose-unittest package get to my system, I don't use it directly anywhere, but maybe uninstalling it broke something.

Could you please test that you can reproduce my problem by installing nose-unittest?

mikaelarguedas commented 6 years ago

Thanks @peci1 for investigating. I can reproduce the issue. If I follow the steps in https://github.com/ros/rosdistro/issues/16336#issuecomment-343633404 I can get the tests to run. If I install nose-unittest and run nosetests again I get the same behavior as you described in https://github.com/ros/rosdistro/issues/16336#issuecomment-343634242. (same thing if I istall the packages via apt but nose-unittest via pip)

peci1 commented 6 years ago

So maybe it deserves a comment in the contribution guidelines? I've already submitted a bug report to upstream ( https://github.com/disqus/nose-unittest/issues/2 ), but as the package has last been updated 5 years ago, there's probably no chance of it being fixed.