Merge lp:~laney/software-center/make-tests-pass into lp:software-center

Proposed by Iain Lane
Status: Merged
Approved by: dobey
Approved revision: 3320
Merged at revision: 3310
Proposed branch: lp:~laney/software-center/make-tests-pass
Merge into: lp:software-center
Diff against target: 191 lines (+23/-39)
8 files modified
run-tests.sh (+3/-17)
setup.py (+0/-2)
softwarecenter/db/pkginfo_impl/packagekit.py (+7/-7)
softwarecenter/db/update.py (+4/-2)
softwarecenter/ui/gtk3/aptd_gtk3.py (+0/-1)
softwarecenter/ui/gtk3/session/displaystate.py (+5/-5)
tests/data/aptroot/etc/apt/sources.list (+3/-3)
tests/test_database.py (+1/-2)
To merge this branch: bzr merge lp:~laney/software-center/make-tests-pass
Reviewer Review Type Date Requested Status
dobey Approve
Review via email: mp+174396@code.launchpad.net

Commit message

Disable some tests and fix up some others to get them in a passing state.

Description of the change

Disable some tests and fix up some others to get them in a passing state.

To post a comment you must log in.
3319. By Iain Lane

Remove disabled python-coverage code from test runner

Revision history for this message
dobey (dobey) wrote :

61 -VERSION = '99.12'
62 +VERSION = '13.05'

This should not be changed here.

review: Needs Fixing
Revision history for this message
Iain Lane (laney) wrote :

On Fri, Jul 12, 2013 at 06:42:27PM -0000, Rodney Dawes wrote:
> Review: Needs Fixing
>
> 61 -VERSION = '99.12'
> 62 +VERSION = '13.05'

Uh, I don't think I did that manually...

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

3320. By Iain Lane

Don't change version in setup.py

Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'run-tests.sh'
2--- run-tests.sh 2013-03-22 13:33:41 +0000
3+++ run-tests.sh 2013-07-12 18:54:28 +0000
4@@ -4,7 +4,7 @@
5
6 TESTS_DIR="tests"
7
8-dpkg-checkbuilddeps -d 'python-coverage, xvfb, python-mock, python-unittest2,
9+dpkg-checkbuilddeps -d 'xvfb, python-mock, python-unittest2,
10 python3-aptdaemon.test, python-lxml, python-qt4'
11
12 if [ ! -e /var/lib/apt-xapian-index/index ]; then
13@@ -19,12 +19,8 @@
14 exit 1
15 fi
16
17-# clear coverage data
18-# coverage erase will not erase the files from --parallel-mode
19-rm -f $TESTS_DIR/.coverage*
20-
21 ./setup.py build
22-# run with xvfb and coverage
23+# run with xvfb
24
25 XVFB_CMDLINE=""
26
27@@ -36,17 +32,7 @@
28 XVFB_CMDLINE="$XVFB -a"
29 fi
30
31-COVERAGE_CMDLINE=""
32-COVERAGE=$(which python-coverage)
33-if [ $COVERAGE ]; then
34- # If you are measuring coverage in a multi-process program, or across a
35- # number of machines, you’ll want the --parallel-mode switch to keep the
36- # data separate during measurement. See Combining data files below.
37- ##COVERAGE_CMDLINE="$COVERAGE run --parallel-mode"
38- echo "No coverage for now."
39-fi
40-
41-PYTHON="$XVFB_CMDLINE $COVERAGE_CMDLINE python -m unittest"
42+PYTHON="$XVFB_CMDLINE python -m unittest"
43
44 # and record failures here
45 OUTPUT=$TESTS_DIR"/output"
46
47=== modified file 'setup.py'
48--- setup.py 2013-05-24 17:39:02 +0000
49+++ setup.py 2013-07-12 18:54:28 +0000
50@@ -17,8 +17,6 @@
51
52 import platform
53 import glob
54-import re
55-from subprocess import call
56 import sys
57
58 from DistUtilsExtra.auto import setup
59
60=== modified file 'softwarecenter/db/pkginfo_impl/packagekit.py'
61--- softwarecenter/db/pkginfo_impl/packagekit.py 2012-12-14 16:44:25 +0000
62+++ softwarecenter/db/pkginfo_impl/packagekit.py 2013-07-12 18:54:28 +0000
63@@ -244,9 +244,9 @@
64 )
65 if not res:
66 return []
67- return [p.get_name()
68- for p in res.get_package_array()
69- if p.get_name() != pkg.name]
70+ return [package.get_name()
71+ for package in res.get_package_array()
72+ if package.get_name() != pkg.name]
73
74 def get_packages_removed_on_install(self, pkg):
75 """ Returns a package names list of dependencies
76@@ -261,10 +261,10 @@
77 )
78 if not res:
79 return []
80- return [p.get_name()
81- for p in res.get_package_array()
82- if (p.get_name() != pkg.name)
83- and p.get_info() == packagekit.InfoEnum.INSTALLED]
84+ return [package.get_name()
85+ for package in res.get_package_array()
86+ if (package.get_name() != pkg.name)
87+ and package.get_info() == packagekit.InfoEnum.INSTALLED]
88
89 def query_total_size_on_install(self, pkgname,
90 addons_install=None,
91
92=== modified file 'softwarecenter/db/update.py'
93--- softwarecenter/db/update.py 2013-05-02 21:35:40 +0000
94+++ softwarecenter/db/update.py 2013-07-12 18:54:28 +0000
95@@ -427,9 +427,9 @@
96 if countrycode in blacklist:
97 if countrycode in whitelist:
98 LOG.debug("%r.make_doc: %r black AND whitelisted for "
99- "region %r. Treating as blacklisted.",
100+ "region %r. Treating as blacklisted.",
101 self.__class__.__name__, name, countrycode)
102-
103+
104 LOG.debug("%r.make_doc: skipping region restricted app %r "
105 "(blacklisted)", self.__class__.__name__, name)
106 return
107@@ -933,6 +933,7 @@
108 def desktopf(self):
109 return self._filename
110
111+
112 class ScopeConfigParser(DesktopConfigParser):
113 """Thin wrapper to handle Scope files."""
114
115@@ -949,6 +950,7 @@
116 if self.has_option(self.SCOPE, key):
117 return self.get(self.SCOPE, key)
118
119+
120 def ascii_upper(key):
121 """Translate an ASCII string to uppercase
122 in a locale-independent manner."""
123
124=== modified file 'softwarecenter/ui/gtk3/aptd_gtk3.py'
125--- softwarecenter/ui/gtk3/aptd_gtk3.py 2012-12-14 16:44:25 +0000
126+++ softwarecenter/ui/gtk3/aptd_gtk3.py 2013-07-12 18:54:28 +0000
127@@ -61,7 +61,6 @@
128
129 if __name__ == "__main__":
130 from softwarecenter.backend.installbackend import get_install_backend
131- from softwarecenter.ui.gtk3.aptd_gtk3 import InstallBackendUI
132 from mock import Mock
133
134 aptd = get_install_backend()
135
136=== modified file 'softwarecenter/ui/gtk3/session/displaystate.py'
137--- softwarecenter/ui/gtk3/session/displaystate.py 2012-11-28 17:36:38 +0000
138+++ softwarecenter/ui/gtk3/session/displaystate.py 2013-07-12 18:54:28 +0000
139@@ -65,11 +65,11 @@
140
141 def __str__(self):
142 s = utf8('%s %s "%s" %s %s') % \
143- (self.category,
144- self.subcategory,
145- self.search_term,
146- self.application,
147- self.channel)
148+ (self.category,
149+ self.subcategory,
150+ self.search_term,
151+ self.application,
152+ self.channel)
153 return s
154
155 def copy(self):
156
157=== modified file 'tests/data/aptroot/etc/apt/sources.list'
158--- tests/data/aptroot/etc/apt/sources.list 2011-01-25 17:24:14 +0000
159+++ tests/data/aptroot/etc/apt/sources.list 2013-07-12 18:54:28 +0000
160@@ -1,3 +1,3 @@
161-deb http://archive.ubuntu.com/ubuntu lucid main
162-deb http://de.archive.ubuntu.com/ubuntu lucid main
163-deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu lucid main
164+deb http://archive.ubuntu.com/ubuntu precise main
165+deb http://de.archive.ubuntu.com/ubuntu precise main
166+deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu precise main
167
168=== renamed file 'tests/test_config.py' => 'tests/disabled_test_config.py'
169=== renamed file 'tests/test_dataprovider.py' => 'tests/disabled_test_dataprovider.py'
170=== renamed file 'tests/test_description_norm.py' => 'tests/disabled_test_description_norm.py'
171=== renamed file 'tests/test_pep8.py' => 'tests/disabled_test_pep8.py'
172=== renamed file 'tests/test_where_is_it.py' => 'tests/disabled_test_where_is_it.py'
173=== renamed file 'tests/gtk3/test_catview.py' => 'tests/gtk3/disabled_test_catview.py'
174=== modified file 'tests/test_database.py'
175--- tests/test_database.py 2013-03-28 07:55:42 +0000
176+++ tests/test_database.py 2013-07-12 18:54:28 +0000
177@@ -1,5 +1,4 @@
178 import apt
179-import platform
180 import os
181 import re
182 import tempfile
183@@ -146,7 +145,7 @@
184 self.assertIsInstance(value.num, long)
185 self.assertIsInstance(value.value, basestring)
186
187- @unittest.skipIf(platform.dist()[2] == "precise", "needs quantal or later")
188+ @unittest.skip("Unreliable: incorrect indices get downloaded")
189 def test_update_from_var_lib_apt_lists(self):
190 # ensure we index with german locales to test i18n
191 os.environ["LANGUAGE"] = "de"