Merge lp:~mikemc/ubuntuone-control-panel/fix-1010211-run-tests-on-darwin into lp:ubuntuone-control-panel

Proposed by Mike McCracken
Status: Merged
Approved by: Diego Sarmentero
Approved revision: 331
Merged at revision: 331
Proposed branch: lp:~mikemc/ubuntuone-control-panel/fix-1010211-run-tests-on-darwin
Merge into: lp:ubuntuone-control-panel
Diff against target: 67 lines (+32/-7)
1 file modified
run-tests (+32/-7)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-control-panel/fix-1010211-run-tests-on-darwin
Reviewer Review Type Date Requested Status
Diego Sarmentero (community) Approve
dobey (community) Approve
Review via email: mp+109250@code.launchpad.net

Commit message

- add support for tests on darwin, warn about missing xvfb instead of quiet exit ( LP #1010211 )

Description of the change

- add support for tests on darwin, warn about missing xvfb instead of quiet exit ( LP #1010211 )

Tested on linux, doesn't break anything there.
Also tested on darwin. Works but some tests fail. Not this script's fault!

To post a comment you must log in.
Revision history for this message
dobey (dobey) wrote :

Looks OK to me. Would like to get rid of all the excessive bits in the future (python $u1lint vs just using u1lint, etc type stuff).

review: Approve
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :
Download full text (8.4 KiB)

[ERROR]
Traceback (most recent call last):
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/tests/test_main.py", line 165, in test_all_styles_load
    main.main([sys.argv[0]])
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/__init__.py", line 89, in main
    source.main(app)
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/linux.py", line 22, in main
    from dbus.mainloop.qt import DBusQtMainLoop
exceptions.ImportError: No module named dbus.mainloop.qt

ubuntuone.controlpanel.gui.qt.main.tests.test_main.MainTestCase.test_all_styles_load
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/tests/test_main.py", line 179, in test_installer_option
    main.main([sys.argv[0], "--installer"])
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/__init__.py", line 89, in main
    source.main(app)
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/linux.py", line 22, in main
    from dbus.mainloop.qt import DBusQtMainLoop
exceptions.ImportError: No module named dbus.mainloop.qt

ubuntuone.controlpanel.gui.qt.main.tests.test_main.MainTestCase.test_installer_option
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/tests/test_main.py", line 153, in test_minimized_option
    main.main([sys.argv[0], "--minimized"])
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/__init__.py", line 89, in main
    source.main(app)
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/linux.py", line 22, in main
    from dbus.mainloop.qt import DBusQtMainLoop
exceptions.ImportError: No module named dbus.mainloop.qt

ubuntuone.controlpanel.gui.qt.main.tests.test_main.MainTestCase.test_minimized_option
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/tests/test_main.py", line 185, in test_minimized_with_icon_options
    main.main([sys.argv[0], "--minimized", "--with-icon"])
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/__init__.py", line 89, in main
    source.main(app)
  File "/Users/gatox/canonical/ubuntuone-control-panel-mmcc/ubuntuone/controlpanel/gui/qt/main/linux.py", line 22, in main
    from dbus.mainloop.qt import DBusQtMainLoop
exceptions.ImportError: No module named dbus.mainloop.qt

ubuntuone.controlpanel.gui.qt.main.tests.test_main.MainTestCase.test_minimized_with_icon_options
===============================================================================
[ERROR]
Traceback (most recent call last):
  File "/Users/ga...

Read more...

review: Needs Fixing
Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run-tests'
2--- run-tests 2012-04-25 13:35:35 +0000
3+++ run-tests 2012-06-07 23:06:17 +0000
4@@ -19,8 +19,9 @@
5 QT_TESTS_PATH="ubuntuone/controlpanel/gui/qt/tests, ubuntuone/controlpanel/gui/qt/main/tests, ubuntuone/controlpanel/gui/qt/uniqueapp/tests"
6 DBUS_TESTS_PATH=ubuntuone/controlpanel/dbustests
7 WINDOWS_TESTS=test_windows.py
8+LINUX_TESTS=test_linux.py
9+DARWIN_TESTS=test_darwin.py
10
11-set -e
12
13 if [ $# -ne 0 ]; then
14 # run specific module given by the caller
15@@ -31,7 +32,7 @@
16 fi
17
18 style_check() {
19- u1lint --ignore ubuntuone/controlpanel/gui/qt/ui
20+ $u1lint --ignore ubuntuone/controlpanel/gui/qt/ui
21 if [ -x `which pep8` ]; then
22 pep8 --exclude '.svn,CVS,.bzr,.hg,.git,*_ui.py,*_rc.py' --repeat . bin/*
23 else
24@@ -45,15 +46,39 @@
25 XVFB_CMDLINE="$XVFB -a"
26 fi
27
28+# now fail on errors, after we tried to find xvfb:
29+set -e
30+
31+SYSNAME=`uname -s`
32+
33+if [ "$SYSNAME" == "Darwin" ]; then
34+ u1trial="python $u1trial"
35+ u1lint="python $u1lint"
36+ IGNORE_FILES="$WINDOWS_TESTS, $LINUX_TESTS"
37+ IGNORE_DBUS="-p $DBUS_TESTS_PATH"
38+ echo "*** Skipping DBus test suite ***"
39+ REACTOR=qt4
40+ PYTHONPATH=$PYTHONPATH:../ubuntu-sso-client:../ubuntuone-client:../ubuntuone-storage-protocol:.
41+else
42+ # Linux:
43+ if [ "x$XVFB_CMDLINE" == "x" ]; then
44+ echo "WARNING: Could not find xvfb-run, prepare for visual spam."
45+ fi
46+ u1trial=u1trial
47+ u1lint=u1lint
48+ IGNORE_FILES="$WINDOWS_TESTS, $DARWIN_TESTS"
49+ IGNORE_DBUS=""
50+ echo "*** Running DBus test suite ***"
51+ $u1trial --reactor=glib "$DBUS_TESTS_PATH"
52+ REACTOR=gi
53+fi
54+
55 echo "*** Running test suite for ""$MODULE"" ***"
56-u1trial --reactor=gi -p "$DBUS_TESTS_PATH, $QT_TESTS_PATH" -i "$WINDOWS_TESTS" "$MODULE"
57-
58-echo "*** Running DBus test suite ***"
59-u1trial --reactor=glib "$DBUS_TESTS_PATH"
60+$u1trial --reactor=$REACTOR -p "$DBUS_TESTS_PATH, $QT_TESTS_PATH" -i "$IGNORE_FILES" "$MODULE"
61
62 echo "*** Running QT test suite for ""$MODULE"" ***"
63 ./setup.py build
64-$XVFB_CMDLINE u1trial -i "$WINDOWS_TESTS" --reactor=qt4 --gui "$MODULE"
65+$XVFB_CMDLINE $u1trial $IGNORE_DBUS -i "$IGNORE_FILES" --reactor=qt4 --gui "$MODULE"
66 rm -rf _trial_temp
67 rm -rf build
68

Subscribers

People subscribed via source and target branches