Tests are not being run

Bug #1690706 reported by Jeremy Bícha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
colord-gtk
New
Unknown
colord-gtk (Ubuntu)
New
Undecided
Unassigned

Bug Description

The issue of the tests not being run was raised at both MIRs for this package LP: #1282372 and LP: #1685411

I tried to enable the test using dh_auto_test but I still couldn't get it to work. I'm attaching the patch I used for the packaging and the full build log.

https://github.com/hughsie/colord-gtk/blob/master/libcolord-gtk/cd-self-test.c

Build Log Excerpt
=================
make[5]: Entering directory '/<<PKGBUILDDIR>>/libcolord-gtk'
Activating service name='org.a11y.Bus'

(process:11432): dconf-CRITICAL **: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.

(process:11432): dconf-CRITICAL **: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.

(process:11432): dconf-CRITICAL **: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.

(process:11432): dconf-CRITICAL **: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.

(process:11432): dconf-CRITICAL **: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
Successfully activated service 'org.a11y.Bus'

(process:11432): dconf-CRITICAL **: unable to create directory '/run/user/1000/dconf': Permission denied. dconf will not work properly.
Activating service name='org.a11y.atspi.Registry'
Successfully activated service 'org.a11y.atspi.Registry'
SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
../test-driver: line 107: 11413 Aborted (core dumped) "$@" > $log_file 2>&1
FAIL: cd-self-test
=====================================================
   colord-gtk 0.1.26: libcolord-gtk/test-suite.log
=====================================================

# TOTAL: 1
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: cd-self-test
==================

/colord/window: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
**
libcolord-gtk:ERROR:cd-self-test.c:45:cd_window_get_profile_cb: assertion failed (error == NULL): failed to connect to colord: Could not connect: No such file or directory (cd_window_error, 0)
FAIL cd-self-test (exit status: 134)

Revision history for this message
Jeremy Bícha (jbicha) wrote :
tags: added: patch
Revision history for this message
Jeremy Bícha (jbicha) wrote :
description: updated
Revision history for this message
Iain Lane (laney) wrote :

I would try making a temporary directory under $(CURDIR)/debian/ and export XDG_RUNTIME_DIR=that-directory. Make sure to remove it in clean too.

Revision history for this message
Jeremy Bícha (jbicha) wrote :

Iain, that didn't seem to help when I tried it.

Changed in colord-gtk:
status: Unknown → New
Revision history for this message
Iain Lane (laney) wrote :

It does help. It changes the error message to:

libcolord-gtk:ERROR:cd-self-test.c:45:cd_window_get_profile_cb: assertion failed (error == NULL): failed to connect to colord: Could not connect: No such file or directory (cd_window_error, 0)
FAIL cd-self-test (exit status: 134)

But of course, there's no system bus inside the chroot and colord lives on the system bus.

I think this could in theory be an autopkgtest. If you compile just the test:

  $ gcc $(pkg-config --cflags colord-gtk) -DCD_COMPILATION cd-self-test.c $(pkg-config --libs colord-gtk) -o cd-self-test
  $ dbus-run-session -- xvfb-run -a ./cd-self-test
  [...]
  ERROR:cd-self-test.c:45:cd_window_get_profile_cb: assertion failed (error == NULL): no device with that property: property match 'XRANDR_name'='screen' does not exist (cd_window_error, 0)

it doesn't quite work, but nearly. Maybe upstream would have an idea here.

Jeremy Bícha (jbicha)
tags: added: gnome-17.10
Revision history for this message
Iain Lane (laney) wrote :

It occurs to me that you might be able to do something like

  override_dh_auto_test:
      dbus-run-session -- xvfb-run -a sh -c 'DBUS_SYSTEM_BUS_ADDRESS=$$DBUS_SESSION_BUS_ADDRESS XDG_RUNTIME_DIR=$(CURDIR)/debian/tmp-xdg-runtime-dir dh_auto_test'

That'll probably fail in the same was as it did for me above, but I reckon you'd be able to get a build-time test going like that.

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.