Bug #598

The unit test for the VU meters fails - and prevents packaging on headless computers

Added by Alexandre Quessy almost 3 years ago. Updated almost 3 years ago.

Status:Closed Start date:
Priority:Urgent Due date:
Assignee:Tristan Matthews % Done:

0%

Category:tests Spent time: -
Target version:0.6.3
Resolution:fixed Version:0.6.2
Trac ticket ID:598

Description

maker5: Leaving directory @/tmp/buildd/scenic-0.6.3/src/vumeter/test'
/usr/bin/make  check-TESTS
maker5: Entering directory @/tmp/buildd/scenic-0.6.3/src/vumeter/test'
No protocol specified
/usr/lib/pymodules/python2.6/gtk-2.0/gtk/+init+.py:57: [[GtkWarning]]: could not open display
  warnings.warn(str(e), _gtk.Warning)
test_vumeter
  [[TestVumeter]]
    test_vumeter ... /bin/bash: line 5:  8720 Segmentation fault      LANG=en_CA.UTF-8 PATH=../:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin trial ${dir}$tst
FAIL: test_vumeter.py
================================================================
1 of 1 test failed
Please report to http://svn.sat.qc.ca/trac/scenic/wiki/BugReport
================================================================
maker5: *** [check-TESTS] Error 1
maker5: Leaving directory @/tmp/buildd/scenic-0.6.3/src/vumeter/test'
maker4: *** [check-am] Error 2
maker4: Leaving directory @/tmp/buildd/scenic-0.6.3/src/vumeter/test'
maker3: *** [check-recursive] Error 1
maker3: Leaving directory @/tmp/buildd/scenic-0.6.3/src/vumeter'
maker2: *** [check-recursive] Error 1
maker2: Leaving directory @/tmp/buildd/scenic-0.6.3/src'
maker1: *** [check-recursive] Error 1
maker1: Leaving directory @/tmp/buildd/scenic-0.6.3'
make: *** [debian/stamp-makefile-check] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
E: Failed autobuilding of package

History

Updated by Alexandre Quessy almost 3 years ago

I was running sudo pbuilder build scenic_0.6.3-1.dsc which builds it without X11.

Updated by Alexandre Quessy almost 3 years ago

The DISPLAY env var is present. We should not onyl check for its presence, but also test if can open the display with gtk, prior to run this test.

SHELL=/bin/bash
TERM=rxvt-unicode
LC_ALL=C
PBCURRENTCOMMANDLINEOPERATION=login
USER=root
LS_COLORS=rs=0:di=01;34:ln=01;36:hl=44;37:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
SUDO_USER=aalex
SUDO_UID=1000
USERNAME=root
PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
PWD=/
LANG=C
PBUILDER_PKGLIBDIR=/usr/lib/pbuilder
PBUILDER_PKGDATADIR=/usr/share/pbuilder
SHLVL=2
SUDO_COMMAND=/usr/sbin/pbuilder login
HOME=/home/aalex
LANGUAGE=fr_CA:en_CA:en
LOGNAME=root
DEBIAN_FRONTEND=noninteractive
SUDO_GID=1000
DISPLAY=:0.0
PBUILDER_SYSCONFDIR=/etc
XAUTHORITY=/var/run/gdm/auth-for-aalex-UeDf3e/database
COLORTERM=rxvt-xpm
_=/usr/bin/env

Updated by Alexandre Quessy almost 3 years ago

See bug #599.

Updated by Alexandre Quessy almost 3 years ago

At least, please print an error message. Avoid using assert like that, please.

Updated by Alexandre Quessy almost 3 years ago

Which jack-info executable is it running? What if there is one that is installed?

import subprocess
from twisted.trial import unittest

# Make sure TESTS_ENVIRONMENT has jack-info in path (shouldn't need to be installed)

class [[TestJackInfo]](unittest.TestCase):
    def test_jack_info(self):
        """ 
            Check that jack-info prints backend, device, name, nperiods, period, pid, rate
        """ 
        # redirect stderr to stdout
        proc = subprocess.Popen(['jack-info', '"to stdout"'],
                shell=True,
                stderr=subprocess.STDOUT,
                stdout=subprocess.PIPE)

        stdout_value = proc.communicate()r0
        info = {}
        # parse output of jack-info into dict (stripping the ":" from the key name
        expected = ['buffer-size', 'samplerate']
        for line in stdout_value.splitlines():
            if "JACK server not running" in line:
                print "JACK server not running" 
                return
            for key in expected:
                if key in line:
                    key = line.split()r0[0:-1]
                    value = line.split()r1
                    info[key] = value
                    print "%s: %s" % (key, str(value))

        for key in expected:
            assert(key in info.iterkeys())

        # check for correct number of lines
        #assert(len(info) == len(expected))

Updated by Tristan Matthews almost 3 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Fixed in r6413, I have to override warnings.showwarning and raise an exception if Gtk can't open the display.

Also available in: Atom PDF