clearpathrobotics / robot_upstart

ROS package of helper functions related to bringing up roslaunch on system startup.
BSD 3-Clause "New" or "Revised" License
192 stars 94 forks source link

Fix running tests on both 14.04 and 16.04 #84

Closed Rayman closed 4 years ago

Rayman commented 5 years ago

On 16.04 systemd files are generated. We can reuse robot_upstart.providers.detect_provider() to check in the unit tests what files are expected.

Without this patch, the unit tests on 16.04 generate the following output:

nosetests test/
F...WARNING: Unable to remove directory /tmp/tmpvVSrRh/etc/ros/kinetic/goo.d. Additional user-added files may be present.
.
======================================================================
FAIL: test_install (test_basics.TestBasics)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/ramon/repos/robot_upstart/test/test_basics.py", line 36, in test_install
    self.assertTrue(os.path.exists(self.pjoin("etc/init/foo.conf")), "Upstart configuration file not created.")
AssertionError: Upstart configuration file not created.
-------------------- >> begin captured stdout << ---------------------
/lib/systemd/systemd
Preparing to install files to the following paths:
  /tmp/tmpO59C4y/etc/ros/kinetic/foo.d/.installed_files
  /tmp/tmpO59C4y/etc/systemd/system/multi-user.target.wants/foo.service
  /tmp/tmpO59C4y/lib/systemd/system/foo.service
  /tmp/tmpO59C4y/usr/sbin/foo-start
  /tmp/tmpO59C4y/usr/sbin/foo-stop
Now calling: /opt/ros/kinetic/lib/robot_upstart/mutate_files
Filesystem operation succeeded.
** To complete installation please run the following command:
 sudo systemctl daemon-reload && sudo systemctl start foo

--------------------- >> end captured stdout << ----------------------

----------------------------------------------------------------------
Ran 5 tests in 0.448s

FAILED (failures=1)
130s commented 4 years ago

I think this MR tries to fix the broken CI. However, CI is still failing, though at an unrelated part. I'd restart the CI job in case of just a temporary glitch.

https://travis-ci.org/clearpathrobotics/robot_upstart/builds/550224304?utm_source=github_status&utm_medium=notification

:
dpkg-deb: error: archive '/var/cache/apt/archives/python-catkin-pkg-modules_0.4.12-1_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/python-catkin-pkg-modules_0.4.12-1_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
dpkg-deb: error: archive '/var/cache/apt/archives/python-catkin-pkg_0.4.12-100_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/python-catkin-pkg_0.4.12-100_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
Selecting previously unselected package python-pil.
Preparing to unpack .../python-pil_2.3.0-1ubuntu3.4_amd64.deb ...
Unpacking python-pil (2.3.0-1ubuntu3.4) ...
Selecting previously unselected package python-pygments.
Preparing to unpack .../python-pygments_1.6+dfsg-1ubuntu1.1_all.deb ...
Unpacking python-pygments (1.6+dfsg-1ubuntu1.1) ...
dpkg-deb: error: archive '/var/cache/apt/archives/python-rospkg-modules_1.1.9-1_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/python-rospkg-modules_1.1.9-1_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
dpkg-deb: error: archive '/var/cache/apt/archives/python-rospkg_1.1.9-100_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/python-rospkg_1.1.9-100_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
No apport report written because MaxReports is reached already
Selecting previously unselected package python-setuptools.
Preparing to unpack .../python-setuptools_3.3-1ubuntu2_all.deb ...
Unpacking python-setuptools (3.3-1ubuntu2) ...
dpkg-deb: error: archive '/var/cache/apt/archives/python-rosdistro-modules_0.7.4-1_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/python-rosdistro-modules_0.7.4-1_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
No apport report written because MaxReports is reached already
dpkg-deb: error: archive '/var/cache/apt/archives/python-rosdistro_0.7.4-100_all.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/python-rosdistro_0.7.4-100_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
No apport report written because MaxReports is reached already
Selecting previously unselected package python-rosdep.
Preparing to unpack .../python-rosdep_0.15.2-1_all.deb ...
Unpacking python-rosdep (0.15.2-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for shared-mime-info (1.2-0ubuntu3) ...
Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/python-catkin-pkg-modules_0.4.12-1_all.deb
 /var/cache/apt/archives/python-catkin-pkg_0.4.12-100_all.deb
 /var/cache/apt/archives/python-rospkg-modules_1.1.9-1_all.deb
 /var/cache/apt/archives/python-rospkg_1.1.9-100_all.deb
 /var/cache/apt/archives/python-rosdistro-modules_0.7.4-1_all.deb
 /var/cache/apt/archives/python-rosdistro_0.7.4-100_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
The command "sudo apt-get install python-rosd

In the meantime, with https://github.com/clearpathrobotics/robot_upstart/pull/79#issuecomment-533909814 CI passed.

mikepurvis commented 4 years ago

Closed in favour of #79.